How to loop over the rows of a WPF toolkit Datagrid

前端 未结 4 1059
情歌与酒
情歌与酒 2020-11-30 15:04

I have the next code where I defined a WPF toolkit datagrid control called dgQuery; I filled this one with information of a dataset, then I inserted a new checkbox column in

4条回答
  •  一向
    一向 (楼主)
    2020-11-30 16:07

     var row = GetDataGridRows(dataGrid1);
     /// go through each row in the datagrid
                foreach (Microsoft.Windows.Controls.DataGridRow r in row)
                {
                    DataRowView rv = (DataRowView)r.Item;
    
                    // Get the state of what's in column 1 of the current row (in my case a string)
                    string t = rv.Row[1].ToString();
    
    
                }
    

提交回复
热议问题