Configurator - Changing Appearance

Trying to change the background color of an input box when someone enters a value greater than or less than min/max values of an Attribute through Input Property ‘On Field Changed’

Epicor keeps freezing in the ‘Responding’ mode and I have to close the program when I type ‘Infragistics.’

I can’t get the balance of the code…
Infragistics.Win.Appearance app1 = new Infragistics.Win.Appearance();
app1.BackColor = Color.Red;
((Ice.Lib.Framework.EpiTextBox)Inputs.epiPcNumericEditor01.Control).UseAppStyling = false;
((Ice.Lib.Framework.EpiTextBpx)Inputs.epiPcNumericEditor01.Control).Appearance = App1;

Any thoughts why Epicor would be stuck in ‘Responding’?

Here is my code from Configurator UD Method:


			//Initialize color settings.
			Color badBox = ColorTranslator.FromHtml("#FF9999");  // Light reddish color
			if ( InvalidBackColor.ToString() != "" ) {  
				badBox = ColorTranslator.FromHtml(InvalidBackColor.ToString()); 
			} 
			Infragistics.Win.Appearance appBadInfo = new Infragistics.Win.Appearance();
			appBadInfo.BackColor = badBox;


			//Now validate the fields against one another for compatibility.
			//If they do not agree with eachother change comboBox backgrounds to light reddish color.
			if ( ( HasBrakes != BrakeTongue ) || ( BrakeAxlesCount != TongueBrakesCount ) ) {
				((Ice.Lib.Framework.EpiUltraCombo)Inputs.cmbBrakes.Control).UseAppStyling = false;
				((Ice.Lib.Framework.EpiUltraCombo)Inputs.cmbTongue.Control).UseAppStyling = false;
				((Ice.Lib.Framework.EpiUltraCombo)Inputs.cmbBrakes.Control).Appearance = appBadInfo;
				((Ice.Lib.Framework.EpiUltraCombo)Inputs.cmbTongue.Control).Appearance = appBadInfo;
			} else {  //Reset to themed styling if good data.
				((Ice.Lib.Framework.EpiUltraCombo)Inputs.cmbBrakes.Control).UseAppStyling = true;
				((Ice.Lib.Framework.EpiUltraCombo)Inputs.cmbTongue.Control).UseAppStyling = true;
			}

Don’t type the period until AFTER the next word, the intellisense is BAD and crashed for me lots. :exploding_head: :cry:

Thanks, not typing the period is working better.

Keep getting CS1002 expecting a semicolon. I think it might be an incorrect control type (i think that term is correct)…EpiNumericEditor.

Infragistics.Win.Appearance app1 = new Infragistics.Win.Appearance();
app1.BackColor = Color.Red;

if ((epiPcNumericEditor1 < .151) || (epiPcNumericEditor1 > .161))
{
((Ice.Lib.Framework.EpiNumericEditor)Inputs.epiPcNumericEditor1.Control)UseAppStyling = false;
((Ice.Lib.Framework.EpiNumericEditor)Inputs.epiPcNumericEditor1.Control)Appearance = App1;
}
else
{
((Ice.Lib.Framework.EpiNumericEditor)Inputs.epiPcNumericEditor1.Control)UseAppStyling = true;
}

That should be the correct type:

try:

if (( Inputs.epiPcNumericEditor1.Value < .151) || ( Inputs.epiPcNumericEditor1.Value > .161))

instead of

1 Like

That did not work. Still getting hit with the three lines of error.

CS1002 - x:\Users\Me.Domain\Filepath\InspectionPlanInputEventCollection.cs (65,73) - ; expected
CS1002 - x:\Users\Me.Domain\Filepath\InspectionPlanInputEventCollection.cs (66,73) - ; expected
CS1002 - x:\Users\Me.Domain\Filepath\InspectionPlanInputEventCollection.cs (72,73) - ; expected

corresponds to the 3 lines with the numericeditor in it (or a coincidence). Since I have semicolons, there must be a syntax or some other issue with the code there.

I dont think you need the parenthisis… try

Ice.Lib.Framework.EpiNumericEditor.Inputs.epiPcNumericEditor1.Control.UseAppStyling = false;

try:

if (( Inputs.epiPcNumericEditor1.Value < 0.151m )  ||  ( Inputs.epiPcNumericEditor1.Value > 0.161m ))

instead of:

I just tested this code and it compiles/works fine…

if (( Inputs.decBasePrice.Value < 0.151m )  ||  ( Inputs.decBasePrice.Value > 0.161m ))
{ 
Infragistics.Win.Appearance app1 = new Infragistics.Win.Appearance();
app1.BackColor = Color.Red;
((Ice.Lib.Framework.EpiNumericEditor)Inputs.decBasePrice.Control).UseAppStyling = false;
				((Ice.Lib.Framework.EpiNumericEditor)Inputs.decBasePrice.Control).Appearance = app1;
}

BTW credit for this is @josecgomez my solution was derived based on this video

1 Like

Tim, tried removing the parentheses from the code as suggested.
Now not liking the ‘Inputs’ now. Also not liking the if statement.

Infragistics.Win.Appearance app1 = new Infragistics.Win.Appearance();
app1.BackColor = Color.Red;
if ((Inputs.epiPcNumericEditor1.value < .151m) || (Inputs.epiPcNumericEditor1.value > .161m))
{
Ice.Lib.Framework.EpiNumericEditor.Inputs.epiPcNumericEditor1.Control.UseAppStyling = false;
Ice.Lib.Framework.EpiNumericEditor.Inputs.epiPcNumericEditor1.Control.Appearance = app1;
}
else
{
Ice.Lib.Framework.EpiNumericEditor.Inputs.epiPcNumericEditor1.Control.UseAppStyling = true;
}

CS1061 - x:\Users\Me.Domain\AppData\Local\Temp\48\ConfigDump\Client\InspPlanInputEventCollection.cs (63,33) - ‘Erp.Shared.Lib.Configurator.InputControlValueBound<Ice.Lib.Framework.EpiNumericEditor,decimal>’ does not contain a definition for ‘value’ and no extension method ‘value’ accepting a first argument of type ‘Erp.Shared.Lib.Configurator.InputControlValueBound<Ice.Lib.Framework.EpiNumericEditor,decimal>’ could be found (are you missing a using directive or an assembly reference?)

CS1061 - x:\Users\Me.Domain\AppData\Local\Temp\48\ConfigDump\Client\InspPlanInputEventCollection.cs (63,79) - ‘Erp.Shared.Lib.Configurator.InputControlValueBound<Ice.Lib.Framework.EpiNumericEditor,decimal>’ does not contain a definition for ‘value’ and no extension method ‘value’ accepting a first argument of type ‘Erp.Shared.Lib.Configurator.InputControlValueBound<Ice.Lib.Framework.EpiNumericEditor,decimal>’ could be found (are you missing a using directive or an assembly reference?)

CS0117 - x:\Users\Me.Domain\AppData\Local\Temp\48\ConfigDump\Client\InspPlanInputEventCollection.cs (67,36) - ‘Ice.Lib.Framework.EpiNumericEditor’ does not contain a definition for ‘Inputs’

CS0117 - x:\Users\Me.Domain\AppData\Local\Temp\48\ConfigDump\Client\InspPlanInputEventCollection.cs (68,36) - ‘Ice.Lib.Framework.EpiNumericEditor’ does not contain a definition for ‘Inputs’

CS0117 - x:\Users\Me.Domain\AppData\Local\Temp\48\ConfigDump\Client\InspPlanInputEventCollection.cs (73,36) - ‘Ice.Lib.Framework.EpiNumericEditor’ does not contain a definition for ‘Inputs’

Clint,
Tried changing code as you describe, but with same results. Agreed with credit to Mr Gomez that was my source as well. Strange that it worked on his video, works for you, but not here.

Could there be Input Properties settings that affect this?

if ((Inputs.epiPcNumericEditor1.value < .151m) || (Inputs.epiPcNumericEditor1.value > .161m))
{
Infragistics.Win.Appearance app1 = new Infragistics.Win.Appearance();
app1.BackColor = Color.Red;
((Ice.Lib.Framework.EpiNumericEditor)Inputs.epiPcNumericEditor1.Control)UseAppStyling = false;
((Ice.Lib.Framework.EpiNumericEditor)Inputs.epiPcNumericEditor1.Control)Appearance = app1;
}
else
{
((Ice.Lib.Framework.EpiNumericEditor)Inputs.epiPcNumericEditor1.Control)UseAppStyling = false;
}

CS1002 - x:\Users\Me.Domain\AppData\Local\Temp\48\ConfigDump\Client\InspPlanInputEventCollection.cs (64,73) - ; expected

CS1002 - x:\Users\Me.Domain\AppData\Local\Temp\48\ConfigDump\Client\InspPlanInputEventCollection.cs (65,73) - ; expected

CS1002 - x:\Users\Me.Domain\AppData\Local\Temp\48\ConfigDump\Client\InspPlanInputEventCollection.cs (69,73) - ; expected

Did you add the leading 0?

if (( Inputs.epiPcNumericEditor1.Value < 0.151m )  ||  ( Inputs.epiPcNumericEditor1.Value > 0.161m ))

Same result.

Opps I see it you missed the . before the last property .UseAppStyling =

Thanks, that worked to correct the CS1002. Found another one related to thej CS1061 errors.
I really hate my typing errors.

By the way what is the ‘m’ in (< 0.151m) doing? Changing the format? And to what?

I noticed that if it is not there a [CS0019 - Operator ‘<’ cannot be applied to operands of type ‘decimal’ and ‘double’ ] error occurs.

Thanks for all the help.

Yes that signifies the number is a decimal and not a double.

Welcome! :smiley: