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

Two way binding between two RadComboBox

1 Answer 81 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 16 Aug 2013, 02:59 PM
What's the best way to realize a two way binding between two RadComboBox's?

I have a user control wit only a RadComboBox that get filled with company names and companyID's I have two fill() methods. Both sets the companyId as value and one with the company name as text and the other the companyID as text.
I use two user controls in a Edit-FormTemplate van the RadGrid. setting them in ItemCreate event - One shoving the company name and the other shoving the companyID,. They are both set to the same SelectedIndexChanged evnt.

In this SelectedIndexChanged I want to set the Selected value of both when the event is fired. But how do find the Usercontrols?

I tried various code snippert but I can'get it to work, so as this:
var temp = (sender as RadComboBox).NamingContainer.NamingContainer;
DealerComboBox combo = (DealerComboBox)temp.FindControl("DealerComboBoxCodeCode");

Please help

Anders Pedersen

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 21 Aug 2013, 10:15 AM
Hello Anders,

I would suggest you to initially find the UserControl and than use the FindControl again, to find the RadComboBox, nested in the UserControl. I have prepared a sample project for you, demonstrating the above suggested implementation. Please find it attached.

Note : dll files are removed from the attachment.

Regards,
Nencho
Telerik
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 the blog feed now.
Tags
ComboBox
Asked by
Anders
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or