Home > DeveloperSection > Forums > How to read value from a Cell from a WPF DataGrid?
ezra heywood
ezra heywood

Total Post:145

Points:1019
Posted on    July-19-2013 11:33 PM

 WPF WPF 
Ratings:


 1 Reply(s)
 1056  View(s)
Rate this:

How to read a cell value form a WPF DataGrid?

I search online and try any possible combination and nothing works:

Datagrid.Cells[..], DataGrid.Items.Cells[..], DataGrid.Rows.., DataGrid.Items.Row.. nothing works, I can't find it is MSDN or I don't understand it. I just need to read a value off a cell in DataGrid that simple.

How to do it?


shreesh chandra shukla
shreesh chandra shukla

Total Post:105

Points:735
Posted on    July-19-2013 11:58 PM

Solution!

This might help someone else.

foreach (DataRowView row in dgLista.SelectedItems)

{

    string text = row.Row.ItemArray[index].ToString();

}

Good luck!


Don't want to miss updates? Please click the below button!

Follow MindStick