private void ServerPgnsDataGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { var row = serverPgnsDataGridView.Rows[e.RowIndex]; PaintIfCompleted(row); }
private void dgvThietBi_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dgvThietBi.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1; }
private void dgvDiem_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dgvDiem.Rows[e.RowIndex].Cells[0].Value = e.RowIndex + 1; }
private void OnRowPrePaint(Object sender, DataGridViewRowPrePaintEventArgs e) { AutoResizeRow(e.RowIndex); }
private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { }
private void dvPlan_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { CommDataMag.CommonMethed.SetDataGridViewRowColor(dvPlan, "STATUS", strArrColor); }
private void dataGridViewProductos_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { this.dataGridViewProductos.Rows[e.RowIndex].Cells[0].Value = (e.RowIndex + 1).ToString(); }
private void dataGridView1_ColumnPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dataGridView1.Columns["b[i]"].DefaultCellStyle.BackColor = Color.Beige; }
private void dgvObjectsHandbook_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { }
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); } } }
private void dgvTimKiemHocSinh_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { //dgvTimKiemHocSinh.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1; }
private void dgvChiTietPhieuMuon_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dgvChiTietPhieuMuon.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1; }
protected override void OnRowPrePaint(DataGridViewRowPrePaintEventArgs e) { base.OnRowPrePaint(e); RowPrePaintHandlerForZebraRows(e); }
private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Beige; }
private void dgvMalfunctionList_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dgvMalfunctionList.Rows[e.RowIndex].DefaultCellStyle.BackColor = bindinglist[e.RowIndex].State?.StateColorValue ?? Color.White; }
private void dgvShippingList_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dgvShippingList.Rows[e.RowIndex].DefaultCellStyle.BackColor = bindinglist[e.RowIndex].State.StateColorValue; }
void main_players_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { e.PaintParts &= ~DataGridViewPaintParts.Focus; }
private void dtvSanPham_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dtvSanPham.Rows[e.RowIndex].Cells["stt"].Value = e.RowIndex + 1; }
protected override void OnRowPrePaint(DataGridViewRowPrePaintEventArgs e) { e.Handled = true; }
private void dataCV_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dataCV.Rows[e.RowIndex].Cells["STTCV"].Value = e.RowIndex + 1; }
private void Grd_busqueda_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { }
private void dvPlan_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { CommDataMag.CommonMethed.SetDataGridViewRowColor(dvPlan, "casterstatusDataGridViewTextBoxColumn", strArrColor); }
private void dataGridViewDSGiaoVien_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dataGridViewDSGiaoVien.Rows[e.RowIndex].Cells["STT"].Value = e.RowIndex + 1; }
private void GridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { DataGridViewRow row = this.GridView.Rows[e.RowIndex]; this.gridTemplate.SetRowStyle(row); }
private void dataGridView1_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { ApplyConditionalFormatting(dataGridView1.Rows[e.RowIndex]); }
private void m_dgvMedicineOutInfo_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { }
private void dtgvNhanVien_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { dtgvNhanVien["STT", e.RowIndex].Value = (e.RowIndex < 9 ? "0" : "") + (e.RowIndex + 1); }
private void ReturnGrid_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { }
/// <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; }
// 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); } } }
private void gvAllBooks_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e) { if (e.RowIndex > 0) { } }