Two way binding between two RadComboBox

2 posts, 0 answers
  1. Anders
    Anders avatar
    30 posts
    Member since:
    Jul 2013

    Posted 16 Aug 2013 Link to this post

    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

  2. Nencho
    Nencho avatar
    1812 posts

    Posted 21 Aug 2013 Link to this post

    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.

    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.
Back to Top