private void gvRequests_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { //e.Info.ImageIndex = -1; //gvRequests.OptionsView.ShowIndicator = false; //gvRequests.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.None; // gvRequests.OptionsSelection.EnableAppearanceFocusedCell = false; // gvRequests.OptionsSelection.EnableAppearanceFocusedRow = false; // gvRequests.OptionsSelection.EnableAppearanceHideSelection = false; }
public static void AddingRowNumber(System.Object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { GridView view = (GridView)sender; if ((e.Info.IsRowIndicator & e.RowHandle > -1)) { e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; e.Info.DisplayText = (e.RowHandle + 1).ToString("#,##0"); } }
private void gvMidList_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { if (e.RowHandle < 0) { return; } e.Info.DisplayText = (e.RowHandle + 1).ToString(); }
private void gbList_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { int rowIndex = e.RowHandle; if (rowIndex >= 0) { rowIndex++; e.Info.DisplayText = rowIndex.ToString(); } }
private void DGvTransView_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { GridView view = (GridView)sender; //Check whether the indicator cell belongs to a data row if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } }
/// <summary> /// 加序号列 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridviewMedicalRecord_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { try { DS_Common.AutoIndex(e); } catch (Exception ex) { MyMessageBox.Show(1, ex); } }
private void gvMain_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { GridView view = sender as GridView; if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; e.Appearance.TextOptions.VAlignment = DevExpress.Utils.VertAlignment.Center; e.Appearance.ForeColor = Color.Blue; e.Appearance.Font = new Font("Times New Roman", 9, FontStyle.Bold); } }
/// <summary> /// 增加一列行序号 /// </summary> private static void gridView_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { try { if (e.Info.IsRowIndicator) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } } catch { } }
private void brvQryDetail_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { GridView view = (GridView)sender; if (e.RowHandle >= 0) { //Row Active if (e.RowHandle == view.FocusedRowHandle) { //e.Info.DisplayText = string.Empty; e.Info.ImageIndex = 0; } } }
private void gvTTHocPhi_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { e.Handled = true; SolidBrush brush = new SolidBrush(Color.FromArgb(0xC6, 0x64, 0xFF)); e.Graphics.FillRectangle(brush, e.Bounds); e.Graphics.DrawRectangle(Pens.Black, new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width - 1, e.Bounds.Height)); Size size = ImageCollection.GetImageListSize(e.Info.ImageCollection); Rectangle r = e.Bounds; ImageCollection.DrawImageListImage(e.Cache, e.Info.ImageCollection, e.Info.ImageIndex, new Rectangle(r.X + (r.Width - size.Width) / 2, r.Y + (r.Height - size.Height) / 2, size.Width, size.Height)); brush.Dispose(); }
private void gridItemDetail_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { GridView view = (GridView)sender; //Check whether the indicator cell belongs to a data row if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); if (!indicatorIcon) { e.Info.ImageIndex = -1; } } }
/// <summary> /// 增加一列行序号 /// </summary> private void gridView_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { try { if (e.Info.IsRowIndicator) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } } catch (Exception E) { this.ShowMessage(E.Message); } }
private void gridView_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { { try { GridView view = (GridView)sender; if (e.Info.IsRowIndicator && e.RowHandle >= 0) { string sText = (e.RowHandle + 1).ToString(); Graphics gr = e.Info.Graphics; gr.PageUnit = GraphicsUnit.Pixel; GridView gridView = ((GridView)sender); SizeF size = gr.MeasureString(sText, e.Info.Appearance.Font); int nNewSize = Convert.ToInt32(size.Width) + GridPainter.Indicator.ImageSize.Width + 10; if (gridView.IndicatorWidth < nNewSize) { gridView.IndicatorWidth = nNewSize; } e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; e.Info.DisplayText = sText; } if (!indicatorIcon) { e.Info.ImageIndex = -1; } if (e.RowHandle == GridControl.InvalidRowHandle) { Graphics gr = e.Info.Graphics; gr.PageUnit = GraphicsUnit.Pixel; GridView gridView = ((GridView)sender); SizeF size = gr.MeasureString("STT", e.Info.Appearance.Font); int nNewSize = Convert.ToInt32(size.Width) + GridPainter.Indicator.ImageSize.Width + 10; if (gridView.IndicatorWidth < nNewSize) { gridView.IndicatorWidth = nNewSize; } e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; e.Info.DisplayText = "STT"; } } catch (Exception ex) { } } }
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { if (e.Info.IsRowIndicator) { if (gridView1.IsRowSelected(e.RowHandle)) { e.Info.Paint.DrawCheckBox(e.Graphics, e.Bounds, ButtonState.Checked); e.Handled = true; } else { e.Info.Paint.DrawCheckBox(e.Graphics, e.Bounds, ButtonState.Normal); e.Handled = true; } } }
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { if (e.Info.IsRowIndicator) //Nếu là dòng Indicator { if (e.RowHandle < 0) { e.Info.ImageIndex = 0; e.Info.DisplayText = string.Empty; } else { e.Info.DisplayText = (e.RowHandle + 1).ToString(); //Số thứ tự tăng dần } BeginInvoke(new MethodInvoker(delegate { cal(40, gridView1); })); } }
/// <summary> /// 绘制行号 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far; if (e.Info.IsRowIndicator) { if (e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } else if (e.RowHandle < 0 && e.RowHandle > -1000) { e.Info.Appearance.BackColor = System.Drawing.Color.AntiqueWhite; e.Info.DisplayText = "G" + e.RowHandle.ToString(); } } }
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { GridView view = (GridView)sender; if (e.Info.IsRowIndicator && e.RowHandle > -1) { if (e.RowHandle < 0) { e.Info.DisplayText = "1"; } else { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } } }
/// <summary> /// 序号列 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gvDataElement_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { #region --------已注销 by xlb 2013.02.04------------ //if (e.Info.IsRowIndicator && e.RowHandle >= 0) //{ // e.Info.DisplayText = (e.RowHandle + 1).ToString(); //} #endregion try { DS_Common.AutoIndex(e); } catch (Exception ex) { DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex); } }
/// <summary> /// Number the rows in the indicator column /// </summary> /// <param name="e"></param> private void CustomDrawRowIndicator(DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { try { if (!e.Info.IsRowIndicator) { return; } if (e.RowHandle < 0) { return; // may be NewItemRow indicator at initialization } e.Info.DisplayText = (e.RowHandle + 1).ToString(); e.Info.ImageIndex = -1; // remove any image that would overlay the row number } catch {} }
/// <summary> /// 生成序号 /// <auth>zyx</auth> /// <auth>2013-1-5</auth> /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void gridViewPaient_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { try { if (e.Info.Kind == DevExpress.Utils.Drawing.IndicatorKind.Header) { e.Info.DisplayText = "序号"; } else if (e.Info.Kind == DevExpress.Utils.Drawing.IndicatorKind.Row) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
private void gv_ZYXX_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { e.Appearance.Font = new System.Drawing.Font("宋体", 9); e.Info.ImageIndex = -1; if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } if (e.RowHandle >= 0) { if (colStartIndex > 0 && e.RowHandle == rowStartIndex) { gv_ZYXX.SetRowCellValue(rowStartIndex, gv_ZYXX.Columns[colStartIndex], strStart); colStartIndex = 0; } } }
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { if (e.Info.IsRowIndicator) //Nếu là dòng Indicator { if (e.RowHandle < 0) { e.Info.ImageIndex = 0; e.Info.DisplayText = string.Empty; } else { e.Info.ImageIndex = -1; //Không hiển thị hình e.Info.DisplayText = (e.RowHandle + 1).ToString(); //Số thứ tự tăng dần } SizeF _Size = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font); //Lấy kích thước của vùng hiển thị Text Int32 _Width = Convert.ToInt32(_Size.Width) + 20; BeginInvoke(new MethodInvoker(delegate { cal(_Width, gridView1); })); } }
private void grvData_customDrawRow(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { if (e.Info.IsRowIndicator) { if (e.RowHandle < 0) { e.Info.ImageIndex = 0; e.Info.DisplayText = string.Empty; } else { e.Info.ImageIndex = -1; e.Info.DisplayText = (e.RowHandle + 1).ToString(); } SizeF siz = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font); Int32 _width = Convert.ToInt32(siz.Width); BeginInvoke(new MethodInvoker(delegate { Cal(20, grvData); })); } }
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { GridView view = (GridView)sender; if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; e.Info.DisplayText = (e.RowHandle + 1).ToString(); } if (!indicatorIcon) { e.Info.ImageIndex = -1; } if (e.RowHandle == GridControl.InvalidRowHandle) { e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; e.Info.DisplayText = "STT"; } }
private void gvList_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { Functions.AddingRowNumber(sender, e); }
private void GridviewListNationlity_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { UIHelpers.DevGridView.DanhSoThuTu(this, gridviewListNationlity, e); }
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { LoadSttGridView(e, gridView1); }
private void m_grv_danh_sach_can_phe_duyet_PM_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { if (e.Info.IsRowIndicator && e.RowHandle >= 0) { e.Info.DisplayText = (e.RowHandle + 1).ToString(); } }
/// <summary> /// 确定行号 /// </summary> private void gridViewBomMateriel_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { ControlHandler.GridView_CustomDrawRowIndicator(e); }
private void gridView1_TimKiemBenhNhan_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e) { function.CustomDrawRowIndicator(sender, e); }