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

728x90
반응형
728x170
using Infragistics.Win.UltraWinGrid;

private UltraGrid ultraGrid;

...

#region UltraGrid ENTER 처리하기 - ultraGrid_Enter(sender, e)

/// <summary>
/// UltraGrid ENTER 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void ultraGrid_Enter(object sender, EventArgs e)
{
    if(this.ultraGrid.ActiveRow == null)
    {
        this.ultraGrid.ActiveRow = this.ultraGrid.GetRow(ChildRow.First);
    }

    if(this.ultraGrid.ActiveCell == null)
    {
        this.ultraGrid.ActiveCell = this.ultraGrid.ActiveRow.Cells[2];
    }
}

#endregion

#region UltraGrid 키 DOWN 처리하기 - ultraGrid_KeyDown(sender, e)

/// <summary>
/// UltraGrid 키 DOWN 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void ultraGrid_KeyDown(object sender, KeyEventArgs e)
{
    switch(e.KeyCode)
    {
        case Keys.Up :

            this.ultraGrid.PerformAction(UltraGridAction.ExitEditMode, false, false);
            this.ultraGrid.PerformAction(UltraGridAction.AboveCell   , false, false);

            e.Handled = true;

            this.ultraGrid.PerformAction(UltraGridAction.EnterEditMode, false, false);

            break;

        case Keys.Down :

            this.ultraGrid.PerformAction(UltraGridAction.ExitEditMode, false, false);
            this.ultraGrid.PerformAction(UltraGridAction.BelowCell   , false, false);

            e.Handled = true;

            this.ultraGrid.PerformAction(UltraGridAction.EnterEditMode, false, false);

            break;

        case Keys.Right :

            this.ultraGrid.PerformAction(UltraGridAction.ExitEditMode , false, false);
            this.ultraGrid.PerformAction(UltraGridAction.NextCellByTab, false, false);

            e.Handled = true;

            this.ultraGrid.PerformAction(UltraGridAction.EnterEditMode, false, false);

            break;

        case Keys.Left :

            this.ultraGrid.PerformAction(UltraGridAction.ExitEditMode , false, false);
            this.ultraGrid.PerformAction(UltraGridAction.PrevCellByTab, false, false);

            e.Handled = true;

            this.ultraGrid.PerformAction(UltraGridAction.EnterEditMode, false, false);

            break;
    }
}

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

댓글을 달아 주세요