When you bind your DataGridView to your datasource, use a bindingsource.
Dim nwData as CustomersDataSet = CustomersDataSet.GetCustomers()
m_CustomersGrid.DataSource = m_CustomersBindingSource
m_CustomersBindingSource.DataSource = nwData.Customers
Then you can sort using the BindingSource.
CustomersBindingSource.Sort = "ContactName ASC"
And you can find using the BindingSource.
Dim index as integer = _
CustomersBindingSource.Find("CompanyName", CompanyNameTextBox.Text)
If index <-1 then 'it was found; move to that position
CustomersBindingSource.Position = index
End If
Robin S.
-------------------------------------------
"Freddy Coal" <fr********@gmail.comwrote in message
news:OO*************@TK2MSFTNGP05.phx.gbl...
Hi, I'm learning to use the Datagridview; I would like sort a column of
my
DGV, but with code, not with user click over the column, how make that?;
Mi other question is how
search for a especific chain in my DGV?.
Thanks in advance for any help, I'm using VB.Net in VS2005.
Freddy Coal