Click here to Skip to main content
15,885,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi actually i am a newbie to the wpf and here i am facing a problem . I unable to retrieve values or data from data grid using a combo box and when ever i am trying to retrieve im getting a error "Object set to an instance" here is my code please check and help is appreciated


//XAML code :

<datagridcomboboxcolumn header="packagetype2" textbinding="{Binding Uom}" x:name="cmb_pktype" xmlns:x="#unknown">


//c# code:


DataSet ds1 = uomc.fillcombo();

cmb_pktype.ItemsSource = ds1.Tables[0].DefaultView;
cmb_pktype.DisplayMemberPath = ds1.Tables[0].Columns["Name"].ToString();
cmb_pktype.SelectedValuePath = ds1.Tables[0].Columns["Id"].ToString();



//when i am retrieveing the data like as below


string type = (dgv_uomconversionmapping.SelectedCells[1].Column.GetCellContent(dgv_uomconversionmapping.Items[i]) as TextBlock).Text;


//This retrieving process is working for data grid textblock column
//as this way how can i read the datagrid combobox column
Posted
Comments
VR Karthikeyan 14-Sep-15 1:46am    
Where is your xaml code?

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