Exemple #1
0
 private void dgvData_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, new SolidBrush(e.InheritedRowStyle.ForeColor), e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 5);
 }
 private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     //this.dataGridView1.Rows[e.RowIndex].Cells[0].Value = e.RowIndex + 1;
 }
        private void dataGridView2_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            DataGridView dgv = sender as DataGridView;

            SetRowBackgroundInOut(dgv);
        }
Exemple #4
0
 private void showCategoryDataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     showCategoryDataGridView.Rows[e.RowIndex].Cells[0].Value = (e.RowIndex + 1).ToString();
     showCategoryDataGridView.Rows[e.RowIndex].Cells[3].Value = "Edit";
 }
Exemple #5
0
 protected override void OnRowPostPaint(DataGridViewRowPostPaintEventArgs e)
 {
 }
 private void dgvTrinhDoHocVan_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     dgvTrinhDoHocVan.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1;
 }
Exemple #7
0
        //为DataGridView 添加行号列
        public static void ShowRows_DataGridView_RowPostPaint(DataGridView dgv, object sender, DataGridViewRowPostPaintEventArgs e)
        {
            Rectangle rectangle = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, dgv.RowHeadersWidth - 4, e.RowBounds.Height);

            TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), dgv.RowHeadersDefaultCellStyle.Font, rectangle, dgv.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.VerticalCenter | TextFormatFlags.Right);
        }
Exemple #8
0
 private void dvIron_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     dataGridViewRowPostPaint(sender, e);
 }
Exemple #9
0
        private void ly_materiel_supplier_viewDataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            DataGridView dv = sender as DataGridView;

            dv.Rows[e.RowIndex].Cells["Column1"].Value = e.RowIndex + 1;
        }
Exemple #10
0
 /*#################################### Data Grid View Row Number  Codding #################################*/
 private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     validate.rowNumberMathod(e, dataGridView1, this);
 }
Exemple #11
0
        private void dgvBookings_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            var SplitBookingCel  = dgvBookings.Rows[e.RowIndex].Cells["SplitBooking"];
            var ServiceCodeCel   = dgvBookings.Rows[e.RowIndex].Cells["ServiceCode"];
            var BookingTypeCel   = dgvBookings.Rows[e.RowIndex].Cells["BookingType"];
            var BookingNumberCel = dgvBookings.Rows[e.RowIndex].Cells["BookingNumber"];
            var LRDCel           = dgvBookings.Rows[e.RowIndex].Cells["LRDStr"];
            var CreatedAt        = dgvBookings.Rows[e.RowIndex].Cells["CreatedAtStr"];

            BookingNumberCel.Style.Font      = new Font(Font, FontStyle.Bold);
            BookingNumberCel.Style.Alignment = DataGridViewContentAlignment.MiddleLeft;
            LRDCel.Style.Font                        = new Font(Font, FontStyle.Bold);
            LRDCel.Style.Alignment                   = DataGridViewContentAlignment.MiddleCenter;
            CreatedAt.Style.Font                     = new Font(Font, FontStyle.Bold);
            CreatedAt.Style.Alignment                = DataGridViewContentAlignment.MiddleCenter;
            SplitBookingCel.Style.ForeColor          = Color.White;
            SplitBookingCel.Style.SelectionForeColor = Color.White;
            SplitBookingCel.Style.Font               = new Font(Font, FontStyle.Bold);
            SplitBookingCel.Style.Alignment          = DataGridViewContentAlignment.MiddleCenter;
            ServiceCodeCel.Style.ForeColor           = Color.White;
            ServiceCodeCel.Style.SelectionForeColor  = Color.White;
            ServiceCodeCel.Style.Font                = new Font(Font, FontStyle.Bold);
            ServiceCodeCel.Style.Alignment           = DataGridViewContentAlignment.MiddleCenter;
            BookingTypeCel.Style.ForeColor           = Color.White;
            BookingTypeCel.Style.SelectionForeColor  = Color.White;
            BookingTypeCel.Style.Font                = new Font(Font, FontStyle.Bold);
            BookingTypeCel.Style.Alignment           = DataGridViewContentAlignment.MiddleCenter;
            if (SplitBookingCel.Value.Equals("DNS"))
            {
                SplitBookingCel.Style.BackColor          = Color.Red;
                SplitBookingCel.Style.SelectionBackColor = Color.Red;
            }
            else
            {
                SplitBookingCel.Style.BackColor          = Color.Green;
                SplitBookingCel.Style.SelectionBackColor = Color.Green;
            }
            // REPO Color.Thistle
            // EXPORT Color.PowderBlue
            switch (ServiceCodeCel.Value)
            {
            case "BAG":
            {
                ServiceCodeCel.Style.SelectionBackColor = Color.Olive;
                ServiceCodeCel.Style.BackColor          = Color.DarkKhaki;
                break;
            }

            case "BGR":
            {
                ServiceCodeCel.Style.SelectionBackColor = Color.DarkGoldenrod;
                ServiceCodeCel.Style.BackColor          = Color.Goldenrod;
                break;
            }

            case "BLK":
            {
                ServiceCodeCel.Style.SelectionBackColor = Color.DarkKhaki;
                ServiceCodeCel.Style.BackColor          = Color.DarkSeaGreen;
                break;
            }
            }

            switch (BookingTypeCel.Value)
            {
            case "EXPORT":
            {
                BookingTypeCel.Style.SelectionBackColor = Color.Sienna;
                BookingTypeCel.Style.BackColor          = Color.Chocolate;
                break;
            }

            case "REPO":
            {
                BookingTypeCel.Style.SelectionBackColor = Color.Chocolate;
                BookingTypeCel.Style.BackColor          = Color.Peru;
                break;
            }

            case "IMPORT":
            {
                BookingTypeCel.Style.SelectionBackColor = Color.SaddleBrown;
                BookingTypeCel.Style.BackColor          = Color.Brown;
                break;
            }
            }
        }
Exemple #12
0
 private void dgvScoreList_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     // Common.DataGridViewStyle.DgvRowPostPaint(this.dgvScoreList, e);
 }
Exemple #13
0
 //Add STT columns
 private void adgvdsHSGiaHanDK_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     adgvdsHSGiaHanDK.Rows[e.RowIndex].Cells[0].Value = (e.RowIndex + 1).ToString(); //Display columns STT
 }
Exemple #14
0
 private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     this.dataGridView1.Rows[e.RowIndex].Cells[0].Value = (e.RowIndex + 1).ToString();
 }
Exemple #15
0
 private void dataGridViewStatus_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     ShowRows_DataGridView_RowPostPaint(this.dataGridViewStatus, sender, e);
 }
Exemple #16
0
        // Token: 0x0600000D RID: 13 RVA: 0x00005418 File Offset: 0x00003618
        private void gvData_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            Rectangle bounds = new Rectangle(e.RowBounds.Location.X, e.RowBounds.Location.Y, gvData.RowHeadersWidth - 4, e.RowBounds.Height);

            TextRenderer.DrawText(e.Graphics, (e.RowIndex + 1).ToString(), gvData.RowHeadersDefaultCellStyle.Font, bounds, gvData.RowHeadersDefaultCellStyle.ForeColor, TextFormatFlags.Right | TextFormatFlags.VerticalCenter);
        }
Exemple #17
0
 private void csvGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     columnMovementDone = false;
 }
        private void dgvFVN_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            SolidBrush B = new SolidBrush(Color.Black);

            e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, B, e.RowBounds.Location.X + 20, e.RowBounds.Location.Y + 4);
        }
 public static void RaiseDatagridviewRowpostpaintEvent(object objectRaisingEvent, DataGridViewRowPostPaintEventHandler controlEventHandlerRaised, DataGridViewRowPostPaintEventArgs controlEventArgs)
 {
     controlEventHandlerRaised?.Invoke(objectRaisingEvent, controlEventArgs);
 }
 private void GridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
 }
Exemple #21
0
 protected override void OnRowPostPaint(DataGridViewRowPostPaintEventArgs e)
 {
     e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, solidBrush, e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 5);
     base.OnRowPostPaint(e);
     base.OnRowPostPaint(e);
 }
        private void f_Item_dynamicpriceDataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            DataGridView dgv = sender as DataGridView;

            SetRowBackgroundInOut(dgv);
        }
Exemple #23
0
 /// <summary>
 /// 添加行号
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgvDesignWorkload_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     DataGridViewStyle.DgvRowPostPaint(this.dgvDesignWorkload, e);
 }
Exemple #24
0
 /// <summary>显示行号</summary>
 private void dgvPayDetails_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     StaticValue.ShowRows_DataGridView_RowPostPaint(this.dgvPayDetails, sender, e);
 }
Exemple #25
0
 private void dg_QualityDB_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     dg_QualityDB.Rows[e.RowIndex].Cells[0].Value = (e.RowIndex + 1).ToString();
 }
 private void ShowDataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     showDataGridView.Rows[e.RowIndex].Cells[0].Value = (e.RowIndex + 1).ToString();
 }
Exemple #27
0
        private void dgvDetail_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) //显示序号
        {
            SolidBrush b = new SolidBrush(this.dgvDetail.RowHeadersDefaultCellStyle.ForeColor);

            e.Graphics.DrawString((e.RowIndex + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture), this.dgvDetail.DefaultCellStyle.Font, b, e.RowBounds.Location.X + 20, e.RowBounds.Location.Y + 4);
        }
 private void showDataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     this.showDataGridView.Rows[e.RowIndex].Cells[0].Value = e.RowIndex + 1;
 }
Exemple #29
0
 private void dgvUserInfo_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     e.Graphics.DrawString((e.RowIndex + 1).ToString(System.Globalization.CultureInfo.CurrentUICulture), this.dgvUserInfo.DefaultCellStyle.Font, solidBrush, e.RowBounds.Location.X + 20, e.RowBounds.Location.Y + 4);
 }
Exemple #30
0
 private void categoryDataGridView_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
 {
     categoryDataGridView.Rows[e.RowIndex].Cells["Sl"].Value = (e.RowIndex + 1).ToString();
 }
Exemple #31
0
    // Paints the content that spans multiple columns and the focus rectangle.
    void dataGridView1_RowPostPaint(object sender,
        DataGridViewRowPostPaintEventArgs e)
    {
        // Calculate the bounds of the row.
        Rectangle rowBounds = new Rectangle(
            this.dataGridView1.RowHeadersWidth, e.RowBounds.Top,
            this.dataGridView1.Columns.GetColumnsWidth(
                DataGridViewElementStates.Visible) -
            this.dataGridView1.HorizontalScrollingOffset + 1,
            e.RowBounds.Height);

        SolidBrush forebrush = null;
        try
        {
            // Determine the foreground color.
            if ((e.State & DataGridViewElementStates.Selected) ==
                DataGridViewElementStates.Selected)
            {
                forebrush = new SolidBrush(e.InheritedRowStyle.SelectionForeColor);
            }
            else
            {
                forebrush = new SolidBrush(e.InheritedRowStyle.ForeColor);
            }

            // Get the content that spans multiple columns.
            object recipe =
                this.dataGridView1.Rows.SharedRow(e.RowIndex).Cells[2].Value;

            if (recipe != null)
            {
                String text = recipe.ToString();

                // Calculate the bounds for the content that spans multiple
                // columns, adjusting for the horizontal scrolling position
                // and the current row height, and displaying only whole
                // lines of text.
                Rectangle textArea = rowBounds;
                textArea.X -= this.dataGridView1.HorizontalScrollingOffset;
                textArea.Width += this.dataGridView1.HorizontalScrollingOffset;
                textArea.Y += rowBounds.Height - e.InheritedRowStyle.Padding.Bottom;
                textArea.Height -= rowBounds.Height -
                    e.InheritedRowStyle.Padding.Bottom;
                textArea.Height = (textArea.Height / e.InheritedRowStyle.Font.Height) *
                    e.InheritedRowStyle.Font.Height;

                // Calculate the portion of the text area that needs painting.
                RectangleF clip = textArea;
                clip.Width -= this.dataGridView1.RowHeadersWidth + 1 - clip.X;
                clip.X = this.dataGridView1.RowHeadersWidth + 1;
                RectangleF oldClip = e.Graphics.ClipBounds;
                e.Graphics.SetClip(clip);

                // Draw the content that spans multiple columns.
                e.Graphics.DrawString(
                    text, e.InheritedRowStyle.Font, forebrush, textArea);

                e.Graphics.SetClip(oldClip);
            }
        }
        finally
        {
            forebrush.Dispose();
        }

        if (this.dataGridView1.CurrentCellAddress.Y == e.RowIndex)
        {
            // Paint the focus rectangle.
            e.DrawFocus(rowBounds, true);
        }
    }