DataGrid Sortcommand doesn't work
-
Hi, I have a datagrid with sorting turned on. The datagrid sort event used to fire when I pressed the header but the column header but now it doesn't work anymore. Anyone with any idea why? Rickard
RickardB wrote: The datagrid sort event used to fire when I pressed the header but the column header but now it doesn't work anymore. Anyone with any idea why? Could be any number of things. Here are some guesses without seeing your code: 1) Your SortCommand handler could be missing (OnSortCommand if using inline script, Handles clause in VB.NET codebehind, += event thing in C#) 2) Your columns might not have a SortExpression set. 3) You could have disabled ViewState for the page or the control. 4) You could have databinding code in Page_Load without checking for IsPostBack. 5) You could have clicked the sorting links too many times and wore them out :) I could probably come up with a few more hypothetical scenarios, but it would be much easier if you showed us the code and asked why doesn't this code sort? :) Datagrid Girl http://www.codeproject.com