RadDropDownListBox with 2columns

7 posts, 1 answers
  1. BB
    BB avatar
    13 posts
    Member since:
    Mar 2007

    Posted 10 Mar 2011 Link to this post

    I need a RadDropDownListBox with 2 columns

    Thank you very much.

    Titel1 | Titel6

    Titel2 | Titel7

    Titel3 | Titel8

    Titel4 | Titel9

    Titel5 | Titel10

  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 10 Mar 2011 Link to this post

    Hello BB,

    A RadDropDownList with more than one column is actually a different control; a  MultiColumnComboBox. Please have a look at the help topic starting here for more information.

    If you need further help please let me know
    Thanks
    Richard
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Brian@WTG
    Brian@WTG avatar
    13 posts
    Member since:
    Mar 2011

    Posted 10 Mar 2011 Link to this post

    I used the data set bound to the object to simulate multiple columns. The DisplayMember and ValueMember are seperate properties so you can use a multiple column display in the dropdown and auto complete while only selecting 1 real value. I created a column in the data set to return a concatenated set of columns "1XXX  |  2XXX  | 3XXX , 4XX"  with (column1 + '  |  ' + column2 + '  |  ' + column3 + ', ' + column4 as controldisplay) and set controldisplay to the DisplayMember, then set the ValueMember to column1 so when they pick one only 1XXX is returned as a value.

    Speed hasn't been affected. :)
    I hope that helps.
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 10 Mar 2011 Link to this post

    Hi Brian,

    That's great, but the advantage of a MultiColumnComboBox is that you have all the functionality in the drop down of a RadGridView.
    Regards,
    Richard
  6. Brian@WTG
    Brian@WTG avatar
    13 posts
    Member since:
    Mar 2011

    Posted 10 Mar 2011 Link to this post

    That's true, my example is only displaying multiple columns but you can't beat the speed of the dropdownlist (at least not yet according to the last post in my question about the multiplecolumncombobox).

    You'd have to parse the selected value for the "|" char if you wanted to return multiple column values. Like 

    examplesearchcode = Me.dropdown.Text.Split("|").GetValue(0).ToString.Trim

    It would be a little different with multiple "|" characters, but that works for values with two columns and you want the first column. For the second column you would have to update getvalue(0) index to the position of the "|" char + 3 (for spaces). Something like

    Me.dropdown.Text.Split("|").GetValue(InStr(Me.dropdown.Text, "|") + 3).ToString.Trim

     

    I haven't updated my applications entirely with the new controls we got in the Telerik package yet, so I may change this once I use their gridview and the built in filter options.

    Thank you

  7. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 15 Mar 2011 Link to this post

    Hello Brian@WTG,

    Thank you for sharing your code with us.

    You are right that the RadDropDownList in general is faster than RadMultiColumnComboBox. And this is a normal situation of performance vs features trade off. Probably, you would like to try the RadMultiColumnComboBox of the upcoming release Q1 2011. Since we are constantly working to improve the performance of our controls, it is possible that you find the new version fast enough for your requirements. The new release will be available for download by the end of the current week.

    Regards,
    Martin Vasilev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  8. Brian@WTG
    Brian@WTG avatar
    13 posts
    Member since:
    Mar 2011

    Posted 15 Mar 2011 Link to this post

    Thank you Martin, that's great to hear and I am anxious to try the multicolumncombobox again, as it formats multiple columns much cleaner.
Back to Top
UI for WinForms is Visual Studio 2017 Ready