Subheadings in RadListBox ?

2 posts, 0 answers
  1. Darius
    Darius avatar
    15 posts
    Member since:
    Nov 2017

    Posted 19 Apr Link to this post

    Hello,

    How can you implement subheadings in RadListBox ?

    For example:

    HEADING 1

    ListItem A

    ListItem B

    HEADING 2

    ListItem C

    ListItem D

     

    Thank you.

  2. Peter Milchev
    Admin
    Peter Milchev avatar
    589 posts

    Posted 24 Apr Link to this post

    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.
Back to Top