HOW TO READ VALUE FROM A CELL FROM A WPF DATAGRID?

ezra heywood

Total Post:145

Points:1019
Posted by  ezra heywood
WPF 
WPF
 1371  View(s)
Ratings:
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?
  1. shreesh chandra shukla

    Post:105

    Points:735
    Re: How to read value from a Cell from a WPF DataGrid?

    Solution!

    This might help someone else.

    foreach (DataRowView row in dgLista.SelectedItems)

    {

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

    }

    Good luck!

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!