We've got a radgrid bound to a dataset and a search text box on our web page. When the user inputs a code to the text box, we want the radgrid to find the row within the dataset and scroll down to it in the grid.
This was possible to do in standard VB.NET but we're having issues using telerik.
So far we have this logic:
This was possible to do in standard VB.NET but we're having issues using telerik.
So far we have this logic:
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load |
cn = New SqlConnection(ConStr) |
ds = New DataSet |
dv = New DataView |
Dim ad As New SqlDataAdapter("select * from mytable", cn) |
ad.Fill(ds, "codeid") |
dv.Table = ds.Tables("codeid") |
RadGrid.DataSource = dv |
End Sub |
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click |
Dim lpos As Integer |
dv.Sort = "codeid" |
lpos = dv.Find(btnSearch.Text) |
'here we want to set current row to lpos |
RadGrid.Rebind() |
End Sub |
But when it comes to setting the data set's index we found the property was read only.
RadGrid2.SelectedItems.Item(0).DataSetIndex = 4
Property 'DataSetIndex' is 'ReadOnly'.
Is there another property we have to use instead to achieve the same effect of getting the grid to scroll down to the right place in the dataset position the user searched for?