我尝试从网格中选择行并将其显示在文本框中以对行进行更新和删除。
我已经用 DataGrid 尝试过这段代码。它有效,但是当我在基础设施 webdatagrid 中使用它时,它给了我 null
protected void WebDataGrid1_SelectedIndexChanged(object sender, DataGridViewCellEventArgs e)
{
txtCode.Text = WebDataGrid1.Rows[e.RowIndex].Items[1].Value.ToString();
}
没有错误消息,但数据未显示在文本框中。