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

filtered items height in raddropdownlist

4 Answers 93 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
AhNa
Top achievements
Rank 1
AhNa asked on 19 May 2011, 02:07 PM
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.

4 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 20 May 2011, 10:35 AM
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
0
AhNa
Top achievements
Rank 1
answered on 21 May 2011, 11:23 AM
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.
0
Emanuel Varga
Top achievements
Rank 1
answered on 21 May 2011, 11:26 AM
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
0
Peter
Telerik team
answered on 25 May 2011, 06:49 AM
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.
Tags
DropDownList
Asked by
AhNa
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
AhNa
Top achievements
Rank 1
Peter
Telerik team
Share this question
or