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

Separator in RadDropDownList

1 Answer 249 Views
ListControl
This is a migrated thread and some comments may be shown as answers.
Pixie
Top achievements
Rank 1
Pixie asked on 25 Aug 2019, 09:08 PM
Hi. I want to add a separator (horizontal line) item to my radDropDownList. I've followed the approach at https://www.telerik.com/forums/adding-some-separator-in-the-list which works. However I have 2 items that have empty string as the text and I only want one of them to be shown as a horizontal line. I'm using a data bound list and I'd like to use either the item's value or it's tag to determine whether to show the item as a horizontal line or not. How do I get the item's value or it's tag from the VisualListItemFormatting event?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Aug 2019, 12:18 PM

Hello, Pixie,  

In the VisualListItemFormatting event you have access to the associated data item with the visual element. Please refer to the following code snippet demonstrating how to access it:

        private void radDropDownList1_VisualListItemFormatting(object sender, VisualItemFormattingEventArgs args)
        {
            RadListDataItem dataItem = args.VisualItem.Data;
            if (dataItem.Tag!=null)
            {

            }
        }

I suppose that the following help article may be interesting for your scenario as it demonstrates how to construct custom visual items in RadDropDownList: https://docs.telerik.com/devtools/winforms/controls/dropdown-listcontrol-and-checkeddropdownlist/dropdownlist/custom-items

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ListControl
Asked by
Pixie
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or