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

DropDownList Autoellipsis

5 Answers 69 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
OD
Top achievements
Rank 1
OD asked on 02 Oct 2018, 08:58 AM

Hi, 

is there a way to have AutoEllipsis on selecteded item ?

it works fine with items in list but not on selected.

Thanks for your help :)

5 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 02 Oct 2018, 10:56 AM
Hi Jean-Mark,

This is possible when the DropDownStyle is set to DropDownList:
radDropDownList1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
radDropDownList1.DropDownListElement.EditableElement.AutoEllipsis = true;

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
OD
Top achievements
Rank 1
answered on 02 Oct 2018, 11:55 AM

Nice, works like a charm :)

Thanks.

0
OD
Top achievements
Rank 1
answered on 11 Oct 2018, 12:50 PM

Hum complementary question : Is there a way to know if selecteditem is "Ellipsed" ?

A line like : radDrop.Text.EndsWith("…")

Thanks :)

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 11 Oct 2018, 01:46 PM
Hello, Jean-Mark, 

There is no automatic way to determine it. However, you can measure the text in order to calculate the desired size by using the TextRenderer.MeasureText method. It measures the specified text when drawn with the specified font. Additional information is available here: https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.textrenderer.measuretext?view=netframework-4.7.2

Then, you can check the size of the drop down and conclude whether you have enough space for the whole text.

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.
0
OD
Top achievements
Rank 1
answered on 11 Oct 2018, 02:10 PM

hum, bon, ok

Thanks

Tags
DropDownList
Asked by
OD
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
OD
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or