We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem in Saving sorted Grid data

Hi,

We have used sorting in the ASPOSE grid and its work perfectly.

And we are saving grid data by following way.

Step 1) First we are checking which cell is updated and we are keeping record of row and column no. of updated cell using client side onCellUpdated(cell) function.

Step 2) On click of save button we are taking dataset from Grid datasource and then we are passing row and column no. to dataset and fetching the updated cell data and then we are saving into data base.

Upto this point everything works perfectly but if we sort any column and then update any cell, then if we follow above 2 steps we are not getting the actual updated cell's row and column number. So from dataset we are getting wrong value because of wrong row and column number.

In short I think when we are sorting any column, sorting happening only on sheet and not on grid dataset.

Please advice solution for this. So that we will get proper row and column number after sorting OR on sorting of column number, we should get sorted dataset.

Thanks and Regards

Prasad . G . Godbole

Hi Prasad,

Thanks for your inquiry.

After looking your requirements, I think you may use GridWeb's data binding feature for your task. For implementing data sorting in data binding, you can open the Worksheet Designer editor, click BindColumns... now set the EnableSort property true for your desired columns. Or in your code, you may write:

WebWorksheet.BindColumns[0].EnableSort = true;

For reference, please check the demos:

Also, check the documents:

http://www.aspose.com/documentation/visual-components/aspose.grid-for-.net/binding-worksheet-to-a-dataset-using-gridwebs-worksheets-designer.html

http://www.aspose.com/documentation/visual-components/aspose.grid-for-.net/binding-worksheet-to-a-dataset-at-run-time-using-gridweb.html

http://www.aspose.com/documentation/visual-components/aspose.grid-for-.net/binding-a-worksheet-with-database-using-worksheets-designer-in-vs-net-2005.html

Thank you.