繁体   English   中英

如何在 DevExpress GridControl 的 CustomDrawGroupRow 事件中将自定义文本设置为 GroupRow?

[英]How to set custom text to a GroupRow in the CustomDrawGroupRow event of a DevExpress GridControl?

我正在寻找一种在CustomDrawGroupRow事件中设置GroupRow文本而不设置e.Handled = true的方法,因为我还需要应用基本绘图:

this.gridView.CustomDrawGroupRow += (s, e) => 
{
    /* set the GroupRow text here without using e.Handled = true */
}

我试过使用e.Graphics.DrawString但我不能使用e.Appearance.BackColor因为我需要设置e.Handled = true来绘制禁用它的string

您需要将e.InfoGridGroupRowInfo并将GridGroupRowInfo.GroupText设置为您的值:

using DevExprss.XtraGrid.Views.Grid.ViewInfo;

...

this.gridView.CustomDrawGroupRow += (s, e) => 
{
    GridGroupRowInfo groupInfo = e.Info as GridGroupRowInfo;
    groupInfo.GroupText = "Custom group text";
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM