private void bandedGridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { BandedGridView view = sender as BandedGridView; GridGroupRowInfo info = e.Info as GridGroupRowInfo; if (info.Column == colANA_GRUP) { var text = view.GetGroupSummaryText(e.RowHandle); text = Convert.ToDecimal(text.Substring(0, text.IndexOf(",")).Replace(" ", "")).ToString("N2"); info.GroupText = "<color=Maroon>" + info.GroupValueText + "</color> " + " : "; info.GroupText += "<color=blue>" + text + "</color> "; } if (info.Column == colGRUP) { var text = view.GetGroupSummaryText(e.RowHandle); var firstIndex = text.IndexOf(","); var lastIndex = text.LastIndexOf(","); text = text.Substring(0, text.LastIndexOf(",")); text = Convert.ToDecimal(text.Substring(text.IndexOf(",") + 1).Replace(" ", "")).ToString("N2"); info.GroupText = "<color=Maroon>" + info.GroupValueText + "</color> " + " : "; info.GroupText += "<color=green>" + text + "</color> "; } if (info.Column == colCARI_KODLAR) { var text = view.GetGroupSummaryText(e.RowHandle); var lst = text.LastIndexOf(","); text = Convert.ToDecimal(text.Substring(text.LastIndexOf(",") + 1).Replace(" ", "")).ToString("N2"); info.GroupText = "<color=Maroon>" + info.GroupValueText + "</color> " + " : "; info.GroupText += "<color=black>" + text + "</color> "; } }
private void gridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridGroupRowInfo GridGroupRowInfo = e.Info as GridGroupRowInfo; int id = int.Parse(GridGroupRowInfo.EditValue.ToString()); GridGroupRowInfo.GroupText = $"{nameDic[id]}({returns.Count(t=>t.Code==id)})"; }
private void bandedGridView1_CustomDrawFooter(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { int offset = 5; e.DefaultDraw(); Color color = highPriority; Rectangle markRectangle; string priorityText = " - High level"; for (int i = 0; i < 3; i++) { if (i == 1) { color = normalPriority; priorityText = " - Normal level"; } else if (i == 2) { color = lowPriority; priorityText = " - Low level"; } markRectangle = new Rectangle(e.Bounds.X + offset, e.Bounds.Y + offset + (markWidth + offset) * i, markWidth, markWidth); e.Cache.FillEllipse(markRectangle.X, markRectangle.Y, markRectangle.Width, markRectangle.Height, color); e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near; e.Appearance.Options.UseTextOptions = true; e.Appearance.DrawString(e.Cache, priorityText, new Rectangle(markRectangle.Right + offset, markRectangle.Y, e.Bounds.Width, markRectangle.Height)); } }
private void SetUpButtonInfoArgs(DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { args.Cache = e.Cache; ObjectState state = ObjectState.Normal; args.State = state; }
private void tsbGridView_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo info = e.Info as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo; DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView; string s = ""; foreach (DevExpress.XtraGrid.GridGroupSummaryItem g in view.GroupSummary) { if (g.ShowInGroupColumnFooter == null) { if (s != string.Empty) { s += " "; } s += view.GetGroupSummaryDisplayText(e.RowHandle, g); } } //var aaa = view.GetGroupSummaryValues(e.RowHandle).Values; //decimal gCnt = Convert.ToDecimal(view.GetChildRowCount(e.RowHandle)); int c = 0; decimal gCnt = Convert.ToDecimal(getChildRows(view, e.RowHandle, ref c)); decimal tCnt = Convert.ToDecimal(tsbGridView.DataRowCount); //decimal tCnt = Convert.ToDecimal(colTSBID.SummaryItem.SummaryValue); if (tCnt != 0) { decimal pc = Math.Round(gCnt / tCnt * 100, 0); s += string.Format(" %{0}", pc); } info.GroupText = string.Format(view.GroupFormat, info.Column.Caption, info.GroupValueText, s); }
private void gridViewMain_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { if (e.RowHandle >= 0) { return; } int childCount = this.gridViewMain.GetChildRowCount(e.RowHandle); for (int i = 0; i < childCount; i++) { int childHandle = this.gridViewMain.GetChildRowHandle(e.RowHandle, i); if (varTable.Rows[childHandle]["Modify"] != DBNull.Value && Convert.ToBoolean(varTable.Rows[childHandle]["Modify"])) { e.Appearance.BackColor = Color.Red; e.Appearance.ForeColor = Color.White; break; } } if (Math.Abs(e.RowHandle) % 2 == 0 && e.Appearance.BackColor != Color.Red) { e.Appearance.BackColor = Color.WhiteSmoke; } }
private void grvroottct_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridView view = sender as GridView; if (e.RowHandle < 0) { if (e.RowHandle == view.FocusedRowHandle) { e.Appearance.ForeColor = Color.Red; } else { int parentRowHandle = view.GetParentRowHandle(view.FocusedRowHandle); while (view.IsValidRowHandle(parentRowHandle)) { if (parentRowHandle == e.RowHandle) { e.Appearance.ForeColor = Color.Red; e.Appearance.Font = new Font("Tahoma", 11F); e.Appearance.BackColor = Color.AliceBlue; break; } parentRowHandle = view.GetParentRowHandle(parentRowHandle); } } } }
protected void OnCustomDrawGroupRow(DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { if (e.RowHandle == GrdViewReport.FocusedRowHandle) { e.Appearance.ForeColor = AppAppearance.BlueForeColor; } }
protected override void RaiseCustomDrawGroupRow(DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { var info = e.Info as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo; if (info != null) { CustomGroupStringBuildForm form; List <Tuple <double, bool> > format; if (this.myGroupEditForms.TryGetValue(info.Column, out form) && (format = (form.Tag as List <Tuple <double, bool> >)) != null) { string sumText = this.GetGroupSummaryText(info.RowHandle); string interval = ""; int index = getIndexOfFormatBoarders(Convert.ToDouble(this.GetGroupRowValue(info.RowHandle)), format); if (index == 0) { interval = " Value " + "<" + (format[index].Item2 ? "=" : "") + format[index].Item1; } else if (index == format.Count) { interval = format[index - 1].Item1 + "<" + (!format[index - 1].Item2 ? "=" : "") + " Value "; } else { interval = format[index - 1].Item1 + "<" + (!format[index - 1].Item2 ? "=" : "") + " Value " + "<" + (format[index].Item2 ? "=" : "") + format[index].Item1; } info.GroupText = info.Column.FieldName + ": " + interval + " " + sumText; } } base.RaiseCustomDrawGroupRow(e); }
private void DrawChooseGroupRowEventMethod(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { e.Painter.DrawObject(e.Info); if (this.AllowChooseGroup) { var repositoryCheck = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit(); repositoryCheck.Caption = ""; repositoryCheck.GlyphAlignment = DevExpress.Utils.HorzAlignment.Far; var info = repositoryCheck.CreateViewInfo() as DevExpress.XtraEditors.ViewInfo.CheckEditViewInfo; var painter = repositoryCheck.CreatePainter() as DevExpress.XtraEditors.Drawing.CheckEditPainter; int start = this.GetDataRowHandleByGroupRowHandle(e.RowHandle); int end = ((GroupSummaryDataType)this.GetGroupSummaryValue(e.RowHandle, GroupChooseNeedSummary)).end; int count = ((GroupSummaryDataType)this.GetGroupSummaryValue(e.RowHandle, GroupChooseNeedSummary)).choosecount; if (count == end - start + 1) { info.EditValue = true; } else if (count == 0) { info.EditValue = false; } else { info.EditValue = null; } info.Bounds = e.Bounds; info.CalcViewInfo(e.Graphics); groupCheckBoxPosition = e.Bounds.Left + e.Bounds.Width; var args = new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(info, new DevExpress.Utils.Drawing.GraphicsCache(e.Graphics), e.Bounds); painter.Draw(args); args.Cache.Dispose(); } e.Handled = true; }
private void gridView2_CustomDrawFooter(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { //GridView view = sender as GridView; //Rectangle r1 = (view.GetViewInfo() as GridViewInfo).ColumnsInfo[1].Bounds; //Rectangle r2 = (view.GetViewInfo() as GridViewInfo).ColumnsInfo[2].Bounds; //Rectangle r11 = (view.GetViewInfo() as GridViewInfo).FooterInfo.Cells[0].Bounds; //Rectangle r12 = (view.GetViewInfo() as GridViewInfo).FooterInfo.Cells[1].Bounds; }
private void gv_deptInfo_CustomDrawFooter(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { Rectangle r = e.Bounds; Brush brush = e.Cache.GetGradientBrush(e.Bounds, Color.Transparent, Color.Transparent, System.Drawing.Drawing2D.LinearGradientMode.Vertical); e.Graphics.FillRectangle(brush, r); e.Handled = true; }
private void DrawGroupRow(DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e, GridViewInfo viewInfo) { GridGroupRowInfo rowInfo = e.Info as GridGroupRowInfo; GridGroupRowPainter painter = e.Painter as GridGroupRowPainter; rowInfo.ButtonBounds = GetButtonRectangle(rowInfo.ButtonBounds, viewInfo); painter.ElementsPainter.GroupRow.DrawObject(rowInfo); }
private void grvMerma_CustomDrawFooter(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { try { e.Cache.GetGradientBrush(e.Bounds, Color.White, Color.White, System.Drawing.Drawing2D.LinearGradientMode.Vertical); e.Handled = true; } catch (Exception ex) { XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void xgtGridView_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridView view = sender as GridView; GridGroupRowInfo info = e.Info as GridGroupRowInfo; //info.GroupText = view.GetRowCellValue(e.RowHandle, colVAL).ToString(); GenelDataSet.XGTRow xgtRow = this.genelDataSet.XGT.FindByGRPID(info.EditValue.ToString(), "+"); info.GroupText = xgtRow.VAL; }
private void gridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridGroupRowInfo info = e.Info as GridGroupRowInfo; if (info == null) { return; } //info.GroupText = info.GroupText.Replace("1 items", "1 item"); }
void OnCustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { if (ShowGroupEditorOnMouseHover && HotTrackRectangle != Rectangle.Empty && e.Info.Bounds.Contains(HotTrackRectangle.Location)) { DrawGroupRow(e); DrawGroupEditor(e); e.Handled = true; } }
private void gridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridColumn cl = (GridColumn)dgvViewHD.dgvGridView.Columns["MA_CTKM"]; GridGroupRowInfo info = e.Info as GridGroupRowInfo; if (info.Column == cl) { info.GroupText = "Ship country starts with " + info.GroupValueText; } }
private void gridViewGroupList_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridGroupRowInfo GridGroupRowInfo = e.Info as GridGroupRowInfo; GridView gridview = sender as GridView; int index = gridview.GetDataRowHandleByGroupRowHandle(e.RowHandle); GridGroupRowInfo.GroupText = "名称:" + gridview.GetRowCellValue(index, "分组名称").ToString() + ",备注:" + gridview.GetRowCellValue(index, "分组备注").ToString(); }
private void gridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo info; info = e.Info as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridGroupRowInfo; info.ButtonBounds = Rectangle.Empty; info.GroupText = " " + info.GroupText.TrimStart(); e.Cache.FillRectangle(e.Appearance.GetBackBrush(e.Cache), e.Bounds); ObjectPainter.DrawObject(e.Cache, e.Painter, e.Info); e.Handled = true; }
private void GridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridGroupRowInfo info = e.Info as GridGroupRowInfo; GridView view = sender as GridView; if (info.Column == colCHUCVU) { info.GroupText = info.GroupValueText + " (Số lượng = " + gridView1.GetChildRowCount(e.RowHandle) + ")"; } }
private void gridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { int index = gridView1.GetDataRowHandleByGroupRowHandle(e.RowHandle); if (dsw.IsCustomItemIndex(index)) { GridGroupRowInfo info = e.Info as GridGroupRowInfo; info.GroupText = "Custom Rows"; } }
private void gvData_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridGroupRowInfo GridGroupRowInfo = e.Info as GridGroupRowInfo; int pos = GridGroupRowInfo.GroupText.LastIndexOf(":"); if (pos >= 0) { GridGroupRowInfo.GroupText = GridGroupRowInfo.GroupText.Substring(pos + 1); } }
private void ReqListView_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridGroupRowInfo info = e.Info as GridGroupRowInfo; if (info.Column.Name == "colCostCentre") { info.GroupText = info.GroupValueText; e.Appearance.ForeColor = Color.Blue; e.Appearance.Font = new Font("Verdana", 9, FontStyle.Bold); } }
private void gridView1_CustomDrawFooter(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { e.Graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(225, 244, 255)), e.Bounds); var footerText = "已选择交易记录数:" + this.gridView1.GetSelectedRows().Where(x => x > -1).Count().ToString(); var outStringFormat = new System.Drawing.StringFormat(); outStringFormat.Alignment = System.Drawing.StringAlignment.Near; outStringFormat.LineAlignment = System.Drawing.StringAlignment.Center; e.Graphics.DrawString(footerText, new System.Drawing.Font("Arial", 11, System.Drawing.FontStyle.Bold), new System.Drawing.SolidBrush(System.Drawing.Color.Black), e.Bounds, outStringFormat); e.Handled = true; }
private void GcView_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { var info = e.Info as GridGroupRowInfo; string caption = info.Column.Caption; if (info.Column.Caption == string.Empty) { caption = info.Column.ToString(); } info.GroupText = string.Format("{0} : {1} (count= {2})", caption, info.GroupValueText, gcView.GetChildRowCount(e.RowHandle)); }
private void gridViewSLeads_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridView view = sender as GridView; GridGroupRowInfo info = e.Info as GridGroupRowInfo; string caption = info.Column.Caption; if (info.Column.Caption == string.Empty) { caption = info.Column.ToString(); } info.GroupText = string.Format("{0} : {1} ({2})", caption, info.EditValue, view.GetChildRowCount(e.RowHandle)); }
private void DrawGroupEditor(DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridViewInfo viewInfo = view.GetViewInfo() as GridViewInfo; GridColumn col = viewInfo.GetNearestColumn(HotTrackRectangle.Location); BaseEditPainter groupEditPainter = GetGroupEditPainter(col); BaseEditViewInfo editViewInfo = GetGroupEditViewInfo(col); editViewInfo.Bounds = HotTrackRectangle; editViewInfo.CalcViewInfo(e.Graphics); e.Cache.FillRectangle(viewInfo.PaintAppearance.Row.GetBackBrush(e.Cache), HotTrackRectangle); groupEditPainter.Draw(new ControlGraphicsInfoArgs(editViewInfo, e.Cache, HotTrackRectangle)); }
private void opmclGridView_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridView view = sender as GridView; view.GetGroupRowDisplayText(e.RowHandle); GridGroupRowInfo info = e.Info as GridGroupRowInfo; if (string.IsNullOrWhiteSpace(info.GroupValueText)) { info.GroupText = "Not Loaded"; } }
private void gridView1_CustomDrawGroupRow(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { GridView view = sender as GridView; GridViewInfo viewInfo = view.GetViewInfo() as GridViewInfo; if (view.LeftCoord == 0) { return; } e.Appearance.FillRectangle(e.Cache, e.Bounds); DrawGroupRow(e, viewInfo); e.Handled = true; }