Pinned topic How to reset sort in datagrid
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
I have a datagrid widget that I am populating based on a database extract. Using the inherent capabilities of the widget, I sort a column by selecting it. I now want to be able to undo the sort (ie set the data back to how it was originally displayed (where I populate the data by sorting on three keys). If I reload the data from the database, it stays in the same sort, thus my only current solution is to reload the page which isn't the cleanest solution. I imagine that there is some option within the datagrid that I can set to reset the sort, but I can't find anything. Without writing a ton of custom code, does anyone know of a solution for this?
Updated on 2013-01-18T14:30:25Z at 2013-01-18T14:30:25Z by SystemAdmin
SystemAdmin 110000D4XK6195 Posts
Re: How to reset sort in datagrid2013-01-18T14:30:25ZThis is the accepted answer. This is the accepted answer.Thank you Ji Yong for the code snipet:
for(i int from 1 to DataGrid.columns.getSize())
DataGrid.columns[i].sortDirection = DataGridLib.SORT_NONE;