Hi ,
I am try to bind value from server side, for that , i page load i get values in datatable and bind in searchbox, and in DataSourceSelect i filter the values when key in inside search box, but when i key in i get error "Datasoruce not set ", how to bind datasource from server side instead of code behind ?
This is my code
Code Behind
<telerik:RadSearchBox EnableAutoComplete="true" DataValueField="userid"
DataTextField="con" ID="radsearachUsers" runat="server"></telerik:RadSearchBox>
--------------------------------
Page_Load
Dim sqlDA As New SqlDataAdapter("Select con,userid from users", objConnection)
Dim objDT As New DataTable
sqlDA.Fill(objDT)
radsearachUsers.DataSource = objDT
radsearachUsers.DataValueField = "userid"
radsearachUsers.DataTextField = "con"
radsearachUsers.DataBind()
__________________________________
Protected Sub radsearachUsers_DataSourceSelect(sender As Object, e As SearchBoxDataSourceSelectEventArgs) Handles radsearachUsers.DataSourceSelect
Dim objConnection As New SqlConnection
objConnection = New SqlConnection(getconnectionstring())
objConnection.Open()
Dim sqlDA As New SqlDataAdapter(" Select * from users where con like '%" & e.FilterString & "%' ", objConnection)
Dim objDT As New DataTable
sqlDA.Fill(objDT)
radsearachUsers.DataSource = objDT
radsearachUsers.DataSourceID = getconnectionstring()
radsearachUsers.DataTextField = objDT.Rows(0)("Con")
radsearachUsers.DataValueField = objDT.Rows(0)("userid")
radsearachUsers.DataBind()
End Sub
Pls reply asap
Thanks