RadComboBox Select An Item By ID

2 posts, 0 answers
  1. Chandu
    Chandu avatar
    23 posts
    Member since:
    Jul 2012

    Posted 15 Oct 2012 Link to this post

    Hello All,

    I have working on silverlight4 application,i have started working on RadControls for silverlight.
    I have spent a long time solving a issue on RadCombobox regarding selecting the item by its ID.
    Here am following the below way to select an item in radcombobox

                    for (int i = 0; i < rcbMaintence.Items.Count; i++)
                    {
                        if (((MaintenanceCode)rcbMaintence.Items[i]).MaintenanceCodeID == e.Result[0].MaintenanceCodeID)
                        {
                            rcbMaintence.SelectedIndex = i;
                            break;
                        }
                    }

    Here am getting the data from WCF Service,am getting MaintenanceCodeID by using this ID i need to select MaintenanceCode in combobox.It is working fine,but what my problem is

    I have 10's of ComboBoxes on a single page,for all those i need to iterate FOR loops,it is taking so much time
    instead of this many for loops i need a simple and fast way to select an item.

    Please help me.
  2. Chandu
    Chandu avatar
    23 posts
    Member since:
    Jul 2012

    Posted 22 Oct 2012 Link to this post

    Hello All,

    In .NET we can do something like this to select an item by its ID

    if(radComboBox.Items.FindByValue(e.Result[0].MaintenanceCodeID)!=null)
    {
          radComboBox.Items.FindByValue(e.Result[0].MaintenanceCodeID).Selected=true;
    }

    Do we have any option in Silverlight for this

    please suggest me.
  3. DevCraft banner
Back to Top