首页 > Windows开发 > 详细

Winfrom 表格单元格格式化事件(DataGridView - CellFormatting)

时间:2016-07-20 10:17:46      阅读:389      评论:0      收藏:0      [点我收藏+]

格式化 14,15列将编码显示为编码值

 1 this.dgv_prescription.CellFormatting +=
 2     (object sen, DataGridViewCellFormattingEventArgs ev) =>
 3     {
 4         DataGridView dgv = (DataGridView)sen;
 5         if (ev.RowIndex < dgv.Rows.Count - 1)
 6         {
 7             if (ev.ColumnIndex == 14 || ev.ColumnIndex == 15)
 8             {
 9                 ev.Value = ev.Value.ToString() == "1" ? "" : "";
10             }
11         }
12     };

 

Winfrom 表格单元格格式化事件(DataGridView - CellFormatting)

原文:http://www.cnblogs.com/cbread/p/5687175.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!