Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,
How can i read data from datagrid in wpf using c# rowwise ,as we read in windows application like =>
C#
dataGridview1.Rows[i].Cells[1].Value.ToString()
Posted
Updated 6-Apr-12 7:31am
v2

You generally don't read data like this in WPF. The ideal way is to read data through the collection that has been bound to the datagrid. WPF DataGrid Practical Examples[^] should give you an idea.

However, something like the VisualTreeHelper class can help you access the rows and columns of a datagrid (as here[^]). This is not recommended though.
 
Share this answer
 
WPF Datagrid read a cell value
Reading a cell value in a WPF DataGrid?

But the most standard way is starting to learn MVVM
WPF/MVVM Quick Start Tutorial (Good Article)
 
Share this answer
 

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