关于dataGridView的两个简单问题。求教高手
问题 1.假如我dataGridView有
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
// string cno1=dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString();
string cno = dataGridView1.Rows[e.RowIndex].Cells["Cno"].Value.ToString();
con2.Setcno(cno);
}
但是我不点击的话就不触发这个函数。
我想默认 不点击时 cno 自动默认是第一行的Cno。请问何如实现??
问题 2.
加入我的表有一列属性值只有“true”."false".
如何用checkbox表示呢。true的话就勾上。false则不勾。嵌套在datatable里面。
string sql2 = "select * from Student where Steacher;";
DataTable tb2 = link.SelectDataBase(sql2);
dataGridView2.DataSource = tb2.DefaultView;
string cright[] = tb2.rows[n]["Cright"].tostring();
Cright那列如何返回到datatable用checkbox显示出来?
补充:.NET技术 , C#