We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

adding new row to the grid

Hi
Iam using GridGroupingControl. I want to add a new row to the grid. I used GridGroupingControl1.Table.AddNew(); and i get editable row in the grid. Once i enter the cell value i want to save those values to the data set associated with the grid. I tried using CurrentRecordContextChange event. But i could not do that. Can anybody suggest me how can i do that?

3 Replies

AD Administrator Syncfusion Team October 23, 2006 11:34 PM UTC

Alfred,

In CurrentRecordContextChange event, look for e.Action to be CurrentRecordAction.EndEditComplete.

Then get the current record and the new values in the record as follows:

// using Syncfusion.Grouping;

Record r = this.grid.Table.CurrentRecord;

object newValue = r.GetValue("fieldName");

// Use this to update the datasource directly.

Regards,
Praveen


AD Alfred D'Souza October 25, 2006 03:52 AM UTC


Hi Praveen
Thanks For your reply
I followed following steps

GridGroupingControl1.Table.AddNew();
Then i get a row where i can enter the column values.
Then i have in the CurrentRecordContextChange
if (e.Action == CurrentRecordAction.EndEditComplete)
{
// processing code
}
My question is when EndEditComplete will occur. Is it on pressing enter key or while changing rows? When row is in editing mode CurrentRecordContextChange event is not fired at all for any actions.

Alfred


>Alfred,

In CurrentRecordContextChange event, look for e.Action to be CurrentRecordAction.EndEditComplete.

Then get the current record and the new values in the record as follows:

// using Syncfusion.Grouping;

Record r = this.grid.Table.CurrentRecord;

object newValue = r.GetValue("fieldName");

// Use this to update the datasource directly.

Regards,
Praveen


AD Administrator Syncfusion Team October 26, 2006 08:46 PM UTC

Hi Alfred,

This event will occur while changing rows after you edit.

Please refer to this
Loader.
Live Chat Icon For mobile
Up arrow icon