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

Subheadings in RadListBox ?

1 Answer 120 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Darius
Top achievements
Rank 1
Darius asked on 19 Apr 2019, 06:29 PM

Hello,

How can you implement subheadings in RadListBox ?

For example:

HEADING 1

ListItem A

ListItem B

HEADING 2

ListItem C

ListItem D

 

Thank you.

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 24 Apr 2019, 09:54 AM
Hello Darius,

You can try adding custom items at given place, disable them and add some custom styles. Here is a very simple scenario implementing this:



<style>
    .group-header{
        background-coloraqua;
        font-styleitalic;
    }
</style>

<telerik:RadListBox runat="server" ID="RadListBox1">
    <Items>
        <telerik:RadListBoxItem Text="Group 1" Enabled="false" CssClass="group-header" />
        <telerik:RadListBoxItem Text="Item 1" />
        <telerik:RadListBoxItem Text="Item 2" />
        <telerik:RadListBoxItem Text="Item 3" />
        <telerik:RadListBoxItem Text="Group 2" Enabled="false" CssClass="group-header" />
        <telerik:RadListBoxItem Text="Item 4" />
        <telerik:RadListBoxItem Text="Item 5" />
    </Items>
</telerik:RadListBox>

Here is also a similar thread that shows how you can add the items programmatically: https://www.telerik.com/forums/separators-for-databound-items

Regards,
Peter Milchev
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
ListBox
Asked by
Darius
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or