Click here to Skip to main content
15,897,718 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i have a ComboBox and data grid i binding the ComboBox and It is ok and data grid to the issue is i am try to change the Selected value of the Combobox when the selected item in data grid changed and this is the

C#
private void DGV_Medecines_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
{
   Cls_MedecationController Med=new Cls_MedecationController();
   DataTable dt = new DataTable();
   try
   {
      dt = ((DataRowView)this.DGV_Medecines.SelectedItem).DataView.ToTable();                
      this.cmx_Arab.Text = Med.Get_ArabName(dt.Rows[this.DGV_Medecines.SelectedIndex]["Name_latin"].ToString());
   }
   catch
   {
   }
}


this is the cod of CMX Binding
C#
DataTable dt = new DataTable();
            this.FacadeMed = new Cls_MedecationController();
            dt = this.FacadeMed.SellectAllMed();
            //this.cmx_Arab.ItemsSource = dt.DefaultView;
            this.Cmx_Latin.ItemsSource = dt.DefaultView;   
Posted
Updated 25-Apr-11 14:52pm
v3
Comments
Tarakeshwar Reddy 25-Apr-11 16:55pm    
Set pre tags and unchecked ignore HTML

1 solution

Try to set this.cmx_Arab.SelectedValue propery instead of this.cmx_Arab.Text
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900