3 Answers, 1 is accepted
0
Hello John,
Please check this and this.
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.
Please check this and this.
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
John
Top achievements
Rank 1
answered on 18 Sep 2009, 01:33 PM
Thanks - I got that working but had to change it to:
As I was using a datatable.
Thing is, now when I hover over the options, it doesn't highlight them (as they are lables I suppose) but also, when I select one, the value in the box changes to:
System.Data.DataRowView
Rather than the value I selected.
Any idea why?
All I really wanted to do was display two values from my datatable as the text in the dropdown - so, I have 2 columns - Town and StateName and I want the display to show something like 'Abbyville - Kansas'
Am I using the correct approach? And, if I am, how do I solve the System.Data.DataRowView issue?
Thanks
string itemText = (string)DataBinder.Eval(item.DataItem, "Town")+ " - " + (string)DataBinder.Eval(item.DataItem, "StateName");
As I was using a datatable.
Thing is, now when I hover over the options, it doesn't highlight them (as they are lables I suppose) but also, when I select one, the value in the box changes to:
System.Data.DataRowView
Rather than the value I selected.
Any idea why?
All I really wanted to do was display two values from my datatable as the text in the dropdown - so, I have 2 columns - Town and StateName and I want the display to show something like 'Abbyville - Kansas'
Am I using the correct approach? And, if I am, how do I solve the System.Data.DataRowView issue?
Thanks
0
Hello John,
Please set HighlightTemplatedItems property to true and the items will be highlighted.
Regarding the second issue, you should set Text property of the items, because Text is shown in the input field of the combobox when they are selected. You can set it in OnItemDataBound event handler.
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.
Please set HighlightTemplatedItems property to true and the items will be highlighted.
Regarding the second issue, you should set Text property of the items, because Text is shown in the input field of the combobox when they are selected. You can set it in OnItemDataBound event handler.
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.