I have a form with an ultraGrid that stores the data in an ultraDataTable. When the user presses a button on the form, the grid adds a row to the grid and is then resorted based on the values entered. My problem is when the grid is exported to Excel, the added rows are being display at the end of the table, instead of their visible positions after the grid has been sorted. For example, I have 10 rows, I add a new row that is sorted into the middle, excel export then places this new row at the end of the list instead of where it is currently visible on the grid. Is there a setting that I'm missing that exports the data based on its visible position in the grid instead of the data's list index in the ultraDataTable?
Hi,
I'm afraid I'm having a hard time following you.
There's no ultraDataTable that I am aware of. Did you mean a DataTable? Or an UltraDataSource? Either way, I doubt that the data source makes any difference.
Can you describe in more detail exactly what you are doing? You are adding a row - but adding it to what? To the grid? To the data source?
How are you then performing a sort? The sort is something based on the values in the new row?
Can you post a small sample project demonstrating this behavior? I can think of no reason why the sorting in Excel could possibly be different than the sorting in the grid on the screen. Unless you are exporting before the sort takes place.
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
I’m sorry, I had meant that I’m using an UltraDataSource bound to the Ultragrid. I did figure out what the issue was. After I had sorted the grid in the manner that I needed, I was disabling the sort indicators so there would be no indication that any sorting had been done. With no sort direction on the grid, the excel exported must be taking the default order (ie the order that the rows were added) when exporting. By enabling the sort indicators just before exporting, the proper order is maintained and therefore my problem fixed. Thanks for your reply!