Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
910
Sort on initializelayout does not appear to be working
posted

I am trying to sort a column with this code

' sort based on the percentage difference column, defaulting to worst performers first.
e.Layout.Bands(0).Columns(4).SortIndicator = SortIndicator.Ascending
e.Layout.Bands(0).Columns(4).InitialSortDirection = SortDirection.Ascending
e.Layout.Bands(0).SortedColumns.RefreshSort(True)

I also tried putting the code in later, after I populated the table:

UltraGrid1.DataSource = dtCache ' sort based on the percentage difference column, defaulting to worst performers first.
UltraGrid1.DisplayLayout.Bands(0).Columns(4).SortIndicator = SortIndicator.Ascending
UltraGrid1.DisplayLayout.Bands(0).SortedColumns.RefreshSort(True)

I added iniitialsortdirection because sortindicator didn't seem to be sorting (it is setting the indicator), but to no avail. Essentially, the column sort indicator is set, but the column is NOT sorting until I click on the column header. I am trying to do in code the equivalent of manually clicking on the column heading, to initiate a sort.

Thanks.

Parents Reply Children