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

Few Questions

5 Answers 48 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Christopher Blickley
Top achievements
Rank 2
Christopher Blickley asked on 22 Feb 2013, 11:19 PM
1. It seems like this control is a much better replacement for the Asp.Net DropDownList than RadComboBox for lightweight use.  I was wondering if there will ever be methods on the items collection like FindByValue and FindByText like the standard asp.net control has?  I can easily find items using Linq on the Items collection, but thought it would be a built-in method.  RadComboBox has these methods, and although RadDropDown is lighter, these seem essential.

2.  Will there every be functionality that provides for auto-width on the drop down?  Since the asp.net listbox does this by default and the RadComboBox has this, it might be a nice addition.

I realize this is supposed to be a very lightweight control, but it seems to me these are pretty basic things...

Thanks,
Chris

 

5 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 25 Feb 2013, 07:52 AM
Hello Christopher,

Thank you for the feedback.

We will include the "findItemByText/Value" client methods by next weeks internal build, which means that they will also be available in the upcoming ServicePack. 

We also plan to implement the AutoWidth functionality for the next release, however it may not be ready in time for the ServicePack.

I've also updated your telerik points for the feedback.
 

Kind regards,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Bill O'Neil
Top achievements
Rank 1
answered on 27 Feb 2013, 08:36 PM
How about server side?  Am I missing something or is the expected DropDownList method of FindByValue missing from the server side?

Example:

DropDownListControl.Items.FindByValue("value")

Does that exist?  How is one expected to find a desired item?

(Although it seems that setting the SelectedValue is well behaved - and doesn't care if the value exists or not.)

Bill
0
Christopher Blickley
Top achievements
Rank 2
answered on 27 Feb 2013, 08:43 PM
Good point, server side was actually what I was looking for. 

I also noticed something else on the client side.  When I add items to the control, if I don't specifically supply the "Value" of the item, the value is blank on the client side when getting the selected item.

I may be wrong, but I also thought that in a regular DropDownList, if you don't supply the Value property of the item, the value is "assumed" from the text property. 

So in this case below, I only specified the text property.  On the client, Value of the selected item will be blank, so I have to first check the value and if it is not there, grab the text property.

That may have been intentional in the API, but it caught me off guard.
<telerik:RadDropDownList runat="server" ID="lstEmplType" Skin="Windows7">
<Items>
    <telerik:DropDownListItem Text="2010"  Selected="true" />
    <telerik:DropDownListItem Text="2011"  />
    <telerik:DropDownListItem Text="2012"  />
    <telerik:DropDownListItem Text="2013"  />
</Items>
</telerik:RadDropDownList>
0
Bozhidar
Telerik team
answered on 28 Feb 2013, 09:13 AM
Hi Christopher,

Please excuse me for the misunderstanding. The DropDownList already has the client versions of these methods, and what I meant was that we will include the server side equivalents. In fact they are already included in our latest internal build.

As for the Value property, this is a design decision that we took when creating the control.
 

All the best,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Christopher Blickley
Top achievements
Rank 2
answered on 28 Feb 2013, 02:48 PM
Thanks.  No misunderstanding, the server methods (which I know have in the internal build) is exactly what we needed.  I was clarifying because I think the other user's comment may have thought I was referring to the client side.

The latest build looks great, thanks!
Tags
DropDownList
Asked by
Christopher Blickley
Top achievements
Rank 2
Answers by
Bozhidar
Telerik team
Bill O'Neil
Top achievements
Rank 1
Christopher Blickley
Top achievements
Rank 2
Share this question
or