2 Replies Latest reply on Jun 25, 2008 2:26 PM by mikkin123

    sorting datagrid column

      Hello everyone,

      I am looking to sort a column in the datagrid that is getting populated by the database. I want to sort the column without user having to click on the header. Also I cannot use orderby or groupby commands in sql, just in case if you wonder why am not doing that instead. Any help would be really appreciated.

        • 1. Re: sorting datagrid column
          Gregory Lafrance Level 6
          See this help topic, then execute the sort in the DataGridColumn or DataGrid creationComplete event handler:

          Sorting data in DataGrid controls
          • 2. Re: sorting datagrid column
            mikkin123 Level 1
            Hey Greg,
            Thanks for that topic. Actually, I have already checked that out and it still needs the user click on the header of the column for sorting. I am specifically looking for the sorting to take place without any user clicks. Actually, I have this radio button group with two choices asc or desc. If a user checks asc and then presses the submit button on the page, then the data is displayed in ascending order and the other way for desc. I am sorry, I cannot post the code due to corporate security rules.

            Once again thanks for the help and it would be great if anyone can help with this part.