WPF Datagrid read a cell value

前端 未结 3 1736
花落未央
花落未央 2020-12-22 01:07

I am trying to find out how to read the value of my WPF datagrid cells.

something along the lines of

String myString = myDataGrid.Cells[1][2].ToStr         


        
3条回答
  •  情深已故
    2020-12-22 01:50

    This might help someone else.

    foreach (DataRowView row in dgLista.SelectedItems)
    {
        string text = row.Row.ItemArray[index].ToString();
    }
    

    Good luck!

提交回复
热议问题