첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
using System.Windows.Forms;

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

private UltraGrid ultraGrid;

private UltraTextEditor ultraTextEditor;

...

#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)
{
    e.Layout.Bands[0].HeaderVisible = true;
    e.Layout.Bands[1].HeaderVisible = true;
}

#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)
{
    if(e.Row.Band.Index == 0)
    {
        e.Row.ExpandAll();
    }
}

#endregion

#region UltraGrid 마우스 UP 처리하기 - ultraGrid_MouseUp(sender, e)

/// <summary>
/// UltraGrid 마우스 UP 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void ultraGrid_MouseUp(object sender, MouseEventArgs e)
{
    UIElement uiElement = this.ultraGrid.DisplayLayout.UIElement.ElementFromPoint(e.Location);
    
    if(uiElement == null)
    {
        return;
    }

    UltraGridBand ultraGridBand = null;

    UltraGridRow ultraGridRow = uiElement.GetContext(typeof(UltraGridRow)) as UltraGridRow;

    if(ultraGridRow != null)
    {
        ultraGridBand = this.ultraGrid.DisplayLayout.Bands[ultraGridRow.Band.Index];
    }

    if(ultraGridBand == null)
    {
        UltraGridColumn ultraGridColumn = uiElement.GetContext(typeof(UltraGridColumn)) as UltraGridColumn;

        if(ultraGridColumn != null)
        {
            ultraGridBand = this.ultraGrid.DisplayLayout.Bands[ultraGridColumn.Band.Index];
        }
    }
                
    if(ultraGridBand != null)
    {
        this.ultraTextEditor.Text = "Band(" + ultraGridBand.Index.ToString() + ")";
    }
    else
    {
        this.ultraTextEditor.Text = "* no band associcated with this location";
    }
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요