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
45
Sort by multiple columns at a time with UltraWebGrid
posted

Hello,

I am trying to sort a web grid by multiple columns programmatically. The code I am using is this:

MyWebGrid.Columns.FromKey("LotNumber").SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.Ascending

MyWebGrid.Columns.FromKey("TestMeasure").SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.Ascending

MyWebGrid.Bands(0).SortedColumns.Add(MyWebGrid.Columns.FromKey("LotNumber"),True

MyWebGrid.Bands(0).SortedColumns.Add(MyWebGrid.Columns.FromKey("TestMeasure"),True)

In spite of this, the grid is only sorting by the second column I am adding to the SortedColumns collection. If I check the SortedColumns.Count property  value after executing these lines, it says 1 instead of 2. I need it to sort by both columns: first by Lot Number and then within Lot Numbers sort by Test Measure.

I am not able to sort the data at the SQL statement level due to constraints in the framework of the system. Hard to explain. I'm just interested in sorting by these two columns at the web page level.

FYI - The data is bound before these lines of code. Version I am using is Infragistics 2005. I know it is pretty old, but this is what we got for now. And I don't think the functionality to sort by columns has changed since. Please do not ignore my request for help because of this.

Thanks in advance.

C