DropDownList Autoellipsis

6 posts, 1 answers
  1. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 02 Oct 2018 Link to this post

    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 :)

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2903 posts

    Posted 02 Oct 2018 Link to this post

    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.
  3. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 02 Oct 2018 Link to this post

    Nice, works like a charm :)

    Thanks.

  4. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 11 Oct 2018 Link to this post

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

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

    Thanks :)

     

  5. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3822 posts

    Posted 11 Oct 2018 Link to this post

    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.
  6. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 11 Oct 2018 Link to this post

    hum, bon, ok

    Thanks

Back to Top