Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
420
Error when conditional formatting is present and you try to load a layout from XML.
posted

Hi..

This error happens when we have a conditional formatting code and then you try to load a new layout. The error is "Exception thrown by the target of invocation". The workaround is to use the initialize grid row event instead of conditional formatting. Any ideas?

InitializeLayout event code: (Red color for numbers less than 0)

OperatorCondition conditionLessThen0 = new OperatorCondition(ConditionOperator.LessThan, 0);

Infragistics.Win.Appearance appearanceRed = new Infragistics.Win.Appearance();

appearanceRed.ForeColor = Color.Red;ConditionValueAppearance valAppearanceLessThen0 = new ConditionValueAppearance();

valAppearanceLessThen0.Add(conditionLessThen0, appearanceRed);

column.ValueBasedAppearance = valAppearanceLessThen0;

 

Load layout code on click of a button:

if (File.Exists(LayoutFilenameTrades))

grdPnLGrid.DisplayLayout.LoadFromXml(LayoutFilenameTrades);

Parents Reply Children
No Data