0
我正在Gridview中使用TextBox使用templatefield。所有工作都很好。但我的問題是,每當文本框獲得焦點時,我需要該gridview的rowindex。
你能幫我嗎? 在此先感謝如何從asp.net中的焦點事件的Gridview文本框中獲取rowindex C#
我正在Gridview中使用TextBox使用templatefield。所有工作都很好。但我的問題是,每當文本框獲得焦點時,我需要該gridview的rowindex。
你能幫我嗎? 在此先感謝如何從asp.net中的焦點事件的Gridview文本框中獲取rowindex C#
也許這DataGridViewCell.RowIndex Property
private void getCurrentCellButton_Click(object sender, System.EventArgs e)
{
string msg = String.Format("Row: {0}, Column: {1}",
dataGridView1.CurrentCell.RowIndex,
dataGridView1.CurrentCell.ColumnIndex);
MessageBox.Show(msg, "Current Cell");
}