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

Programmatically adding an item to a databound, templated ComboBox

1 Answer 38 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Paul Hopper
Top achievements
Rank 1
Paul Hopper asked on 10 Sep 2008, 07:55 PM
I have a ComboBox with a template defined at design-time.  The control is bound to a SqlDataSource, also defined at design-time.  What I want to do is insert an item after the control is bound to the datasource (so, in the OnDataBound event).

I can insert a new item, but this new item doesn't contain any of the additional fields/values that the databound items have.  I thought I could add the fields as attributes, but that didn't work.  I'm sure this must be possible, but cannot figure it out or find the solution... what's the trick?

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 15 Sep 2008, 08:46 AM
Hello Paul,

I suggest you use DataItem property of RadComboBox items and assign to it an object with the needed properties. I've attached a small demo project which shows this approach. Please download it and give it a try.

Kind regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Paul Hopper
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or