C# .NET - hi i m using c# using wpf - Asked By malatesh swadi on 01-May-12 04:05 AM

How to get datagridcombobox column selectedItem value in WPF?

example:
ProductID   Product_name
1      Moon  
2      Sun  
3      Earth


When I select sun I want to get selected Item Value 2

 using WPF datagridcolumn (wpf)
Venkat K replied to malatesh swadi on 01-May-12 08:06 AM

       DataGridRow row = this.dg.ItemContainerGenerator.ContainerFromIndex(this.dg.SelectedIndex) as DataGridRow;
        ComboBox ele = this.dg.Columns[0].GetCellContent(row) as ComboBox;
        Console.WriteLine(ele.Value);


malatesh swadi replied to Venkat K on 02-May-12 02:03 AM
  Thanks i am getting datagridcomboboxcolumn selectedindex but i wamt selected value plz reply its urgent