First off, I'm ecstatic that this has been developed... a step in the right direction! However, I have one tiny suggestion and it's purely from a UI perspective.
I think if the calculated drop down width is less than the
RadComboBox width, it should "default" to the RadComboBox width. If you view my attachment (the too short one), you'll see what happens.
I love that this is done on the client side and would really love to know if there's a work around. Otherwise, I think I'm going to use my "in house" method which is done via server side (and isn't as efficient). This isn't code completely written by me, but I'll post what I currently have in case there are any suggested workarounds or if others are interested.
I have a general utility that calculates the width of text:
And then I have an extension method:
So, in my code behind I just have something like:
rcbSalesReps.DropDownWidth = rcbSalesReps.AutoDropDownWidth();
Just something to consider. To me, if I look at the attachments, I think the "just right" version looks much better than the "too short" one.
I'm open to any ideas or suggestions!
Thanks,
Andrew