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
1180
Sort UltraDataSource of UltraGrid
posted

Hi Team,

I am currently using a UltraGrid which bind to UltraDataSource. I want to apply sort function on the grid.

1. I tried grid.SortedColumns.Add(XXX). This applied the sort on Grid. However, I found out this won't effect the data on UltraDataSouce which somehow I need to sorted as well.

2. Then I tried to sort on the ultraDataSource. I sorted the tag of rows as well. However, it doesn't apply any sort on the grid. Am I missing anything? Do I need to sort on the UltraDataSource.Rows rather than Tag? How can I get the businees object behind and sort on the them?

List<Row> rows_= mainUltraDataSource.Rows.Tag as List<Row>;
rows_.Sort(XXX)
Thanks,
Xin
Parents
  • 469350
    Offline posted

    Hi,

    The Tag property on the Rows collection is just a place to store extra data. It's not a List of any kind and sorting it will do nothing unless you happen to have placed an object into it that supports sorting. Either way, this will not affect the rows of the UltraDataSource.

    The UltraDataSource has no built-in sorting functionality.

    Sorting the grid will never affect the order of the rows in the data source. This would not make any sense, since the same data source could be bound to any number of grids.

    Perhaps if I knew more about why are you trying to sort the data source, I could point you in the right direction.

Reply Children