Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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();
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
 /// <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);
     }
 }
Exemplo n.º 7
0
        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);
            }
        }
Exemplo n.º 8
0
 /// <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
     {
     }
 }
Exemplo n.º 9
0
        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;
                }
            }
        }
Exemplo n.º 10
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();
        }
Exemplo n.º 11
0
        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;
                }
            }
        }
Exemplo n.º 12
0
 /// <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);
     }
 }
Exemplo n.º 13
0
        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)
                {
                }
            }
        }
Exemplo n.º 14
0
 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); }));
     }
 }
Exemplo n.º 16
0
 /// <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();
         }
     }
 }
Exemplo n.º 17
0
        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();
                }
            }
        }
Exemplo n.º 18
0
 /// <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);
     }
 }
Exemplo n.º 19
0
/// <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  {}
        }
Exemplo n.º 20
0
 /// <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);
     }
 }
Exemplo n.º 21
0
        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;
                }
            }
        }
Exemplo n.º 22
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); }));
     }
 }
Exemplo n.º 23
0
 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); }));
     }
 }
Exemplo n.º 24
0
        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";
            }
        }
Exemplo n.º 25
0
 private void gvList_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
 {
     Functions.AddingRowNumber(sender, e);
 }
Exemplo n.º 26
0
 private void GridviewListNationlity_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
 {
     UIHelpers.DevGridView.DanhSoThuTu(this, gridviewListNationlity, e);
 }
Exemplo n.º 27
0
 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();
     }
 }
Exemplo n.º 29
0
 /// <summary>
 /// 确定行号
 /// </summary>
 private void gridViewBomMateriel_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
 {
     ControlHandler.GridView_CustomDrawRowIndicator(e);
 }
Exemplo n.º 30
0
 private void gridView1_TimKiemBenhNhan_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
 {
     function.CustomDrawRowIndicator(sender, e);
 }