This is a migrated thread and some comments may be shown as answers.

ComboBox Question

3 Answers 116 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dwayne Starkey
Top achievements
Rank 1
Dwayne Starkey asked on 11 Nov 2009, 11:56 PM
I am using v.2009 Q3 combobox and cannot seem to find a way to have (when typing into the combo box) filter through multiple fields while the combo box renders the items under items_requested.

For example I am having the user find inventory items and then select this item to edit and make changes. They need to be able to either type in the stock number or description to pull these items up. So I am displaying both the stock number and description within the combo box.

I set filtering to contains thinking it would look at both the stock number and description. My datatext  field is set to description so it is only searching / filtering through that one field.  Is there anyway to have the combo box filter or markfirstmatch through multiple fields?
 
I hope this make sense....


Thanks,

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 16 Nov 2009, 11:46 AM
Hi Dwayne,

Filtering mechanism searches only the text of the items. You can subscribe to OnItemDataBound event and set the text to description and stock number.

All the best,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dwayne Starkey
Top achievements
Rank 1
answered on 16 Nov 2009, 02:09 PM
Thanks Yana,
I tried using the examples you have on your website but cannot get it to work. I must be missing something. Would you have a working example I can reference?
0
Accepted
Simon
Telerik team
answered on 17 Nov 2009, 04:05 PM
Hi Dwayne Starkey,

You could append the Stock Number to the Text property of each Item in the ItemDataBound event handler as shown below:

protected void RadComboBox1_ItemDataBound(object o, RadComboBoxItemEventArgs e)
{
     DataRowView dataSourceRow = (DataRowView) e.Item.DataItem;
 
     e.Item.Text += dataSourceRow["StockNumber"].ToString();
}

Regards,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Dwayne Starkey
Top achievements
Rank 1
Answers by
Yana
Telerik team
Dwayne Starkey
Top achievements
Rank 1
Simon
Telerik team
Share this question
or