Devexpress GridView 数据格式化显示
gridView1.CustomColumnDisplayText += gridView1_CustomColumnDisplayText;
void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
if (e.Column.FieldName == "State")
{
switch (e.DisplayText)
{
case "0":
e.DisplayText = "有效";
break;
case "1":
e.DisplayText = "无效";
break;
}
}
}