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
XAMDataGrid Set FieldSetting and Field LayoutSettings

HI All,

Hope someone can assist me. I have a XAMDataGrid and a Combobox on my form. The combobox has 2 items. What i want to do is set the following fields:

Combo Index 0 Selected:

1. FieldSettings - CellClickAction: EnterEditModeIfAllowed

2. FieldLayoutSettings - SelectionTypeCell: Single

Combo Index 1 Selected:

1. FieldSettings - CellClickAction: SelectCell

2. FieldLayoutSettings - SelectionTypeCell: ExtendedAutoDrag

When I set the value in code behind I get the following error: "Exception has been thrown by the target of an invocation." 

FieldSettings set = testGrid.FieldSettings;
FieldLayoutSettings lay = testGrid.FieldLayoutSettings;

if (matrixTuningComboBox.SelectedIndex == 1)
set.CellClickAction = CellClickAction.SelectCell;
lay.SelectionTypeCell = Infragistics.Windows.Controls.SelectionType.ExtendedAutoDrag;
set.CellClickAction = CellClickAction.EnterEditModeIfAllowed;
lay.SelectionTypeCell = Infragistics.Windows.Controls.SelectionType.Single;

testGrid.FieldSettings = set;
testGrid.FieldLayoutSettings = lay;

Please see the attachment.

Friendly Regards,


  • 33730
    Offline posted

    Hello Roelof,

    I have been investigating into your sample project on this matter, and have reproduced the behavior you are seeing. After investigating the actual exception that is occurring, nothing in the stack trace appears to be Infragistics-related, but I cannot seem to see a problem with the code that you have provided in the sample either.

    Interestingly, if I comment out the code that is checking the e.PropertyName for "ColIndex" I cannot seem to get this exception to happen, which leads me to believe that this is a timing issue with the application you sent versus the internal code of the XamDataGrid.

    I will be continuing to investigate into this behavior and I hope to have more information for you soon. Please let me know if you have any other questions or concerns on this matter.

Reply Children
No Data