i have a datagrid populated by a dataset
i want to check for a particular row in the dataset. if the exact number exist then select that row other wise show me the nearest match ie if i type 7001 and there is no record matching 7001 then it should select 700
My Code is attached below
Dim tt As Integer
tt = grdac_chart.CurrentRowInde
x
grdac_chart.UnSelect(tt)
dtEmployee.PrimaryKey = New DataColumn() {dtEmployee.Columns("accou
ntref")}
dtEmployee.DefaultView.Sor
t = "accountref"
If dtEmployee.Rows.Contains(t
xtNo.Text)
Then
Dim init_rows As Integer
init_rows = ProductData.Tables(0).Defa
ultView.Fi
nd(txtNo.T
ext)
grdac_chart.CurrentRowInde
x = init_rows
grdac_chart.Select(init_ro
ws)
End If
Start Free Trial