Maintain GridGroupingControl.Table.CurrentRecord on Postback

Hi, I placed a button on the same page of a GridGroupingControl. Is there a way to preserve the GridGroupingControl.Table.CurrentRecord, on postback of this button, and after postback set the Current Record as Editable? Thanks.


4 Replies

JA Janagan Syncfusion Team May 14, 2008 01:42 PM UTC

Hi MB,

Thanks for your interest in Syncfusion products.

Yes. You can have a button to edit and on postback of the button, you can retrieve the current record values as editable by the following code:



protected void Button1_Click(object sender, EventArgs e)
{
this.GridGroupingControl1.TableDescriptor.EditFormSettings.FormEditMode = TableEditMode.Normal;
this.GridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = true;
Syncfusion.Grouping.Record record = GridGroupingControl1.Table.CurrentRecord;
if (record != null)
{
record.BeginEdit();

}
}



Please refer the sample in the link below which illustrates the above:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_ASP_formeditmode2/main.htm


Please try running the sample and let me know if this helps.

Thanks,
Janagan.




- - May 16, 2008 06:29 PM UTC

Thank you for your reply. After editing the row, and saving is there a way to keep the just edited record as selected? What is happening on my side, is that the selected row after the update, becomes always the one on top.




JA Janagan Syncfusion Team May 19, 2008 02:06 PM UTC

Hi MB,

Thanks for the update.

I am afraid that I am not able to reproduce the issue. Also, I have created a sample to test this issue and please refer the sample in the link below:

http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_ASP_formeditmode2/main.htm


Please try running the sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could analyse further and sort out the caues to provide you a better solution?

Thanks,
Janagan.





- - May 20, 2008 01:55 PM UTC

Hi, the sample was helpful to solve the issue. Thanks.


Loader.
Up arrow icon