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

RadDropDownList / RadListControl

3 Answers 313 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
kim
Top achievements
Rank 1
kim asked on 24 Jun 2010, 07:53 AM
I want to add items to the RadListDataCollection.  But the RadListDataItem object has no setter for the Value. Before this was possible in the RadComboBoxItem. Is there any way around this?




3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 29 Jun 2010, 01:57 PM
Hello kim,

Thank you for writing.

The old combobox's design wrongfully exposed a setter for the Value property of its items. Value is applicable only in a databound scenario and it is not mutable, because combo boxes and list boxes in general are presentation objects, which provide a selection and a current item. They do not and should not modify the underlying data.

This is why the new RadListControl and RadDropDown list do not allow this. If you need to store custom information in unbound mode you can inherit from RadListDataItem and add whatever property you require.

Please write again if you have other questions.

Greetings,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Imran
Top achievements
Rank 1
answered on 01 Jul 2010, 04:19 AM
Is it possible to add Name, value pairs..  to the raddropdown list...

such as if the visible text is "Sale" then the underlying value should be "S"
and if the visible text in the drop downlist is "Purchase" then the underlying value should be "P".
I just want to add two items to the drop down list at design time...

thanks

IK
0
Victor
Telerik team
answered on 05 Jul 2010, 04:54 PM
Hi Imran,

Thank you for writing.

This is a very specific requirement, which we do not support out of the box, but you can easily implement it by inheriting from RadListDataItem and overriding the Value property to return the first character of the Text property value. The Value property can not be overridden in the Beta release but will be modified in the Q2 release.

Please write again if you have other questions.
 
All the best,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DropDownList
Asked by
kim
Top achievements
Rank 1
Answers by
Victor
Telerik team
Imran
Top achievements
Rank 1
Share this question
or