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

Populate with class objects

3 Answers 91 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 20 Mar 2011, 07:43 AM
Hello,

I'm converting over to telerik controls from straight ms objects and I'm running into a problem with drop down lists. I have a simple class that I created for date selection and I currently use this in my project with combo boxes. With a regular combo box I am able to add the objects right into the combo box, however I don't see that with the rad drop down list and I'm unsure the best way to get the same functionality.

If it helps, the object has a text value and then 2 dates. It's used for a 'quick date' selection, so the drop down has items like "Today", "This Week", "This Month" etc. and when the user selects the item they want I can use the object to get the 2 dates that are attached to the object and filter my data.

Thanks for any help you can provide!

3 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 20 Mar 2011, 11:01 PM
Hello,

The RadDropDownList enables you to add RadListDataItems to it, or you can bind a custom list of objects giving a DataSource, DisplayMember and ValueMember which may be appropriate here. You might also be interested in using a RadMultiColumnComboBox which allows for multiple columns to be displayed and can be thought of as a RadGridView, in a RadDropDownList. Please have a look at the help topic here for more information.

If none of this is quite what you meant, then please let me know some more details and I'l do my best to help
Regards,
Richard
0
Josh
Top achievements
Rank 1
answered on 21 Mar 2011, 01:57 AM
Thanks buddy, once again you're the man!

What I did is create a generic list (of ClassObject) like you suggested, bound as the datasource, set the displaymember and walla, it's working!
0
Richard Slade
Top achievements
Rank 2
answered on 21 Mar 2011, 09:59 AM
No worries Josh. Glad I could make a suggestion that helped
RIchard
Tags
DropDownList
Asked by
Josh
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Josh
Top achievements
Rank 1
Share this question
or