void vGrid_CustomDrawRowHeaderCell(object sender, CustomDrawRowHeaderCellEventArgs e) { if (e.Row == _Row) { e.Caption = string.Empty; e.Handled = true; DrawEditorHelper.DrawRowInplaceEditor(e, _Item, EditValue); } }
private void MyPropertyGridControl_CustomDrawRowHeaderCell(object sender, CustomDrawRowHeaderCellEventArgs e) { applyDrawing(e); }
private void OnCustomDrawRowHeaderCell(object sender, CustomDrawRowHeaderCellEventArgs e) { Point hitPoint = MousePosition; //if (!(e.Row is CategoryRow)) return; VGridControl grid = (VGridControl)sender; VGridHitInfo hitInfo = ((VGridControl)sender).CalcHitInfo(grid.PointToClient(hitPoint)); if (hitInfo.Row != e.Row) { return; } BaseRowViewInfo rowInfo = null; foreach (BaseRowViewInfo info in grid.ViewInfo.RowsViewInfo) { if (info is CategoryRowViewInfo) { continue; } rowInfo = info; break; } if (rowInfo == null) { return; } RowValueInfo valueInfo = null; foreach (RowValueInfo info in rowInfo.ValuesInfo) { if (info.Bounds.X < hitInfo.PtMouse.X && info.Bounds.Right > hitInfo.PtMouse.X) { valueInfo = info; break; } } if (valueInfo == null) { return; } e.Handled = true; e.Appearance.DrawBackground(e.Cache, e.Bounds); e.Appearance.DrawString(e.Cache, e.Caption, e.CaptionRect); if (e.ImageIndex > 0) { ImageCollection.DrawImageListImage(e.Cache, e.Row.Properties.Images, e.ImageIndex, e.ImageRect); } if (e.Focused) { XPaint.Graphics.DrawFocusRectangle(e.Graphics, e.FocusRect, e.Appearance.ForeColor, e.Appearance.BackColor); } Rectangle hotTrackRect = new Rectangle(valueInfo.Bounds.X, e.Bounds.Y, valueInfo.Bounds.Width, e.Bounds.Height); hotTrackRect.Inflate(-1, -1); e.Graphics.FillRectangle(Brushes.AliceBlue, hotTrackRect); e.Graphics.DrawRectangle(Pens.Blue, hotTrackRect); }
public static void DrawRowInplaceEditor(CustomDrawRowHeaderCellEventArgs e, RepositoryItem item, object value) { Rectangle targetRect = e.Bounds; DrawEdit(e.Graphics, item, targetRect, value); }