When i search in the combobox: "Wo" for a word "Winterthur"
the search doesn't work !! why ?
For other searches it works perfect !!
4 Answers, 1 is accepted
Maybe you have not set the WHERE clause in the SELECT statement in the ItemsRequested event handler of the second combobox. Can you paste here the code for that handler?
Sincerely yours,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I don't think that the problem is the "where", because for other search words it works perfect, but only for the search text: "Winterthur". You can test online !
protected
void ddlSport_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
{
DataTable data = DBManager.getInstance().getSportNames(e.Text);
try
{
int itemsPerRequest = 15;
int itemOffset = e.NumberOfItems;
int endOffset = itemOffset + itemsPerRequest;
if (endOffset > data.Rows.Count)
{
endOffset = data.Rows.Count;
}
if (endOffset == data.Rows.Count)
{
e.EndOfItems =
true;
}
else
{
e.EndOfItems =
false;
}
for (int i = itemOffset; i < endOffset; i++)
{
ddlSport.Items.Add(
new RadComboBoxItem(data.Rows[i]["Name"].ToString(), data.Rows[i]["SportsID"].ToString() ));
}
if (data.Rows.Count > 0)
{
e.Message =
String.Format("Sportarten <b>1</b>-<b>{0}</b> von <b>{1}</b>", endOffset.ToString(), data.Rows.Count.ToString());
}
else
{
e.Message =
"No matches";
}
}
catch
{
e.Message =
"No matches";
}
}
public
DataTable getSportNames(string sportName)
{
SqlDataAdapter da = null;
DataTable data = null;
string query = "SELECT * FROM Sports WHERE Name LIKE '%" + sportName + "%'" + " " +
"ORDER BY Name ASC";
try
{
da =
new SqlDataAdapter(query, ConfigurationManager.ConnectionStrings["ConnectionStringName"].ConnectionString);
data =
new DataTable();
da.Fill(data);
}
catch (Exception ex)
{
}
finally
{
}
return data;
}
Have you managed to fix the problem?
It seems working for me. Here is a screenshot.
Greetings,
Veskoni
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I have fixed the "where" problem ;-)
thanks.