| 发表于:2007-03-12 12:46:277楼 得分:90 |
可以给datagridview添加cellformatting事件, 以格式化显示它的单元格的内容,比如: private void datagridview1_cellformatting(object sender, datagridviewcellformattingeventargs e) { if (this.datagridview1.columns[e.columnindex].headertext == "state ") { if (object.equals(e.value, 1)) { e.value = "状态1 "; } else if (object.equals(e.value, 2)) { e.value = "状态2 "; } } } | | |
|