CustomColumnDisplayText(显示值)可以结合CustomRowCellEditForEditing(实际值)使用
注意:GridView 的每一列原始数据是Value,但是显示数据是 DisplayText,默认DisplayText的值即是Value通过DisplayFormat转换之后的值。
//自定义显示文本
DataTable dtClassifyAll = GetClassify(string.Empty);//根据焦点行的 wtzbdm 列的值获取全部的数据源
gridView1.CustomColumnDisplayText += delegate(object sender, CustomColumnDisplayTextEventArgs e)
{
if (dtClassifyAll == null)
return;
if (e.Column.FieldName != "wtfldm")
return;
DataRow[] drsDisplay = dtClassifyAll.Select(string.Format("wtfldm = '{0}'",e.Value.ToStringEx()));
if (drsDisplay.Length < 1)
return;
e.DisplayText = drsDisplay[0]["wtflmc"].ToStringEx();
};