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

How to save all grid grouping control rows back to the database, and what's the right approach?

I have a list of objects then I assign that to the datasource of the grid grouping control to display in my form.
In my grid, I let the user change one column by selecting from a dropdownlist of values, that dropdownlist is available for all rows.

I'm new with Syncfusion control, much more with grid. What's the best approach to let users edit the rows:
1.Edit the rows in the grid any order they want, then have a single button to save all rows?
2. Edit each row and save immediately to database and just not use a save button?

What's the advisable way of doing this, and can you please paste a code to loop through each row in the grid if I need to just use a button to save all change?

Thank you, I just need to have the answers asap as the project is only allowed a few days, and any help would be greatly appreciated.

God bless.

1 Reply

AG Anish George Syncfusion Team February 3, 2014 12:57 PM UTC

Hi Riggs,

 

Thank you for using Syncfusion products.

 

We are quite unclear with your query but however we suggest you to use the SaveQueryCellInfo event. All the changes of the cell will be saved in this event. You can get the required row index and column index in this event.

 

C#:

this.gridControl1.SaveCellInfo += new GridSaveCellInfoEventHandler(gridControl1_SaveCellInfo);

void gridControl1_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)

{

if (e.RowIndex == 5)

{

/// yur code here

}

}

 

You can refer the below KB link for knowing on how to save changes made in grid into the database.

 

http://www.syncfusion.com/support/kb/655/How%20can%20I%20save%20changes%20made%20in%20the%20Grid%20into%20the%20database

 

Please let us know if the provided solution helps you. If not please give us more details regarding this so that we can provide you a solution

 

Regards,

Anish


Loader.
Live Chat Icon For mobile
Up arrow icon