첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
본 블로그는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 블로그 콘텐츠 향상을 위해 쓰여집니다.

728x90
반응형
728x170

using System;
using System.Drawing;

using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;

private UltraGrid ultraGrid;

...

#region UltraGrid 클래스 레이아웃 초기화 하기 - ultraGrid_InitializeLayout(sender, e)

/// <summary>
/// UltraGrid 클래스 레이아웃 초기화 하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void ultraGrid_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
    this.ultraGrid.UseOsThemes = DefaultableBoolean.False;


    e.Layout.Bands[0].ColHeaderLines = 2;

    e.Layout.Bands[0].Override.CellAppearance.BackColor       = Color.LightPink;
    e.Layout.Bands[0].Override.CellButtonAppearance.BackColor = Color.LightPink;

    e.Layout.Bands[0].Columns[0].Header.Caption = "Default";

    e.Layout.Bands[0].Columns[1].Header.Caption                 = "BackColor" + "\n" + "ForeColor";
    e.Layout.Bands[0].Columns[1].CellAppearance.BackColor       = Color.LightYellow;
    e.Layout.Bands[0].Columns[1].CellAppearance.ForeColor       = Color.Blue;
    e.Layout.Bands[0].Columns[1].CellButtonAppearance.BackColor = Color.LightYellow;

    e.Layout.Bands[0].Columns[2].Header.Caption               = "FontData" + "\n" + "Bold";
    e.Layout.Bands[0].Columns[2].CellAppearance.FontData.Bold = DefaultableBoolean.True;


    Image coffeeBeanImage = Image.FromFile(@"Program Dependent Files\Coffee Bean.bmp");


    e.Layout.Bands[1].ColHeaderLines = 2;

    e.Layout.Bands[1].Columns[0].Header.Caption          = "Image";
    e.Layout.Bands[1].Columns[0].Header.Appearance.Image = coffeeBeanImage;

    e.Layout.Bands[1].Columns[1].Header.Caption                    = "Background" + "\n" + "Image";
    e.Layout.Bands[1].Columns[1].Header.Appearance.ImageBackground = coffeeBeanImage;
    e.Layout.Bands[1].Columns[1].Header.Appearance.ForeColor       = Color.White;

    e.Layout.Bands[1].Columns[2].Header.Caption                   = "Disabled";
    e.Layout.Bands[1].Columns[2].CellActivation                   = Activation.Disabled;
    e.Layout.Bands[1].Columns[2].CellAppearance.BackColorDisabled = Color.LightGoldenrodYellow;

    e.Layout.Bands[1].Columns[3].Header.Caption                      = "Gradient";
    e.Layout.Bands[1].Columns[3].Header.Appearance.ForeColor         = Color.White;
    e.Layout.Bands[1].Columns[3].Header.Appearance.FontData.Bold     = DefaultableBoolean.True;
    e.Layout.Bands[1].Columns[3].Header.Appearance.BackColor         = Color.Red;
    e.Layout.Bands[1].Columns[3].Header.Appearance.BackColor2        = Color.Blue;
    e.Layout.Bands[1].Columns[3].Header.Appearance.BackGradientStyle = GradientStyle.Vertical;
}

#endregion

#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
728x90
반응형
그리드형
Posted by 사용자 icodebroker

댓글을 달아 주세요