2012年8月17日

摘要: C#WinFormdataGridView技巧小结1.不显示第一个空白列RowHeaderVisible属性设置为false2.点击cell选取整行SelectinModel属性FullRowSelectRowSelectinModel属性设置或用CellClick事件也可以//整行选取privatevoiddataGridView1_CellClick(objectsender,DataGridViewCellEventArgse){//e.RowIndex>-1否则点击header也是叫一列if(dataGridView1.Rows.Count>0&&e.Row 阅读全文
posted @ 2012-08-17 16:02 the Jade Emperor 阅读(526) 评论(0) 推荐(0) 编辑
摘要: C#中DataGridView控件60招1. DataGridView当前的单元格属性取得、变更2. DataGridView编辑属性3. DataGridView最下面一列新追加行非表示4. DataGridView判断当前选中行是否为新追加的行5. DataGridView删除行可否设定6. DataGridView行列不表示和删除7. DataGridView行列宽度高度设置为不能编辑8. DataGridView行高列幅自动调整9. DataGridView指定行列冻结10. DataGridView列顺序变更可否设定11. DataGridView行复数选择12. DataGridV 阅读全文
posted @ 2012-08-17 11:42 the Jade Emperor 阅读(2328) 评论(0) 推荐(0) 编辑
摘要: c# winform 用代码修改DataGridView列头的名字,设置列名,修改列名WinFormCC++C#dataGridView1.Columns[0].HeaderCell.Value = "编号";dataGridView1.Columns[1].HeaderCell.Value = "名称";Columns数组从0开始,0代表第一列 阅读全文
posted @ 2012-08-17 11:40 the Jade Emperor 阅读(4374) 评论(0) 推荐(0) 编辑
摘要: System.Data.DataTable dt = new System.Data.DataTable();dt.Clear();foreach (DataGridViewColumn headerCell in dataGridView1.Columns){dt.Columns.Add(headerCell.HeaderText);}foreach (DataGridViewRow item in dataGridView1.Rows){DataRow dr = dt.NewRow();for (int i = 0; i < dt.Columns.Count; i++){dr[i] 阅读全文
posted @ 2012-08-17 11:39 the Jade Emperor 阅读(504) 评论(0) 推荐(0) 编辑

导航