반응형
DataGridView 그냥 날 것으로 쓰면 엄청 묵직함이 느껴진다.
DoubleBuffered = true 해야하는데 속성이 없음.
class CustomDataGridView: DataGridView
{
public CustomDataGridView()
{
DoubleBuffered = true;
}
}
이렇게하거나
DataGridView 저렇게 못할 경우에는 다른 클래스로 확장한다.
public static class ExtensionMethods
{
public static void DoubleBuffered(this DataGridView dgv, bool setting)
{
Type dgvType = dgv.GetType();
PropertyInfo pi = dgvType.GetProperty("DoubleBuffered",
BindingFlags.Instance | BindingFlags.NonPublic);
pi.SetValue(dgv, setting, null);
}
}
오?
빨라지는군
출처1 : http://stackoverflow.com/questions/118528/horrible-redraw-performance-of-the-datagridview-on-one-of-my-two-screens
출처2 : http://riskversusreturn.blogspot.kr/2012/01/datagridview.html
반응형
'▩▩ 프로그래밍 ▩▩ > C#' 카테고리의 다른 글
[C#] img --> byte[], byte[] --> img (0) | 2014.03.13 |
---|---|
[C#] string --> int (0) | 2014.01.17 |
[TeeChart] TeeChart tutorial (2) | 2013.11.26 |
[C#] DataGridView 셀 가운데정렬 (0) | 2013.11.13 |
[GMap] Custom Marker Color - 원하는 칼라로 변경 (0) | 2013.11.06 |
[C#] MessageBox 선택 (0) | 2013.11.05 |
[C#] 8 bit color(Hexadecimal code) --> color (0) | 2013.11.05 |
[C#] ToolStrip의 ComboBox에서 SelectionChangeCommitted 쓰고싶을 때 (0) | 2013.10.28 |