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
20
XamComboEditor RequireEmptyConstructorException when CustomValueEnteredAction="Allow"
posted

This is specifically to having a DataView as the underlying datasource, and, specific to the comma char. I can type all I want, letters, numbers, spaces, or going back, but the comma character (and possibly other non-alpha chars, although I haven't checked them) causes the XamComboEditor to attempt to create a new DataRowView. Since that class has no parameterless constructor, it fails. My understanding is that this should NOT be happening when CustomValueEnterAction="Allow". 

Parents Reply
  • 2680
    Offline posted in reply to Adrian Abshere

    Hi Adrian,

    I believe the suggested approaches are an exhaustive list of the ways to address this. The “Add, Allow, Ignore” are also the available options for the behavior on user input.

    While I understand  that creating an empty DataRowView object causes errors due to constraint violations in the underlying data tables, the approach involving assigning temporary unique values and altering them after the user fills in the necessary information sounds viable given the scenario.

    While it is possible that I might be missing some aspects of the scenario, I modified the previous sample, so that a second column is added to the DataTable having its “AllowDBNull” property set to ‘false’ as a sample constraint. The DataObjectRequested handler remains the same, however, the ItemAdding and ItemAdded events are leveraged to intercept the process and collect user input for that second column. After filling the data, the combo editor’s text is cleared and the proper data item is added to the underlying data source. I am attaching the sample below and I hope it helps in implementing the target workflow.

    If this is not an accurate demonstration of what you are trying to achieve, please, modify the sample with only relevant code and send it back to me along with further details, so I can investigate other potential approaches. Thank you for your cooperation.

    Best regards,
    Bozhidara Pachilova

    1524.XCEDataView2.zip

Children
No Data