728x90
728x170
using System;
using System.Drawing;
using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;
using Infragistics.Win.UltraWinGrid;
private UltraGrid ultraGrid;
private UltraCheckEditor useOSThemeCheckBox;
...
#region UltraGrid 행 초기화 하기 - ultraGrid_InitializeRow(sender, e)
/// <summary>
/// UltraGrid 행 초기화 하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void ultraGrid_InitializeRow(object sender, InitializeRowEventArgs e)
{
e.Row.ExpandAll();
}
#endregion
#region Use OS Theme 체크 박스 체크 변경시 처리하기 - useOSThemeCheckBox_CheckedChanged(sender, e)
/// <summary>
/// Use OS Theme 체크 박스 체크 변경시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void useOSThemeCheckBox_CheckedChanged(object sender, EventArgs e)
{
if(this.useOSThemeCheckBox.Checked == true)
{
this.ultraGrid.UseOsThemes = DefaultableBoolean.True;
}
else
{
this.ultraGrid.UseOsThemes = DefaultableBoolean.False;
}
}
#endregion
#region Grid Header 버튼 클릭시 처리하기 - gridHeaderButton_Click(sender, e)
/// <summary>
/// Grid Header 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void gridHeaderButton_Click(object sender, EventArgs e)
{
this.useOSThemeCheckBox.Checked = false;
this.ultraGrid.UseOsThemes = DefaultableBoolean.False;
this.ultraGrid.Text = "Test Grid";
this.ultraGrid.DisplayLayout.CaptionAppearance.BackColor = Color.LightYellow;
}
#endregion
#region Parent Band Header 버튼 클릭시 처리하기 - parentBandHeaderButton_Click(sender, e)
/// <summary>
/// Parent Band Header 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void parentBandHeaderButton_Click(object sender, EventArgs e)
{
this.useOSThemeCheckBox.Checked = false;
this.ultraGrid.DisplayLayout.Bands[0].HeaderVisible = true;
this.ultraGrid.DisplayLayout.Bands[0].Header.Caption = "Band 0 Header";
this.ultraGrid.DisplayLayout.Bands[0].Header.Appearance.BackColor = Color.LightYellow;
}
#endregion
#region Child Band Header 버튼 클릭시 처리하기 - ChildBandHeaderButton_Click(sender, e)
/// <summary>
/// Child Band Header 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void ChildBandHeaderButton_Click(object sender, EventArgs e)
{
this.useOSThemeCheckBox.Checked = false;
this.ultraGrid.DisplayLayout.Bands[1].HeaderVisible = true;
this.ultraGrid.DisplayLayout.Bands[1].Header.Caption = "Band 1 Header";
this.ultraGrid.DisplayLayout.Bands[1].Header.Appearance.BackColor = Color.LightYellow;
}
#endregion
#region Parent Band Column Header 버튼 클릭시 처리하기 - parentBandColumnHeaderButton_Click(sender, e)
/// <summary>
/// Parent Band Column Header 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void parentBandColumnHeaderButton_Click(object sender, EventArgs e)
{
this.useOSThemeCheckBox.Checked = false;
this.ultraGrid.DisplayLayout.Bands[0].Override.HeaderAppearance.BackColor = Color.LightYellow;
}
#endregion
#region Child Band Column Header 버튼 클릭시 처리하기 - childBandColumnHeaderButton_Click(sender, e)
/// <summary>
/// Child Band Column Header 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void childBandColumnHeaderButton_Click(object sender, EventArgs e)
{
this.useOSThemeCheckBox.Checked = false;
this.ultraGrid.DisplayLayout.Bands[1].Override.HeaderAppearance.BackColor = Color.LightYellow;
}
#endregion
#region Order ID Column Header 버튼 클릭시 처리하기 - orderIDColumnHeaderButton_Click(sender, e)
/// <summary>
/// Order ID Column Header 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void orderIDColumnHeaderButton_Click(object sender, EventArgs e)
{
this.useOSThemeCheckBox.Checked = false;
this.ultraGrid.DisplayLayout.Bands[1].Columns["OrderID"].Header.Caption = "Order ID";
this.ultraGrid.DisplayLayout.Bands[1].Columns["OrderID"].Header.Appearance.BackColor = Color.LightCoral;
}
#endregion
#region Card View Header 버튼 클릭시 처리하기 - cardViewHeaderButton_Click(sender, e)
/// <summary>
/// Card View Header 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void cardViewHeaderButton_Click(object sender, EventArgs e)
{
this.useOSThemeCheckBox.Checked = false;
this.ultraGrid.DisplayLayout.Bands[1].CardView = true;
this.ultraGrid.DisplayLayout.Bands[1].CardSettings.CaptionField = "OrderID";
this.ultraGrid.DisplayLayout.Bands[1].CardSettings.ShowCaption = true;
this.ultraGrid.DisplayLayout.Bands[1].Override.CardCaptionAppearance.BackColor = Color.Blue;
this.ultraGrid.DisplayLayout.Bands[1].Override.CardCaptionAppearance.ForeColor = Color.White;
}
#endregion
#region Group Header 버튼 클릭시 처리하기 - groupHeaderButton_Click(sender, e)
/// <summary>
/// Group Header 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void groupHeaderButton_Click(object sender, EventArgs e)
{
this.useOSThemeCheckBox.Checked = false;
if(this.ultraGrid.DisplayLayout.Bands[1].Groups.Exists("Orders") == true)
{
return;
}
this.ultraGrid.DisplayLayout.Bands[1].Groups.Add("Orders");
this.ultraGrid.DisplayLayout.Bands[1].LevelCount = 2;
this.ultraGrid.DisplayLayout.Bands[1].Columns["CustomerID"].Group = this.ultraGrid.DisplayLayout.Bands[1].Groups["Orders"];
this.ultraGrid.DisplayLayout.Bands[1].Columns["CustomerID"].Level = 0;
this.ultraGrid.DisplayLayout.Bands[1].Columns["OrderID"].Group = this.ultraGrid.DisplayLayout.Bands[1].Groups["Orders"];
this.ultraGrid.DisplayLayout.Bands[1].Columns["OrderID"].Level = 0;
this.ultraGrid.DisplayLayout.Bands[1].Columns["EmployeeID"].Group = this.ultraGrid.DisplayLayout.Bands[1].Groups["Orders"];
this.ultraGrid.DisplayLayout.Bands[1].Columns["EmployeeID"].Level = 1;
this.ultraGrid.DisplayLayout.Bands[1].Columns["OrderDate"].Group = this.ultraGrid.DisplayLayout.Bands[1].Groups["Orders"];
this.ultraGrid.DisplayLayout.Bands[1].Columns["OrderDate"].Level = 1;
this.ultraGrid.DisplayLayout.Bands[1].Groups["Orders"].Header.Appearance.BackColor = Color.LightSteelBlue;
}
#endregion
728x90
그리드형(광고전용)
'Infragistics > WinForm' 카테고리의 다른 글
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 모양 생성하기/적용하기 (0) | 2015.05.04 |
---|---|
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 행 또는 자식 밴드 연결 라인 디폴트 스타일 변경하기 (0) | 2015.05.04 |
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 셀 모양 변경하기 (0) | 2015.05.04 |
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 컬럼 모양 변경하기 (0) | 2015.05.04 |
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 행 모양 변경하기 (0) | 2015.05.04 |
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 밴드 모양 변경하기 (0) | 2015.05.04 |
[INFRAGISTICS/WINFORM] UltraComboEditor 클래스 : 자동 제안 하이라이트 설정하기 (0) | 2015.05.03 |
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 자동 제안 하이라이트 설정하기 (0) | 2015.05.03 |
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 실행시 프리셋 적용하기 (0) | 2015.05.03 |
[INFRAGISTICS/WINFORM] UltraGrid 클래스 : 알파 블렌딩 설정하기 (0) | 2015.05.03 |