Populate with class objects

4 posts, 1 answers
  1. Josh
    Josh avatar
    23 posts
    Member since:
    Feb 2011

    Posted 20 Mar 2011 Link to this post

    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!
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 20 Mar 2011 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Josh
    Josh avatar
    23 posts
    Member since:
    Feb 2011

    Posted 20 Mar 2011 Link to this post

    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!
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 21 Mar 2011 Link to this post

    No worries Josh. Glad I could make a suggestion that helped
    RIchard
Back to Top