Hi,
I need to set the default sort column the first time the grid is loaded.
The following code has been added just after calling DataBind
this.UltraWebGrid1.Bands[0].SortedColumns.Add(this.UltraWebGrid1.Bands[0].Columns[0]);
Unfortunately, this does not effect the sorting at all and the rows remain unordered. Do you need to set the sort columns by a particular stage in the page or ultragrids life cycle?
Cheers
Russ
SortIndicator was the missing link!
Many Thanks Johni!!
Below is the code that works for me, maybe you should set the SortIndicator property
<igtbl:UltraWebGrid runat="server" id="UltraWebGrid1" Width="100%" Height="100%"> <DisplayLayout AllowSortingDefault="Yes" HeaderClickActionDefault="SortMulti" > </DisplayLayout></igtbl:UltraWebGrid>
this.UltraWebGrid1.DataSource = exportData;
this.UltraWebGrid1.DataBind();
if (this.UltraWebGrid1.Bands[0].Columns[0]!= null){ this.UltraWebGrid1.Bands[0].Columns[0].SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.Ascending; this.UltraWebGrid1.Bands[0].SortedColumns.Add(this.UltraWebGrid1.Bands[0].Columns[0], true);}
Hope it helps
Johni Ecco
Hi Johni,
Thanks for taking the time to reply. I have tried every single overrloaded of SortedColumns.Add() and none of them are working for me.
//bind to the data source
If I click the column then it works fine.
Hi Russ,
For me this works fine, but i use true for the performSort like this:
this.UltraWebGrid1.Bands[0].SortedColumns.Add(this.UltraWebGrid1.Bands[0].Columns[0], true);