I have default sorting in my data grid. So I setup default GridSortExpression in Page Load. When I retrieve the data, I pass the Field Name and Sort Order to my SQL Query. So GetSortExpression () function return Sort Expression object. It is working fine for first time and show background color and sort indicator but if u clicks this default sort column again I got the following error. Yes, there is o count in tableView.SortExpressions collection. But I click other column first then click that date column, grid sorted accordingly.
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: indexe
I reviewed the code, and the setup looks correct. However, to properly track the issue, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted behavior. We will debug it locally, and get back to you with additional information.