DEV gridControl 怎么样自动更改列数据
1个回答
展开全部
C# code?
private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
List<Department> departmentList = new List<Department>();
departmentList = new DepartmentBLL().DepartmentAll();
if (e.Column.FieldName == "Department.ID")
{
foreach (Department dept in departmentList)
{
if (dept.ID.ToString() == e.Value.ToString())
e.DisplayText = dept.Name;
}
}
}
private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
List<Department> departmentList = new List<Department>();
departmentList = new DepartmentBLL().DepartmentAll();
if (e.Column.FieldName == "Department.ID")
{
foreach (Department dept in departmentList)
{
if (dept.ID.ToString() == e.Value.ToString())
e.DisplayText = dept.Name;
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询