exceptions in GDBG

I have DataBoundGrid with datatable as datasource. DataTable contains some contstraints. Is it possible to show message boxes when user entered wrong data and do not leave bad row? Wrong data means that DataRow does not meet data condition of DataTable.

3 Replies

SA sahon January 31, 2006 10:06 AM UTC

So nobody can help me? As I understand concept of GDBG is cell event based and there are no event intenally in grid when row saving occur? So I can process this event and rollback if there were something wrong.


AD Administrator Syncfusion Team January 31, 2006 01:54 PM UTC

Hi Sahon, You can handle these in the RowLeave event. Here is the code snippet. private void gridDataBoundGrid1_RowLeave(object sender, Syncfusion.Windows.Forms.Grid.GridRowEventArgs e) { try { dt.AcceptChanges(); } catch { MessageBox.Show("Enter the Column Value in \"PrimaryColumn\" Correctly"); e.Cancel = true; } Console.WriteLine("Row Leave Event"); } Refer to sample for more details Let us know if you further assistance, Regards, Madhan.


SA sahon January 31, 2006 02:27 PM UTC

thank you for the answer. But I decided to use another approach with table that do not have constraints at all and after saving data apply modified data to source table. It will give me flexibility to check data and full error handling control.

Loader.
Up arrow icon