Row editing ?

2 posts, 0 answers
  1. Thomas
    Thomas avatar
    34 posts
    Member since:
    Nov 2011

    Posted 13 Dec 2011 Link to this post

    Hello,

    Using a RadGridView to make operation on a datatable/dataset,

    If I create or edit a record, and the click on another line, or event some times on another cell from the same line/record,

    I get an exception in 'Program.cs' (the starter class generated by Visual Studio containing Main() method)
    on line  Application.Run(new MyForm());
    It say 'NoNullAllowedException crosser a native/manager boundary.'/'Column ... does not allow null.'

    It seems that this exception can not be caught so my app crashes.
    It doesn't seem to be firing the cell end edit event.

    I understand this come from the dataset validation.

    If the user strictly can not click out of the row while all data are not filled and valid, I think that's too restrictive.

    How could I catch or manager this exception in a more user friendly way ? If possible.


    Thank you for help,

    Thomas
  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 16 Dec 2011 Link to this post

    Hi Thomas,

    This behavior is valid only for bound mode and depends on constraints applied to your DataTable schema. In this situation you can use the DefaultValueNeeded event and fill all required values for your data bound item before editing the values for new row:

    void radGridView1_DefaultValuesNeeded(object sender, GridViewRowEventArgs e)
    {
        e.Row.Cells["MyValue"].Value = "MyValue";
    }

    I hope this help. If you have other questions, do not hesitate to contact me again.

    Best wishes,
    Julian Benkov
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Back to Top