Groups | Blog | Home
all groups > flash data integration > december 2006 >

flash data integration : Datagrid Sorting



srirama.83
12/20/2006 12:00:00 AM
I have a datagrid which displays the values from the Dataset. The Dataset
values are not sorted alphabetically. So the datagrid initially displays the
values in an unsorted manner. Only when I click on the header of the datagrid
the values are displayed in assorted manner. I want the datagrid to display the
values in alphabetical order when it is loaded with the values. Can this be
done ?
If so anyone please let me know how to do that .
KLee
12/21/2006 5:00:34 AM
If you are loading the data into the grid from a database, put an order by in your select with the order you want the grid loaded with.

ie. Select * from table
where ...(optional)
order by column1, column2 etc


From http://www.developmentnow.com/g/70_2006_12_0_0_867047/Datagrid-Sorting.htm

Posted via DevelopmentNow.com Groups
Scott Johnson
12/21/2006 6:15:08 AM
sort the dataset prior to loading it into the datagrid.

Check the help files for dataset.addSort() and dataset.userSort()

Basically you will use the dataset.addSort()

dataset.addSort(name,field);
name = name you want to call this sort
filed = the field you want to sort on.

Then you call the dataset.useSort()

dataset.useSort(name)
name = what you called the sort in addSort.

Now your dataset is sorted.



[quoted text, click to view]
AddThis Social Bookmark Button