filtered items height in raddropdownlist

5 posts, 0 answers
  1. AhNa
    AhNa avatar
    2 posts
    Member since:
    May 2011

    Posted 19 May 2011 Link to this post

    Hi, In the ItemDataBound event i use the following code to change the height of the items:
    args.NewItem.Height = 35

    But with filtered items the height gets reset.
    I've searched over the internet for an event or property
    but couldn't find how to keep the height unchanged.
    Please help.
    Thank you.
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 20 May 2011 Link to this post

    Hello AhNa,

    May i suggest using html formatting for this? Please take a look in the Demos application under, DropDown & List => Item Formatting.
    You can either use the link from the online docs system or the demos app to achieve the desired functionality.

    And for the future if you may require some other kind of formatting you could subscribe to the VisualListItemFormatting event and handle that based on your needs, as described here.

    If you have any more questions please just let me know, and if the question has been solved, please mark the all of the helpfull posts as answers, so that others can find the answers to their questions faster.

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP
  3. UI for WinForms is Visual Studio 2017 Ready
  4. AhNa
    AhNa avatar
    2 posts
    Member since:
    May 2011

    Posted 21 May 2011 Link to this post

    Thank you replying, I used the ViusalItemFormatting event on the filtered items and used the <size> tag
    that increased the font size which is a thing I need but the texts are interleaving with each other.
    How can I increase the spacing between filtered items? it seems there are no tags to achieve this.
  5. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 21 May 2011 Link to this post

    Hello again,

    At point 2 of this help article, you can find your answer to this:
    Basically just set:
    [C#] Setting AutoSizeItems
    this.radListControl1.AutoSizeItems = true;
     
    [VB.NET] Setting AutoSizeItems
    Me.radListControl1.AutoSizeItems = True

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP
  6. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 25 May 2011 Link to this post

    Hi AhNa,

    Richard, thank you for this solution. There is alternative - you can set the ItemHeight property for RadDropDownListElement:

    this.radDropDownList2.DropDownListElement.ItemHeight = 35;

    The following help article contains details on how to customize the DropDownItem with the help of VisualListItemFormatting event.

    All the best,
    Peter
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Back to Top
UI for WinForms is Visual Studio 2017 Ready