public BaseEditViewInfo GetEditorViewInfo(BaseRowViewInfo rowInfo, CustomDrawRowValueCellEventArgs e) { if (rowInfo == null) { return(null); } for (int i = 0; i < rowInfo.ValuesInfo.Count; i++) { RowValueInfo valuesInfo = rowInfo.ValuesInfo[i]; if (valuesInfo.RecordIndex == e.RecordIndex && valuesInfo.RowCellIndex == e.CellIndex) { return(valuesInfo.EditorViewInfo); } } return(null); }
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); }