| Protected Sub cmbNames_ItemsRequested(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbNames.ItemsRequested |
| Dim conn As New SqlConnection("connstringhere") |
| Dim strSQL As String = "SELECT * FROM Members WHERE fName LIKE '%" & Me.cmbNames.Text & "%'" |
| Dim cmd As New sqlCommand(strSQL, conn) |
| conn.Open() |
| Dim table As New Data.DataTable |
| table.Load(cmd.ExecuteReader(data.CommandBehavior.CloseConnection) |
| Me.cmbNames.DataSource = table |
| Me.cmbNames.DataTextField = "fName" |
| Me.cmbNames.DataValueField = "ID" |
| Me.cmbNames.DataBind() |
| End Sub |
| <telerik:RadComboBox ID="cmbNames" runat="server" Skin="Telerik" Width="300px" |
| AllowCustomText="True" |
| AutoPostBack="True" |
| EnableLoadOnDemand="true" MarkFirstMatch="true"> |
| </telerik:RadComboBox> |
I have the following problem; No matter what i enter it loads all the records from the Table Members. The query is correct as i tested it directly against the SQL Server DB and it works just as expected.
I need it to shows up only the items (records) that match the entry e.g. if i enter Jo i expect to see only the names like John, Jonathan etc.
I guess i am missing some important attribute of the RadComboBox