GridControl 绑定显示列
/// <summary>/// 绑定显示列
/// </summary>
private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
if (e.Column.FieldName == "Sex")
{
switch (e.Value.ToString().Trim())
{
default:
case "1":
e.DisplayText = "男";
break;
case "0":
e.DisplayText = "女";
break;
}
}
if (e.Column.FieldName == "Enabled")
{
switch (e.Value.ToString().Trim())
{
default:
case "1":
e.DisplayText = "在用";
break;
case "0":
e.DisplayText = "已停用";
break;
}
}
}
页:
[1]