Sorting DataGrid (.Net 1.1) programatically

How to sort DataGrid (no DataGridView) by program For example, I would like that my DataGrid automatically (without click of the user) presents the lines of a DataTable sorted according to increasing numerical values of column 3.

 

Thanks< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />




Answer this question

Sorting DataGrid (.Net 1.1) programatically

  • jony_cool

    I assume your datagrid is bounded to a datatable.
    You can do something like datatable.sort = column3fieldname + ' ASC'

  • ram1608

    I sought a long time without finding the solution. 

    Many Thanks fmardani to have indicated it to me. 

    In the final solution the "sort" is done on DataView:  TabEcart1.DefaultView.Sort = "ColumnFieldName"

    Good !



  • Sorting DataGrid (.Net 1.1) programatically