标签:nta 技术分享 stat style val inf mat src object
#region 设置单元格内容的显示格式 private void dataGridView_main_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { #region 会诊方式判断 int requestType_column_index = 9; if (e.ColumnIndex == requestType_column_index) { string sval = (e.Value ?? "").ToString(); switch (sval) { case "1": e.Value = "视频"; break; case "2": e.Value = "电话"; break; } } #endregion #region 会诊状态判断 int status_column_index = 11; if (e.ColumnIndex == status_column_index) { string sval = (e.Value ?? "").ToString(); if (sval == "0") { e.Value = "已申请"; } else if (sval == "1") { e.Value = "已审批"; } else if (sval == "2") { e.Value = "已分诊"; } else if (sval == "3") { e.Value = "已报告"; } else if (sval == "4") { e.Value = "已完成"; } else if (sval == "5") { e.Value = "已删除"; } #endregion } } #endregion
dataGridView设置单元格内容的显示格式CellFormatting
标签:nta 技术分享 stat style val inf mat src object
原文地址:https://www.cnblogs.com/wmm-pcy/p/9752901.html