private void DrawGroup(TreeListGroupRenderEventArgs e, bool setClip = true) { e.Graphics.KeepClip(_bound.ItemBound, () => { Renderer.DrawGroup(e); }, setClip); }
public virtual void DrawGroup(TreeListGroupRenderEventArgs e) { var sf = new StringFormat(); sf.LineAlignment = StringAlignment.Center; var trect = new Rectangle(e.Bounds.X + 10, e.Bounds.Y, e.Bounds.Width - 10, e.Bounds.Height); using (var brush = new SolidBrush(e.Group.TreeList.GroupForeColor)) { e.Graphics.DrawString(e.Group.Text, e.Group.TreeList.GroupFont, brush, trect, sf); } var tsize = e.Graphics.MeasureString(e.Group.Text, e.Group.TreeList.GroupFont); var x = trect.X + (int)tsize.Width + 10; var y = e.Bounds.Y + e.Bounds.Height / 2; var lrect = new Rectangle(x, y, e.Bounds.Width - x - 10, 1); using (var brush = new SolidBrush(Color.FromArgb(242, 242, 248))) { e.Graphics.FillRectangle(brush, lrect); } }