protected override void OnDrawCellButton(GridCellButton button, Graphics g, int rowIndex, int colIndex, bool bActive, GridStyleInfo style) { //directly call the draw to avoid base class and focus rectangle... button.Text = ""; button.Draw(g, rowIndex, colIndex, false, style); Rectangle faceRect = button.Bounds; faceRect.Inflate(-2, -1); string text = style.Description; if (text != null && text.Length > 0) { using (Font font = new Font(style.Font.Facename, (float)7.0)) { StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; format.LineAlignment = StringAlignment.Center; format.HotkeyPrefix = style.HotkeyPrefix; format.Trimming = style.Trimming; if (!style.WrapText) { format.FormatFlags = StringFormatFlags.NoWrap; } Color textColor = Grid.PrintingMode && Grid.Model.Properties.BlackWhite ? Color.Black : style.TextColor; g.DrawString(text, font, new SolidBrush(textColor), faceRect, format); } } //base.OnDrawCellButton(button, g, rowIndex, colIndex, false, style); }
public PivotButtonCellRenderer(GridControlBase grid, GridCellModelBase cellModel) : base(grid, cellModel) { AddButton(pushButton = new GridCellButton(this)); //AddButton(pushButton = new GridDataBoundTreeCellButton(this)); this.ForceRefreshOnActivateCell = true; }
/// <summary> /// overriden to draw the button for this cell. /// </summary> /// <param name="button">instance of the gridcellbutton to be drawn</param> /// <param name="g">graphics associated with this control</param> /// <param name="rowIndex">rowIndex of this cell in grid</param> /// <param name="colIndex">colIndex of this cell in grid</param> /// <param name="bActive">boolean value</param> /// <param name="style">style information of this cell</param> protected override void OnDrawCellButton(GridCellButton button, Graphics g, int rowIndex, int colIndex, bool bActive, GridStyleInfo style) { Point ptOffset = new Point(1, 1); GridProperties propertyObject = Grid.Model.Properties; Rectangle faceRect = button.Bounds; faceRect.Inflate(-2, -1); }
/// <override/> protected override void OnDrawCellButton(GridCellButton button, Graphics g, int rowIndex, int colIndex, bool bActive, Syncfusion.Windows.Forms.Grid.GridStyleInfo style) { Node n = this.treeHelper.GetNode(rowIndex); if (!n.HasChildren) { return; } base.OnDrawCellButton(button, g, rowIndex, colIndex, bActive, style); }
/// <summary> /// Initializes a new <see cref="OutlookHeaderCellRenderer"/> object. /// </summary> /// <param name="grid">Instance of gridcontrolbase.</param> /// <param name="cellModel">The cellmodel of this renderer.</param> public OutlookHeaderCellRenderer(GridControlBase grid, GridCellModelBase cellModel) : base(grid, cellModel) { this.gridBase = grid; AddButton(pushButton = new GridCellButton(this)); }