Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
265
Determine if the active cell is in the last visible column for the current band
posted

Hi;

I have a grid with only one band, yet many hidden columns.  I am capturing the tab key in the key up event and want to automatically add a new row to the band, providing the active cell belongs to the last visible column in the band.

How do i determine if the active cell, belongs to the last visible column in the current band?

Kind Regards

 

Dave

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Dave,

    You may just want to set the AllowAddNew property on your grid to AllowAddNew.TemplateOnTopWithTabRepeat. That will handle the last visible column tabbing for you.

    But that may not be exactly what you want.

    I assume you want the last visible cell in the grid, not necessarily the last visible column. In other words, you want the last visible column in the last visible row. Not just the last visible cell in any row.

    I would probably use the grid's CurrentState for this.

                Debug.WriteLine((this.ultraGrid1.CurrentState & UltraGridState.CellLast) == UltraGridState.CellLast, "CellLast");
                Debug.WriteLine((this.ultraGrid1.CurrentState & UltraGridState.RowLast) == UltraGridState.RowLast, "RowLast");

     

    If both of those conditions are true, you are in the last cell.

     

     

     

Children