gridcontrol怎么设置列头
1个回答
2016-03-31
展开全部
首先捕获"EndSorting"事件,然后在其中加入以下代码:
private void gridView_EndSorting(object sender, EventArgs e)
{
Color clr = gridView.Appearance.Row.BackColor;
foreach (DevExpress.XtraGrid.Columns.GridColumn dc in gridView.Columns)
{
if (dc.VisibleIndex == gridView1.SortedColumns[0].VisibleIndex)
{
dc.AppearanceCell.BackColor = Color.Red;
}
else
{
dc.AppearanceCell.BackColor = clr;
}
}
}
其中的"gridView"是"DevExpress.XtraGrid.Views.Grid.GridView"类型实例~
private void gridView_EndSorting(object sender, EventArgs e)
{
Color clr = gridView.Appearance.Row.BackColor;
foreach (DevExpress.XtraGrid.Columns.GridColumn dc in gridView.Columns)
{
if (dc.VisibleIndex == gridView1.SortedColumns[0].VisibleIndex)
{
dc.AppearanceCell.BackColor = Color.Red;
}
else
{
dc.AppearanceCell.BackColor = clr;
}
}
}
其中的"gridView"是"DevExpress.XtraGrid.Views.Grid.GridView"类型实例~
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询