Example #1
0
 public static void GridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e, GridControl gridControl, GridView gridView)
 {
     if (!gridView.IsGroupRow(e.RowHandle)) //Nếu không phải là Group
     {
         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;
             gridControl.BeginInvoke(new MethodInvoker(delegate { cal(_Width, gridView); })); //Tăng kích thước nếu Text vượt quá
         }
     }
     else
     {
         e.Info.ImageIndex  = -1;
         e.Info.DisplayText = string.Format("[{0}]", (e.RowHandle * -1)); //Nhân -1 để đánh lại số thứ tự tăng dần
         SizeF _Size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
         Int32 _Width = Convert.ToInt32(_Size.Width) + 20;
         gridControl.BeginInvoke(new MethodInvoker(delegate { cal(_Width, gridView); }));
     }
 }
Example #2
0
        private void CustomGridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            if (!IsGroupRow(e.RowHandle))
            {
                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();
                    }
                    var _Size = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
                    var n     = RowCount.ToString().Length;
                }
            }
            else
            {
                e.Info.ImageIndex  = -1;
                e.Info.DisplayText = string.Format("[{0}]", e.RowHandle * -1);
                var _Size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
                var _Width = Convert.ToInt32(_Size.Width) + 20;
            }


            //if (ShowIndexIndicator)
            //{
            //if (e.Info.IsRowIndicator && e.RowHandle >= 0)
            //        e.Info.DisplayText = (e.RowHandle + 1).ToString();
            //}
        }
Example #3
0
 private void gridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator)
     {
         e.Info.DisplayText = Convert.ToString(e.RowHandle + 1);
     }
 }
Example #4
0
        /// <summary>
        ///     Кастомное изображение на столбце индикатора
        /// </summary>
        public void ImageCustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            var view = (CommonGridView)sender;

            if (e.RowHandle < 0 || view.IndicatorImage == null)
            {
                return;
            }
            var erg = new EventRowHandlerArgs(e.RowHandle);

            view.DoCheckBeforeDrawIndicator.Raise(this, erg);
            if (erg.Cancel)
            {
                return;
            }
            e.Info.ImageIndex = -1;
            e.Painter.DrawObject(e.Info);
            var r = e.Bounds;

            r.Inflate(-1, -1);
            var x = r.X + (r.Width - view.IndicatorImage.Size.Width) / 2;
            var y = r.Y + (r.Height - view.IndicatorImage.Size.Height) / 2;

            e.Graphics.DrawImageUnscaled(view.IndicatorImage, x, y);
            e.Handled = true;
        }
Example #5
0
 public void RowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.RowHandle >= 0)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
     }
 }
Example #6
0
 /// <summary>
 /// Draw Row indicator
 /// </summary>
 /// <param name="gv"></param>
 /// <param name="e"></param>
 public static void DrawRowIndicator(this GridView gv, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
     }
 }
Example #7
0
 private void gvDataCheckin_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     e.Info.DisplayText = "STT";
     if (!gvDataCheckin.IsGroupRow(e.RowHandle))
     {
         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 size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
             Int32 width = Convert.ToInt32(size.Width) + 30;
             BeginInvoke(new MethodInvoker(delegate { cal(width, gvDataCheckin); }));
         }
     }
     else
     {
         e.Info.ImageIndex  = -1;
         e.Info.DisplayText = string.Format("[{0}]", (e.RowHandle * -1));
         SizeF size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
         Int32 width = Convert.ToInt32(size.Width) + 0;
         BeginInvoke(new MethodInvoker(delegate { cal(width, gvDataCheckin); }));
     }
 }
Example #8
0
 private void gridView1_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (!bandedGridView1.IsGroupRow(e.RowHandle)) //Nếu không phải là Group
     {
         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, bandedGridView1); }));     //Tăng kích thước nếu Text vượt quá
         }
     }
     else
     {
         e.Info.ImageIndex  = -1;
         e.Info.DisplayText = $"[{(e.RowHandle * -1)}]"; //Nhân -1 để đánh lại số thứ tự tăng dần
         SizeF size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
         Int32 width = Convert.ToInt32(size.Width) + 20;
         BeginInvoke(new MethodInvoker(delegate { Cal(width, bandedGridView1); }));
     }
 }
Example #9
0
 private void GridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (!grid.Focused && gridView.ActiveEditor == null)
     {
         e.Info.ImageIndex = -1;
     }
 }
Example #10
0
 public void LoadNumericalGridview(object sender, RowIndicatorCustomDrawEventArgs e, GridView dgv)
 {
     try
     {
         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 size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
             Int32 width = Convert.ToInt32(size.Width) + 20;
             BeginInvoke(new MethodInvoker(delegate { Cal(width, dgv); }));
         }
     }
     catch (Exception i)
     {
         MessageBox.Show("Lỗi : " + i);
     }
 }
Example #11
0
 private void gridView1_CustomDrawRowIndicator_1(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     try
     {
         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";
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex);
     }
 }
Example #12
0
        //private int index1 = 0;
        //private int index2 = 0;
        //private Dictionary<int, int> dic= new Dictionary<int, int>();
        protected override void RaiseCustomDrawRowIndicator(RowIndicatorCustomDrawEventArgs e)
        {
            // Sự kiện lớp base
            base.RaiseCustomDrawRowIndicator(e);
            e.Info.Appearance.Font = new Font(e.Info.Appearance.Font.FontFamily, e.Info.Appearance.Font.Size);
            e.Info.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
            e.Info.Appearance.TextOptions.VAlignment = VertAlignment.Center;
            // Hiển thị số thứ tự

            if (e.Info.IsRowIndicator && e.RowHandle >= 0)
            {
                e.Info.DisplayText = (e.RowHandle + 1).ToString();
                // index2 = e.RowHandle;
            }
            else if (!e.Info.IsRowIndicator && e.RowHandle < 0 && e.Info.IsTopMost)
            {
                e.Info.DisplayText = "STT";
                //index1 = 0;
                //index2 = 0;
            }
            //else if (IsGroupRow(e.RowHandle)&&e.RowHandle>-100)
            //{
            //    e.Info.DisplayText = "g" + (0 - e.RowHandle).ToString();
            //    index1 = 0 - e.RowHandle;
            //    dic[index1] = index2+1;
            //}
            //}
        }
        private static void CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.Info.DisplayText))
            {
                return;
            }
            bool indicatorIcon = false;

            DevExpress.XtraGrid.Views.Grid.GridView view = (DevExpress.XtraGrid.Views.Grid.GridView)sender;

            if (e.Info.IsRowIndicator && e.RowHandle >= 0)
            {
                e.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
                e.Appearance.TextOptions.VAlignment = VertAlignment.Center;
                e.Appearance.DrawString(e.Cache, e.RowHandle.ToString(), e.Bounds);
                //e.Info.DisplayText = Convert.ToString(int.Parse(e.RowHandle.ToString()) + 1);
                e.Info.DisplayText = (Convert.ToInt16(e.RowHandle + 1)).ToString();
                //e.Appearance.Font = new Font("Arial", 9.75F);
                if (!indicatorIcon)
                {
                    e.Info.ImageIndex = -1;
                }
            }
            if (e.RowHandle == DevExpress.XtraGrid.GridControl.InvalidRowHandle)
            {
                e.Appearance.TextOptions.HAlignment = HorzAlignment.Center;
                e.Appearance.TextOptions.VAlignment = VertAlignment.Center;

                e.Appearance.DrawString(e.Cache, e.RowHandle.ToString(), e.Bounds);
                e.Info.DisplayText = "";
            }
            //e.Appearance.ForeColor = MyColor.GridForeHeader;
            e.Painter.DrawObject(e.Info);
            e.Handled = true;
        }
 private void m_grv_ds_dh_hoan_thanh_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
     }
 }
 public void CreateSTT(GridView view, RowIndicatorCustomDrawEventArgs e)
 {
     if (!view.IsGroupRow(e.RowHandle))
     {
         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 size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
             Int32 width = Convert.ToInt32(size.Width) + 30;
             BeginInvoke(new MethodInvoker(delegate { cal(width, view); }));
         }
     }
     else
     {
         e.Info.ImageIndex  = -1;
         e.Info.DisplayText = string.Format("[{0}]", (e.RowHandle * -1));
         SizeF size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
         Int32 width = Convert.ToInt32(size.Width) + 0;
         BeginInvoke(new MethodInvoker(delegate { cal(width, view); }));
     }
 }
Example #16
0
 void _gv_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator)
     {
         e.Info.DisplayText = e.RowHandle >= 0 ? (e.RowHandle + 1).ToString() : "";
     }
 }
Example #17
0
 private void _view_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (!IsFocusedRowHighlighted)
     {
         e.Info.ImageIndex = -1;
     }
 }
 private void gridView_OdaDemirbaslari_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.RowHandle >= 0)
     {
         e.Info.DisplayText = e.RowHandle.ToString();
     }
 }
Example #19
0
 private void gdView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
     }
 }
Example #20
0
 public static void get(GridView gv, RowIndicatorCustomDrawEventArgs e)
 {
     if (!gv.IsGroupRow(e.RowHandle)) //Nếu không phải là Group
     {
         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) + 21;
             gv.IndicatorWidth = gv.IndicatorWidth < _Width ? _Width : gv.IndicatorWidth;
         }
     }
     else
     {
         e.Info.ImageIndex  = -1;
         e.Info.DisplayText = string.Format("[{0}]", (e.RowHandle * -1)); //Nhân -1 để đánh lại số thứ tự tăng dần
         SizeF _Size  = e.Graphics.MeasureString(e.Info.DisplayText, e.Appearance.Font);
         Int32 _Width = Convert.ToInt32(_Size.Width) + 20;
         gv.IndicatorWidth = gv.IndicatorWidth < _Width ? _Width : gv.IndicatorWidth;
     }
 }
        private void gridView1_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            if (e.Info.IsRowIndicator && e.RowHandle >= 0)
            {
                var gv = sender as GridView;
                if (StyleList.ContainsKey(gv))
                {
                    string info = string.Format(StyleList[gv].LineNumberFormatString, e.RowHandle + 1) + e.Info.DisplayText;

                    if (e.RowHandle == gv.RowCount - 1)
                    {
                        if (StyleList[gv].IsRefresh(gv.RowCount))
                        {
                            StyleList[gv].PreRowCount = gv.RowCount;
                            Graphics vGraphics  = e.Graphics;
                            SizeF    vSizeF     = vGraphics.MeasureString(info + "00", e.Appearance.Font);
                            int      dStrLength = Convert.ToInt32(Math.Ceiling(vSizeF.Width)) + 2;
                            if (gv.IndicatorWidth != dStrLength)
                            {
                                gv.IndicatorWidth = dStrLength;
                                gv.RefreshData();
                            }
                        }
                    }

                    e.Info.DisplayText = info;
                }
                else
                {
                    e.Info.DisplayText = (e.RowHandle + 1).ToString() + e.Info.DisplayText;
                }
            }
        }
 private void gvMngList_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
     }
 }
Example #23
0
 private void GridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
         e.Info.ImageIndex  = -1;                // no image
     }
 }
 protected override void RaiseCustomDrawRowIndicator(RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info != null)
     {
         e.Info.DisplayText = GetRowName(e.RowHandle);
     }
     base.RaiseCustomDrawRowIndicator(e);
 }
Example #25
0
 private void gdvGeneric_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Info.DisplayText = Convert.ToString(e.RowHandle + 1);
         e.Info.ImageIndex = -1;
     }
 }
Example #26
0
 void View_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (View.OptionsView.ShowIndicator && e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
         e.Info.ImageIndex  = -1;
     }
 }
Example #27
0
 private void removeArrowRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
    if (ShowArrowInRowIndicator) return;
    //remove row indicator with index 0;
    if (e.Info.ImageIndex == 0)
       e.Info.ImageIndex = -1;
    e.Painter.DrawObject(e.Info);
 }
Example #28
0
File: M04.cs Project: TPF-TUW/MDS
 private void gvCustomer_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
     }
     gvCustomer.IndicatorWidth = 40;
 }
Example #29
0
 private void gridView1_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (!e.Info.IsRowIndicator || e.RowHandle < 0)
     {
         return;
     }
     e.Info.DisplayText = (e.RowHandle + 1).ToString();
 }
Example #30
0
 /// <summary>
 /// 为GridView生成行号
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     e.Appearance.TextOptions.HAlignment = HorzAlignment.Far;
     if (e.Info.IsRowIndicator && e.RowHandle > -1000)
     {
         e.Info.DisplayText = e.RowHandle >= 0 ? (e.RowHandle + 1).ToString() : "G" + e.RowHandle;
     }
 }
Example #31
0
 protected override void RaiseCustomDrawRowIndicator(RowIndicatorCustomDrawEventArgs e)
 {
     base.RaiseCustomDrawRowIndicator(e);
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Info.DisplayText = Convert.ToString(Convert.ToInt32(e.RowHandle.ToString()) + 1);
     }
 }
 private void gbList_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     int rowIndex = e.RowHandle;
     if (rowIndex >= 0)
     {
         rowIndex++;
         e.Info.DisplayText = rowIndex.ToString();
     }
 }
Example #33
0
 private void gdvLines_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         var gr = e.Info.Graphics;
         gr.PageUnit = GraphicsUnit.Pixel;
         var gridView = ((GridView)sender);
         var size = gr.MeasureString(gridView.RowCount.ToString(), e.Info.Appearance.Font);
         gridView.IndicatorWidth = Convert.ToInt32(size.Width) + GridPainter.Indicator.ImageSize.Width + 10;
         e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
     }
 }
 private void gridView1_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         var gv = sender as GridView;
         if (StyleList.ContainsKey(gv))
         {
             e.Info.DisplayText = string.Format(StyleList[gv].LineNoFormatString, e.RowHandle + 1) + e.Info.DisplayText;
         }
         else
             e.Info.DisplayText = (e.RowHandle + 1).ToString() + e.Info.DisplayText;
     }
 }
Example #35
0
 void View_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.RowHandle == GridControl.InvalidRowHandle) {
         // You may assign your own image list e.Info.Images to show the custom image.
         e.Info.ImageIndex = GridPainter.IndicatorNewItemRow;
         e.Info.Appearance.ForeColor = Color.Blue;
         if (State != ColumnCustomizationState.None) {
             e.Info.State = DevExpress.Utils.Drawing.ObjectState.Pressed;
         }
     }
 }
 private void gridView1_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator & e.RowHandle >= 0)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString().Trim();
     }
 }
 private void gridView1_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (this.DesignMode)
         return;
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         var gv = sender as GridView;
         var para = StyleList[gv];
         if (para.EnableShowCate)
         {
             bool hasCate = (bool)gv.GetRowCellValue(e.RowHandle, para.CateField);
             if (hasCate)
                 e.Info.DisplayText = string.Format(para.FormatString.Replace("{line}", "{0}").Replace("{cate}", "{1}"), e.RowHandle + 1, StyleList[gv].CateString);
             else
                 e.Info.DisplayText = string.Format(para.FormatString.Replace("{line}", "{0}").Replace("{cate}", "{1}"), e.RowHandle + 1, string.Empty);
         }
     }
 }
Example #38
0
 /// <summary>
 ///     Кастомное изображение на столбце индикатора
 /// </summary>
 public void ImageCustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     var view = (CommonGridView)sender;
     if (e.RowHandle < 0 || view.IndicatorImage == null)
     {
         return;
     }
     var erg = new EventRowHandlerArgs(e.RowHandle);
     view.DoCheckBeforeDrawIndicator.Raise(this, erg);
     if (erg.Cancel)
     {
         return;
     }
     e.Info.ImageIndex = -1;
     e.Painter.DrawObject(e.Info);
     var r = e.Bounds;
     r.Inflate(-1, -1);
     var x = r.X + (r.Width - view.IndicatorImage.Size.Width) / 2;
     var y = r.Y + (r.Height - view.IndicatorImage.Size.Height) / 2;
     e.Graphics.DrawImageUnscaled(view.IndicatorImage, x, y);
     e.Handled = true;
 }
 private void m_grv_ds_don_hang_dang_xu_ly_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
 }
Example #40
0
 private void m_grv_lich_su_thuc_hien_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
 }
 void gridViewDetail_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (gridViewDetail.IsGroupRow(e.RowHandle) || gridViewDetail.IsNewItemRow(e.RowHandle)) return;
     DataRow row = gridViewDetail.GetDataRow(e.RowHandle);
     if (row == null || e.Info.IsRowIndicator == false) return;
     if (HelpNumber.ParseInt64(row[QL_LICH_PHAT_SONG_CT.BM_ID]) > 0)
     {
         e.Info.DisplayText = (e.RowHandle + 1) + " *";
     }
     e.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
     e.Appearance.Options.UseTextOptions = true;
 }
Example #42
0
        private void gridViewInboundDocs_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            bool indicatorIcon = true;

            GridView view = (GridView)sender;
            try
            {
                //Check whether the indicator cell belongs to a data row
                if (e.Info.IsRowIndicator && e.RowHandle > 0)
                {
                    string bookMark = view.GetRowCellValue(e.RowHandle, "BookmarkFlag").ToString();
                    string commentMark = view.GetRowCellValue(e.RowHandle, "CommentFlag").ToString();
                    string displayText = "";

                    if ((bookMark == null) || (bookMark == ""))
                    {
                        displayText = "";
                    }
                    else displayText = "B";

                    if ((commentMark == null) || (commentMark.Trim() == ""))
                    {
                    }
                    else
                    {
                        if (displayText != "")
                            displayText = "B,C";
                        else displayText = "C";
                    }

                    e.Info.DisplayText = displayText;
                    if (!indicatorIcon)
                        e.Info.ImageIndex = -1;
                }
            }
            catch (Exception err)
            {
                //Israel 12/14/2015 - appears out of sequence because CNF-506 was used elsewhere.
                XtraMessageBox.Show("An error occurred while setting grid with the bookmark and comment flags." + Environment.NewLine +
                       "Error CNF-507 in " + FORM_NAME + ".gridViewInboundDocs_CustomDrawRowIndicator(): " + err.Message,
                     FORM_ERROR_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #43
0
 private void gridItemDetail_CustomDrawRowIndicator(object sender, 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;
     }
 }
 private void gridViewOrderDetailForFacility_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator)
     {
         e.Info.DisplayText = (e.RowHandle + 1).ToString();
     }
 }
Example #45
0
 /// <summary>
 /// нумерация в гриде истории (автоинкремент)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void eventsHistoryGridView_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (e.Info.IsRowIndicator && e.RowHandle >= 0)
     {
         e.Info.DisplayText = e.RowHandle.ToString();
         e.Info.ImageIndex = -1;
     }
 }
Example #46
0
 private void gridView1_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
 {
     if (!e.Info.IsRowIndicator || e.RowHandle < 0) return;
     e.Info.Appearance.TextOptions.HAlignment = HorzAlignment.Far;
     //if(!iserroricon)
     e.Info.Appearance.TextOptions.VAlignment = VertAlignment.Center;
     e.Info.DisplayText = (1 + int.Parse(e.RowHandle.ToString())).ToString();
     e.Info.ImageIndex = -1;
 }
Example #47
0
        private void CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            //if (e.Info.IsRowIndicator)
            //{
            //    var row = advBandedGridView1.GetDataRow(e.RowHandle);
            //    if (row != null && row.RowError != String.Empty)
            //    {
            //        e.Info.ImageIndex = -1;
            //        e.Painter.DrawObject(e.Info);
            //        Rectangle r = e.Bounds;
            //        r.Inflate(-1, -1);
            //        int x = r.X + (r.Width - 24) / 2;
            //        int y = r.Y + (r.Height - 24) / 2;
            //        e.Graphics.DrawImageUnscaled(Properties.Resources.flagred, x, y);
            //        iserroricon = true;
            //        e.Handled = true;

            //    }
            //}
            if (!e.Info.IsRowIndicator || e.RowHandle < 0) return;
            e.Info.Appearance.TextOptions.HAlignment = HorzAlignment.Far;
            //if(!iserroricon)
            e.Info.Appearance.TextOptions.VAlignment = VertAlignment.Center;
            e.Info.DisplayText = (1 + int.Parse(e.RowHandle.ToString())).ToString();
            if (!indicatorIcon)
                e.Info.ImageIndex = -1;
        }