public static void DoubleBuffered(this System.Windows.Forms.DataGridView dgv, bool setting) { Type dgvType = dgv.GetType(); PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic); pi.SetValue(dgv, setting, null); }
public static void DoubleBuffered(this System.Windows.Forms.DataGridView p_grid, bool p_setting) { System.Type v_type; System.Reflection.PropertyInfo v_property; v_type = p_grid.GetType(); v_property = v_type.GetProperty("DoubleBuffered", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); v_property.SetValue(p_grid, p_setting, null); }
public static void ConfigureControl_DataGridView(System.Windows.Forms.DataGridView pControl) { if (pControl.Tag == null || (pControl.Tag != null && pControl.Tag != "SemRenderizacao")) { //pControl.BackgroundColor = StyleSettings.Cor_Fd_Grid; //pGrid.GridColor = ConfiguracoesDeEstilo.Cor_LinhaGrid; pControl.ColumnHeadersDefaultCellStyle.ForeColor = StyleSettings.Cor_Txt_CabecalhoGrid; pControl.ColumnHeadersDefaultCellStyle.BackColor = StyleSettings.Cor_Fd_CabecalhoGrid; pControl.ColumnHeadersDefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; pControl.ColumnHeadersDefaultCellStyle.Font = StyleSettings.Fonte_Grid; pControl.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; //pControl.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(DataGridView_OnCellPainting); pControl.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(DataGridView_OnColumnHeaderMouseClick); pControl.RowsDefaultCellStyle.ForeColor = StyleSettings.Cor_Txt_LinhaGrid; pControl.RowsDefaultCellStyle.BackColor = StyleSettings.Cor_Fd_LinhaGridA; if (pControl.GetType() == typeof(Controls.CustomDataGridViewResumo)) { pControl.RowsDefaultCellStyle.Font = StyleSettings.Fonte_Gabriel; pControl.AlternatingRowsDefaultCellStyle.Font = StyleSettings.Fonte_Gabriel; } else { pControl.RowsDefaultCellStyle.Font = StyleSettings.Fonte_Grid; pControl.AlternatingRowsDefaultCellStyle.Font = StyleSettings.Fonte_Grid; } pControl.AlternatingRowsDefaultCellStyle.ForeColor = StyleSettings.Cor_Txt_LinhaGrid; pControl.AlternatingRowsDefaultCellStyle.BackColor = StyleSettings.Cor_Fd_LinhaGridB; pControl.RowsDefaultCellStyle.SelectionBackColor = StyleSettings.Cor_Fd_LinhaGrid_Selecionada; pControl.RowsDefaultCellStyle.SelectionForeColor = StyleSettings.Cor_Txt_LinhaGrid_Selecionada; pControl.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; pControl.RowHeadersVisible = false; } }