Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Window c# 桌面应用程序
我想DataRow object用选定的行来初始化 a DataGrdView。
DataRow object
DataGrdView
如果可以,那有可能吗?
我正在编写以下代码,它给出了编译错误。
DataRow dr = (DataRow)DataGridView1.SelectedRows[0];
谢谢
试试这个:
DataRow dr = (DataGridView1.SelectedRows[0].DataBoundItem as DataRowView).Row;
试试这个
DataRow dr = (dataGridView1.SelectedRows[0].DataBoundItem as DataRowView).Row;