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
Hi criveraf,
Please feel free to contact me if you have any questions.
Thank you for posting in the community.
I can see no issues with the manner in which you are adding your columns in the SortedColumns collection. Attached is my test sample illustrating this scenario (using version 7.1 as it is the earliest one available for testing). Please let me know if the behavior persists in the provided grid. A small sample illustrating the behavior would be greatly appreciated and would allow me to examine the matter in more detail.