Sort DataGridView in Run Time

Below Code Will Helpful to Sort DataGridView at Run Time.

 
Dim MyDataView As New DataView
MyDataView = ds.Tables(0).DefaultView 'ds is dataset u need to bind first
MyDataView.Sort = "SortColumnName"
'SortColumnName is the name of the columnName of DataGridView you want to
Sort.
DGVFindList.DataSource = MyDataView 'DGVFindList is GridView Name

Regards
Santosh


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: