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
335
XamComboEditor in XamGrid INotifyDataErrorInfo Validation
posted

Dear Support-Team,


i implemented an editable XamComboEditor via TemplateColumn with AllowEditableValidation set to true.

in the provided solution there is a viewModel hierarchy where everey row in the xamGrid has its own viewmodel instance, that implements INotifyDataErrorInfo.

In the AddingItem EventHandler i check the Validation and if it fails here, AddingItemEventArgs.Cancel is set to true and ErrorChanged event is raised (in the base class) for the property. Here the validated cell should stay in edit mode with the error being displayed, but it does not.

I just cannot get the Validation to work, the control completely ignores the Validation in the ViewModel.


Thanks in advance

Thomas

TemplateColumnComboEditor.zip
Parents
  • 335
    posted

    Hallo, it seems, that i cannot invoke the validation in the TemplateColumn, when committing the input by leaving the Edit-Mode, i.e. by clicking on another row or somewhere else, because at that point, when NotifyErrorsChanged is called in the AddingItem-EventHandler in the viewModel, the EditMode is over and the bindings must be all gone. But it is not clear why there is no validation when commiting the input by pressing the enter key. Here the edit-mode stays open, the bindings must be intact.

    That is why i provide a second solution, where the NotifyErrorsChanged-Event is raised in the Setter of the 'SelectedValue'-property. It is the same, no validation.

    So in the business app i went back to the old fashion style, giving feedback to the user in form of the good old message window dialog.


    Over all besides any validation problems, there seems to be a serious bug, when using an editable XamComboEditor as DataTemplate for the TemplateColumn with autocomplete = true:

    when running the provided solution: in any ComboBox type in a random value (that has no match in the drop down values). Wait for the AutocompleteDelay to pass, now the DropDownList tries to open. (There is a very narrow small empty box visible in the upper or lower border of the XamComboEditor). Press the 'Tab'-Key to commit the input and to go to to the next row. ->

    'System.ArgumentException' occurred in System.Windows.dll

    I could not figure out that exception, please tell me how i can fix this problem?


    Don't hesitate to ask me, if you need more information on that subjects. The provided solution is Silverlight 5, Ingragistics v12.1

    Thomas

    TemplateColumnComboEditor2.zip
Reply Children
No Data