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

event changing

Hi,
What is the event RecordValueChanged in control, Gripgrouping

tanks

Gilbert


5 Replies

AD Administrator Syncfusion Team April 1, 2008 08:48 AM UTC

Hi Gilberto,

Sorry for the delay in responding.

"Recordvaluechanged event" is triggered even if record values are not changes in Edit Mode. So check for the variable, ''IsRecordValueChanged'' which is set to true if record value is changed.

In GridGroupingControl we can update the grid as well as data source more effectively by handling the CurrentRecordContextChange event than the DataSourceRowUpdating event. In CurrentRecordContextChange event you can access the current record and then you can change the value manually using SetValue method. Please refer the below code snippet which illustrates this:


[C#]
protected void GridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
{

//This event will be called on each action performed on a record. Here "EndEditComplete" is the final action for Editing. If this action is succeed, then data Source can be updated here.
if (e.Action == Syncfusion.Grouping.CurrentRecordAction.EndEditComplete && e.Success==true)
{
//This event is triggered even if record values are not changes in Edit Mode. So check for the variable, ''IsRecordValueChanged'' which is set to true if record value is changed.
if (IsRecordValueChanged)
{
Record r = e.Table.CurrentRecord;
r.SetValue("FirstName", "Johny");
}
}
}


Please refer the sample from the following link which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.1.0.34/F72566/main.htm

Please let me know if you have any other concerns.

Regards,
G.Yavana



GB Gilberto Barahona April 4, 2008 09:42 PM UTC

Hi, G.YavanaArasy, yes is one good example, now, what do you carching, one new value, of one new record?
Tank Gilbert.

>Hi Gilberto,

Sorry for the delay in responding.

"Recordvaluechanged event" is triggered even if record values are not changes in Edit Mode. So check for the variable, 'IsRecordValueChanged' which is set to true if record value is changed.

In GridGroupingControl we can update the grid as well as data source more effectively by handling the CurrentRecordContextChange event than the DataSourceRowUpdating event. In CurrentRecordContextChange event you can access the current record and then you can change the value manually using SetValue method. Please refer the below code snippet which illustrates this:


[C#]
protected void GridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
{

//This event will be called on each action performed on a record. Here "EndEditComplete" is the final action for Editing. If this action is succeed, then data Source can be updated here.
if (e.Action == Syncfusion.Grouping.CurrentRecordAction.EndEditComplete && e.Success==true)
{
//This event is triggered even if record values are not changes in Edit Mode. So check for the variable, 'IsRecordValueChanged' which is set to true if record value is changed.
if (IsRecordValueChanged)
{
Record r = e.Table.CurrentRecord;
r.SetValue("FirstName", "Johny");
}
}
}


Please refer the sample from the following link which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.1.0.34/F72566/main.htm

Please let me know if you have any other concerns.

Regards,
G.Yavana





AD Administrator Syncfusion Team April 7, 2008 11:01 AM UTC

Hi Gilberto,

Thank you for your update.

Could you please give more details regarding your question (what do you carching, one new value, of one new record) so that we could provide you a better solution?

Regards,
G.Yavana



GB Gilberto Barahona April 7, 2008 06:22 PM UTC

Hi,
The question is: what is the event to get the new value added when a new record?



JA Janagan Syncfusion Team April 28, 2008 03:07 PM UTC

Hi Gilberto,

Thanks for the update.

The currentrecordcontext change event works fine for inserting new values in the record and for updating the values in it.



C#]
protected void GridGroupingControl1_CurrentRecordContextChange(object sender, Syncfusion.Grouping.CurrentRecordContextChangeEventArgs e)
{

//This event will be called on each action performed on a record. Here "EndEditComplete" is the final action for Editing. If this action is succeed, then data Source can be updated here.
if (e.Action == Syncfusion.Grouping.CurrentRecordAction.EndEditComplete && e.Success==true)
{
//This event is triggered even if record values are not changes in Edit Mode. So check for the variable, 'IsRecordValueChanged' which is set to true if record value is changed.
if (IsRecordValueChanged)
{
Record r = e.Table.CurrentRecord;
r.SetValue("FirstName", "Johny");
}
}
}




Please refer the sample from the following link which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.1.0.34/F72566/main.htm

Please try running the sample and if still the issue exists, could you please try reproducing it in the above sample, so that we could sort out the cause and provide you a better solution>

Regards,
Janagan.








Loader.
Live Chat Icon For mobile
Up arrow icon