DropDownListItem with image and text

3 posts, 0 answers
  1. Artem
    Artem avatar
    16 posts
    Member since:
    May 2013

    Posted 19 Feb 2012 Link to this post

    Hello dear Telerik team.
    I am using RadDropDownList to let the user choose from four options. Those options are absolutely static, so I create four dropDownItems hardcoded. Each option has its text and image. I can define each item by a lode like :

    var radListDataItem1 = new RadListDataItem();
                radListDataItem1.Image = Properties.Resources.SomeImage;
                radListDataItem1.Text = "Sometext";           
                radListDataItem1.Value = someValue;

                var source = new BindingList<RadListDataItem>();


                cmbTriggerType.DataSource = source; //cmbTriggerType is my RadDropDownList

    //same for three more items

                cmbTriggerType.SelectedIndex = 0;

    And now here comes the question! :)
    What should I do to cause your control to render each DataItem  with both text and image visible?
    Thanks in advance.
  2. Peter
    Peter avatar
    1148 posts

    Posted 21 Feb 2012 Link to this post

    Hi Artem,

    Thank you for writing.

    This is not the correct way to data-bind the RadDropDownList/RadListControl.
    Please take a look at this documentation article about the data-binding.

    I would like to suggest to reading this help article about item customizations (adding an image).

    I hope this helps.

    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Artem
    Artem avatar
    16 posts
    Member since:
    May 2013

    Posted 21 Feb 2012 Link to this post

    Thanks, Peter!
    This helped indeed.
Back to Top