This is a migrated thread and some comments may be shown as answers.

Row editing ?

1 Answer 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 13 Dec 2011, 08:36 PM
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

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 16 Dec 2011, 11:02 AM
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.

Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or