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

Change the Seleted Item of a Combobox in a Child window from a Parent Window

2 Answers 26 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Vuyiswa
Top achievements
Rank 2
Vuyiswa asked on 28 Mar 2011, 07:47 PM
Good Evening

I have a Datagrid and i selectedChange event of the Datagrid, i show a child wind and i bind the textbox controls of the child window from the Parent Window which has a datagrid. Now my problem is that there is a Combobox on the Child window, onbviously this combobox is binded after the child window has opened. The data is not Static , its coming from the DB. What i want is to set the selected item from the parent. This is what i am doing



     
private void grdkids_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)
      {
          //kid
              KidsViewUpdateDetails KidsDetails = new KidsViewUpdateDetails();
 
 
              KidsModelExtended model = (KidsModelExtended)this.grdkids.SelectedItem;
               
              KidsDetails.txtstudentnumber.Text = model.sStudentNumber;
           
              KidsDetails.txtkidname.Text = model.sKidName;
              KidsDetails.txtkidlastname.Text = model.sKidLastname;
              KidsDetails.txtgrade.Text = model.sKidGrade;
              KidsDetails.txtclass.Text = model.skidclass;
              KidsDetails.ddlallergies.Text = model.sAllergyName;
              KidsDetails.ddlschool.Text = model.sSchoolName;
              GenericMethods.GenericMethods.SetCookie("kidId", model.iKidid.ToString());
              KidsDetails.Show();
         
      }


in this lines


 
KidsDetails.ddlallergies.Text = model.sAllergyName;
  KidsDetails.ddlschool.Text = model.sSchoolName;


i am trying set the selected item to be that. but when the Child load , there Combobox remain unselected

This is the declaration of the Combobox

<telerik:RadComboBox HorizontalAlignment="Left"  DisplayMemberPath="sAllergyName" SelectedValuePath="{Binding iAllergyID}" Margin="106,226,0,0" Name="ddlallergies" VerticalAlignment="Top" Width="142" Height="22">



Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
George
Telerik team
answered on 31 Mar 2011, 07:56 PM
Hi Vuyiswa, 


The SelectedValuePath property represents a string that specifies the path to the property that is used to determine the value of the SelectedValue property. Instead of using the SelectedValuePath, I would suggest you to bind the SelectedItem property. For more information about the RadComboBox selection, please refer to the following link: http://www.telerik.com/help/silverlight/radcombobox-features-selection.html

I hope this helps.

All the best,
George
the Telerik team
0
Vuyiswa
Top achievements
Rank 2
answered on 31 Mar 2011, 08:49 PM

thank you Gorge , i have resolved it a long time ago. i am sorry i did no update the post. Thank you for your help on the reporting part. all my issues are resolved.

Thanks
Tags
ComboBox
Asked by
Vuyiswa
Top achievements
Rank 2
Answers by
George
Telerik team
Vuyiswa
Top achievements
Rank 2
Share this question
or