如何简单得知datagridview当前单元格的行号与列号

解决方案 »

  1.   

    http://www.olcodes.com/article/html/5207.html
    看看
      

  2.   

    datagrid1.CurrentRow.Index;
    datagrid1.CurrentColumn.Index;
      

  3.   

    HTML:
    <asp:BoundField HeaderText="序号" DataField=""  ItemStyle-CssClass="xuxian" HeaderStyle-CssClass="STYLE5"/>CS:
    RowDataBound:
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    e.Row.Cells[0].Text = (e.Row.DataItemIndex + 1).ToString();            }