private void treeList1_CustomDrawColumnHeader(object sender, DevExpress.XtraTreeList.CustomDrawColumnHeaderEventArgs e) { if (e.Column != null && e.Column.VisibleIndex == 0) { Rectangle checkRect = new Rectangle(e.Bounds.Left + 3, e.Bounds.Top + 3, 12, 12); ColumnInfo info = (ColumnInfo)e.ObjectArgs; if (info.CaptionRect.Left < 30) { info.CaptionRect = new Rectangle(new Point(info.CaptionRect.Left + 15, info.CaptionRect.Top), info.CaptionRect.Size); } e.Painter.DrawObject(info); DrawCheckBox(e.Cache, checkEdit, checkRect, IsAllSelected(sender as TreeList)); e.Handled = true; } }
private void TreeListCustomDrawColumnHeader(object sender, DevExpress.XtraTreeList.CustomDrawColumnHeaderEventArgs e) { System.Diagnostics.Debug.WriteLine("TreeListCustomDrawColumnHeader"); if (e.Column != null && e.Column.FieldName == "Selected" /*e.Column.VisibleIndex == 0*/) { Rectangle checkRect = new Rectangle(e.Bounds.Left + 3, e.Bounds.Top + 3, 12, 12); ColumnInfo info = (ColumnInfo)e.ObjectArgs; if (info.CaptionRect.Left < checkRect.Right + 5 /* 30 */) { info.CaptionRect = new Rectangle(new Point(info.CaptionRect.Left + checkRect.Width + 5 /* + 15 */, info.CaptionRect.Top), info.CaptionRect.Size); } e.Painter.DrawObject(info); DrawCheckBox(e.Graphics, checkEdit, checkRect, IsAllSelected(sender as TreeList)); e.Handled = true; } }
protected override void RaiseCustomDrawColumnHeader(DevExpress.XtraTreeList.CustomDrawColumnHeaderEventArgs e) { base.RaiseCustomDrawColumnHeader(e); //if (e.Column!=null) //e.Column.OptionsColumn.AllowSort = this.m_AllowSort; }