0

嘿嘿。我有问题。when i want to clear my data grid I am having such a problem.when datagrid item is selected i want click to button and clear data grid.but happened this error.

指定的参数超出了有效值的范围。参数名称:索引

object item =dg_autoqeydiyyat.SelectedItem;
string ID = (dg_autoqeydiyyat.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text;
string NAME = (dg_autoqeydiyyat.SelectedCells[2].Column.GetCellContent(item) as TextBlock).Text;
txb_auto2qeydno.Text = ID;
txb_auto2nomresi.Text = NAME;
4

0 回答 0