TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Venkanna Toleti
NA
18
2.6k
How to retrieve data from datagrid combo box using wpf ?
Sep 11 2015 5:47 AM
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" ></DataGridComboBoxColumn>
//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
Reply
Answers (
1
)
Converter parameter value through binding
Can't Get The Button In WPF ?