form_load的时候把第一列隐藏掉了
DataGridView1.Columns(0).Visible = False点击datagridview行获取改行所有数据
 Private DataGridView1_CellClick....
{
string a=DataGridView1.CurrentRow.Cells(0).Value.ToString()//这里获取不到隐藏的数据了
string b=DataGridView2.CurrentRow.Cells(1).Value.ToString()string c=DataGridView3.CurrentRow.Cells(2).Value.ToString()}

解决方案 »

  1.   

      DataGridView1.Item.Cells[].Visible=false;
      

  2.   

    你逐步跟踪了吗?应该能获取到的,string a=DataGridView1.CurrentRow.Cells[0].Value.ToString()
      

  3.   

    DataGridView1.Item.Cells[].Visible=false;
    怎樣獲取隱藏列數據?
      

  4.   

    隐藏代码用这个,就可以读取隐藏列的数据了
     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType != DataControlRowType.Pager && e.Row.RowType != DataControlRowType.EmptyDataRow)
            {
                if (e.Row.Cells.Count > 0) e.Row.Cells[e.Row.Cells.Count - 1].Style.Add("display", "none"); 
            }
    }