How do I sort a DGV by multiple columns. I've seen a few discussions on the topping while searching google, but I don't understand what is going on.
Plz help me
Printable View
How do I sort a DGV by multiple columns. I've seen a few discussions on the topping while searching google, but I don't understand what is going on.
Plz help me
Code:Dim table = New DataTable()
table.Columns.Add("Letter", GetType(Char))
table.Columns.Add("Number", GetType(Integer))
table.Rows.Add("A"c, 1)
table.Rows.Add("B"c, 3)
table.Rows.Add("A"c, 3)
table.Rows.Add("A"c, 2)
table.Rows.Add("B"c, 2)
table.Rows.Add("B"c, 1)
'//apply sort on Letter, then Number column
table.DefaultView.Sort = "Letter, Number"
Me.DataGridView1.DataSource = table