private void treeList1_CustomDrawNodeIndicator(object sender, CustomDrawNodeIndicatorEventArgs e) { TreeList tree = sender as DevExpress.XtraTreeList.TreeList; IndicatorObjectInfoArgs args = e.ObjectArgs as IndicatorObjectInfoArgs; args.DisplayText = (tree.GetVisibleIndexByNode(e.Node) + 1).ToString(); }
protected virtual void DrawQuickCustomisationIcon(GridViewDrawArgs e, IndicatorObjectInfoArgs info, IndicatorKind kind) { if (kind == DevExpress.Utils.Drawing.IndicatorKind.Header && ((CustomGridViewInfo)e.ViewInfo).QuickCustomisationIconStatus != QuickCustomisationIconStatus.Hidden) { DrawQuickCustomisationIconCore(e, info, ((CustomGridViewInfo)e.ViewInfo).QuickCustomisationIcon, ((CustomGridViewInfo)e.ViewInfo).QuickCustomisationBounds, ((CustomGridViewInfo)e.ViewInfo).QuickCustomisationIconStatus); } }
public RowIndicatorCustomDrawEventArgs GetCustomDrawRowIndicatorArgs(GraphicsCache cache, Rectangle rect) { IndicatorObjectInfoArgs styleArgs = new IndicatorObjectInfoArgs(cache); styleArgs.Bounds = new Rectangle(new Point(0, 0), rect.Size); RowIndicatorCustomDrawEventArgs args = new RowIndicatorCustomDrawEventArgs(cache, -1, null, styleArgs); args.Handled = true; RaiseCustomDrawRowIndicator(args); return(args); }
/// <summary> /// TreeList设置显示所有节点的行号 /// </summary> public static void TreeList_CustomDrawNodeIndicator_AllNode(object sender, DevExpress.XtraTreeList.CustomDrawNodeIndicatorEventArgs e) { TreeList tmpTree = sender as TreeList; IndicatorObjectInfoArgs args = e.ObjectArgs as IndicatorObjectInfoArgs; if (args != null) { int rowNum = tmpTree.GetVisibleIndexByNode(e.Node) + 1; //this.treeList.IndicatorWidth = rowNum.ToString().Length * 10 + 10; args.DisplayText = rowNum.ToString(); } }
/// <summary> /// 显示行号 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tlData_CustomDrawNodeIndicator(object sender, DevExpress.XtraTreeList.CustomDrawNodeIndicatorEventArgs e) { if (this.showLineNumber) { e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; IndicatorObjectInfoArgs arg = e.ObjectArgs as IndicatorObjectInfoArgs; if (arg.IsRowIndicator) { int rowNum = this.tlData.GetVisibleIndexByNode(e.Node) + 1; arg.DisplayText = rowNum.ToString(); } } }
private void bandedGridView2_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e) { GridView view = (GridView)sender; if (e.Info.IsRowIndicator && e.RowHandle >= 0) { //view.GetRow(e.RowHandle) e.Info.DisplayText = "xxxxxxxxxxxxxxxxxxxx " + e.RowHandle.ToString(); graphics = e.Info; } else { e.Info.DisplayText = "asdasad"; graphics = null; } }
void XCITreeGrid_CustomDrawNodeIndicator(object sender, CustomDrawNodeIndicatorEventArgs e) { if (e.IsNodeIndicator) { TreeList tree = (DevExpress.XtraTreeList.TreeList)sender; IndicatorObjectInfoArgs args = (IndicatorObjectInfoArgs)e.ObjectArgs; var index = tree.GetVisibleIndexByNode(e.Node); if (index < 0) { args.DisplayText = string.Empty; } else { args.DisplayText = (index + 1).ToString(); } e.ImageIndex = -1; } }
protected virtual void DrawQuickCustomisationIconCore(GridViewDrawArgs e, IndicatorObjectInfoArgs info, QuickCustomizationIcon icon, Rectangle bounds, QuickCustomisationIconStatus status) { Rectangle patchedRec = new Rectangle(bounds.X + 1, bounds.Y, bounds.Width - 1, bounds.Height); GridColumnInfoArgs args = new GridColumnInfoArgs(e.Cache, e.ViewInfo.ColumnsInfo[0].Column); args.Cache = e.Cache; args.Bounds = patchedRec; ((HeaderObjectInfoArgs)args).HeaderPosition = HeaderPositionKind.Center; if (status == QuickCustomisationIconStatus.Hot) ((HeaderObjectInfoArgs)args).State = ObjectState.Hot; ElementsPainter.Column.DrawObject(args); if (icon.Image != null) { Rectangle rec = new Rectangle(); rec.Location = new Point(bounds.Left + 1, bounds.Top + 1); rec.Size = new Size(bounds.Width - 2, bounds.Height - 2); ImageAttributes attr = new ImageAttributes(); attr.SetColorKey(icon.TransperentColor, icon.TransperentColor); e.Graphics.DrawImage(icon.Image, rec, 0, 0, icon.Image.Width, icon.Image.Height, GraphicsUnit.Pixel, attr); } }
protected override void DrawIndicatorCore(GridViewDrawArgs e, IndicatorObjectInfoArgs info, int rowHandle, IndicatorKind kind) { base.DrawIndicatorCore(e, info, rowHandle, kind); DrawQuickCustomisationIcon(e, kind); }
protected override void DrawIndicatorCore(GridViewDrawArgs e, IndicatorObjectInfoArgs info, int rowHandle, IndicatorKind kind) { base.DrawIndicatorCore(e, info, rowHandle, kind); DrawQuickCustomisationIcon(e, info, kind); }