c# datagridview 相关操作。
生活随笔
收集整理的這篇文章主要介紹了
c# datagridview 相关操作。
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
string[] newRow = {"long","d","b"};
Gridview.Rows.Insert(Gridview.Rows.Count, newRow);
?datagridview 設置某行某列的單元格可修改:
private void SetGridCellEdit(){if (repgrid != null && repgrid.Rows.Count > 0){string dyeno = string.Empty;for (int i = 0; i < repgrid.Rows.Count; i++){if (repgrid.Rows[i].Cells["Coldyeno"].Value != null){dyeno = repgrid.Rows[i].Cells["Coldyeno"].Value.ToString();if (dyeno.Equals("X022")|| dyeno.Equals("X009")|| dyeno.Equals("X008")|| dyeno.Equals("X001")) // {DataGridViewCell viewCell = repgrid.Rows[i].Cells["Coltarget"];repgrid.CurrentCell = viewCell;viewCell.ReadOnly = false;repgrid.BeginEdit(true);}else{DataGridViewCell viewCell = repgrid.Rows[i].Cells["Coltarget"];repgrid.CurrentCell = viewCell;viewCell.ReadOnly = true;}}}}}?
轉載于:https://www.cnblogs.com/longdb/p/7423089.html
總結
以上是生活随笔為你收集整理的c# datagridview 相关操作。的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C#远程调用技术WebService葵花
- 下一篇: JavaScript特点、优缺点及常用框