RadCombobox Value on Select vs Expand

3 posts, 0 answers
  1. crazy05
    crazy05 avatar
    72 posts
    Member since:
    Sep 2014

    Posted 31 Jul 2015 Link to this post

    Hello,

     I have combobox with values 0, 1, 2. When user expand the combobox to select the value, I want to show Text of the value as  0 - Bad, 1 - Average, 2 - Good.

     But when user select the value, I want to display the value only.

     How can I do this ?

  2. Nasko
    Admin
    Nasko avatar
    585 posts

    Posted 04 Aug 2015 Link to this post

    Hi Ram,

    In order to achieve the desired appearance of the Items first you need to bind the control's ItemSource to a collection of business objects. That object should contain information about what stands for each value - for example for 0 it stands "Bad". After that by creating an ItemTemplate you could create the desired appearance for the Items placed inside the DropDown portion of the control. On the other hand using the SelectionBoxTemplate you could achieve the desired appearance of the item into the selection box part of the control. For a more detailed information please, check the following articles from our help documentation:
    http://docs.telerik.com/devtools/wpf/controls/radcombobox/features/populating-with-data-selectionbox

    and about the ItemTemplate:
    http://docs.telerik.com/devtools/wpf/controls/radcombobox/populating-with-data/binding-to-object#using-custom-itemtemplate

    We have created a sample project that demonstrates the described above approach and you you could run and evaluate it.

    Hopes this helps.  

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. crazy05
    crazy05 avatar
    72 posts
    Member since:
    Sep 2014

    Posted 04 Aug 2015 in reply to Nasko Link to this post

    Nice! It worked. Thanks!
Back to Top