コード例 #1
0
        private void ServerPgnsDataGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
        {
            var row = serverPgnsDataGridView.Rows[e.RowIndex];

            PaintIfCompleted(row);
        }
コード例 #2
0
ファイル: frmThietbi.cs プロジェクト: AnhDuongMTA/QlyVuiChoi
 private void dgvThietBi_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dgvThietBi.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1;
 }
コード例 #3
0
 private void dgvDiem_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dgvDiem.Rows[e.RowIndex].Cells[0].Value = e.RowIndex + 1;
 }
コード例 #4
0
 private void OnRowPrePaint(Object sender, DataGridViewRowPrePaintEventArgs e)
 {
     AutoResizeRow(e.RowIndex);
 }
コード例 #5
0
 private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
 }
コード例 #6
0
ファイル: ucRHData.cs プロジェクト: rcw0125/Lg
 private void dvPlan_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     CommDataMag.CommonMethed.SetDataGridViewRowColor(dvPlan, "STATUS", strArrColor);
 }
コード例 #7
0
 private void dataGridViewProductos_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     this.dataGridViewProductos.Rows[e.RowIndex].Cells[0].Value = (e.RowIndex + 1).ToString();
 }
コード例 #8
0
 private void dataGridView1_ColumnPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dataGridView1.Columns["b[i]"].DefaultCellStyle.BackColor = Color.Beige;
 }
コード例 #9
0
 private void dgvObjectsHandbook_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
 }
コード例 #10
0
        void PaintGroupRow(DataGridViewRowPrePaintEventArgs e)
        {
            var grouprow = (GroupRow)source[e.RowIndex];

            if (!selectionset)
            {
                setselection();
            }
            var info = grouprow.GetDisplayInfo(selectedGroups.Contains(e.RowIndex));

            if (info == null || info.Cancel)
            {
                return;                              //cancelled
            }
            if (info.Font == null)
            {
                info.Font = e.InheritedRowStyle.Font;
            }
            var r = e.RowBounds;

            r.Height--;

            using (var bgb = new SolidBrush(info.BackColor))
            {
                //line under the group row
                e.Graphics.DrawLine(Pens.SteelBlue, r.Left, r.Bottom, r.Right, r.Bottom);



                //group value
                {
                    int l = HeaderOffset + 1;
                    r.X = l - grid.HorizontalScrollingOffset;


                    //clear background
                    e.Graphics.FillRectangle(bgb, r);

                    using (var fb = new SolidBrush(info.ForeColor))
                    {
                        var sf = new StringFormat {
                            LineAlignment = StringAlignment.Center
                        };
                        if (info.Header != null)
                        {
                            var size = e.Graphics.MeasureString(info.Header, info.Font);
                            e.Graphics.DrawString(info.Header, info.Font, fb, r, sf);
                            r.X += (int)size.Width + 5;
                        }

                        if (info.DisplayValue != null)
                        {
                            using (var f = new Font(info.Font.FontFamily, info.Font.Size + 2, FontStyle.Bold))
                            {
                                var size = e.Graphics.MeasureString(info.DisplayValue, f);
                                e.Graphics.DrawString(info.DisplayValue, f, fb, r, sf);
                                r.X += (int)size.Width + 10;
                            }
                        }
                        if (info.Summary != null)
                        {
                            e.Graphics.DrawString(info.Summary, info.Font, fb, r, sf);
                        }
                    }


                    e.Graphics.FillRectangle(bgb, 0, r.Top, l, r.Height);
                }
            }

            //collapse/expand symbol
            {
                var cer = GetCollapseBoxBounds(e.RowBounds.Y);

                if (capturedcollapsebox.Y == e.RowIndex)
                {
                    e.Graphics.FillEllipse(Brushes.Yellow, cer);
                }
                e.Graphics.DrawEllipse(linepen, cer);
                bool collapsed = grouprow.Collapsed;
                int  cx;

                if (DrawExpandCollapseLines && !collapsed)
                {
                    cx = HeaderOffset - lineoffset;
                    e.Graphics.DrawLine(linepen, cx, cer.Bottom, cx, r.Bottom);
                }
                cer.Inflate(-2, -2);
                var cy = cer.Y + cer.Height / 2;
                e.Graphics.DrawLine(linepen, cer.X, cy, cer.Right, cy);
                if (collapsed)
                {
                    cx = cer.X + cer.Width / 2;
                    e.Graphics.DrawLine(linepen, cx, cer.Top, cx, cer.Bottom);
                }
            }
        }
コード例 #11
0
ファイル: TimKiemHocSinh.cs プロジェクト: thienmta/GV_HS_THPT
 private void dgvTimKiemHocSinh_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     //dgvTimKiemHocSinh.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1;
 }
コード例 #12
0
 private void dgvChiTietPhieuMuon_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dgvChiTietPhieuMuon.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1;
 }
コード例 #13
0
        protected override void OnRowPrePaint(DataGridViewRowPrePaintEventArgs e)
        {
            base.OnRowPrePaint(e);

            RowPrePaintHandlerForZebraRows(e);
        }
コード例 #14
0
 private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Beige;
 }
コード例 #15
0
 private void dgvMalfunctionList_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dgvMalfunctionList.Rows[e.RowIndex].DefaultCellStyle.BackColor = bindinglist[e.RowIndex].State?.StateColorValue ?? Color.White;
 }
コード例 #16
0
 private void dgvShippingList_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dgvShippingList.Rows[e.RowIndex].DefaultCellStyle.BackColor = bindinglist[e.RowIndex].State.StateColorValue;
 }
コード例 #17
0
ファイル: Window.cs プロジェクト: takaaptech/MCGalaxy
 void main_players_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     e.PaintParts &= ~DataGridViewPaintParts.Focus;
 }
コード例 #18
0
 private void dtvSanPham_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dtvSanPham.Rows[e.RowIndex].Cells["stt"].Value = e.RowIndex + 1;
 }
コード例 #19
0
 protected override void OnRowPrePaint(DataGridViewRowPrePaintEventArgs e)
 {
     e.Handled = true;
 }
コード例 #20
0
ファイル: ucHH_CV.cs プロジェクト: MTATrooper/QLPCgiangday
 private void dataCV_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dataCV.Rows[e.RowIndex].Cells["STTCV"].Value = e.RowIndex + 1;
 }
コード例 #21
0
 private void Grd_busqueda_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
 }
コード例 #22
0
 private void dvPlan_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     CommDataMag.CommonMethed.SetDataGridViewRowColor(dvPlan, "casterstatusDataGridViewTextBoxColumn", strArrColor);
 }
コード例 #23
0
 private void dataGridViewDSGiaoVien_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dataGridViewDSGiaoVien.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1;
 }
コード例 #24
0
        private void GridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
        {
            DataGridViewRow row = this.GridView.Rows[e.RowIndex];

            this.gridTemplate.SetRowStyle(row);
        }
コード例 #25
0
 private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     ApplyConditionalFormatting(dataGridView1.Rows[e.RowIndex]);
 }
コード例 #26
0
ファイル: frmMedicineOut.cs プロジェクト: ewin66/HIS
 private void m_dgvMedicineOutInfo_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
 }
コード例 #27
0
 private void dtgvNhanVien_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     dtgvNhanVien["STT", e.RowIndex].Value = (e.RowIndex < 9 ? "0" : "") + (e.RowIndex + 1);
 }
コード例 #28
0
ファイル: ReturnDetails.cs プロジェクト: AshifMohamed/SMS
 private void ReturnGrid_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
 }
コード例 #29
0
 /// <summary>
 /// Handles the RowPrePaint event of the dgv control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="DataGridViewRowPrePaintEventArgs" /> instance containing the event data.</param>
 private void dgv_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     e.PaintParts &= ~DataGridViewPaintParts.Focus;
 }
コード例 #30
0
ファイル: Form1.cs プロジェクト: huaminglee/DeeHome
    // Paints the custom selection background for selected rows.
    void dataGridView1_RowPrePaint(object sender,
            DataGridViewRowPrePaintEventArgs e)
    {
        // Do not automatically paint the focus rectangle.
        e.PaintParts &= ~DataGridViewPaintParts.Focus;

        // Determine whether the cell should be painted
        // with the custom selection background.
        if ((e.State & DataGridViewElementStates.Selected) ==
                    DataGridViewElementStates.Selected)
        {
            // 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);

            // Paint the custom selection background.
            using (Brush backbrush =
                new System.Drawing.Drawing2D.LinearGradientBrush(rowBounds,
                    this.dataGridView1.DefaultCellStyle.SelectionBackColor,
                    e.InheritedRowStyle.ForeColor,
                    System.Drawing.Drawing2D.LinearGradientMode.Horizontal))
            {
                e.Graphics.FillRectangle(backbrush, rowBounds);
            }
        }
    }
コード例 #31
0
 private void gvAllBooks_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     if (e.RowIndex > 0)
     {
     }
 }