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
475
Cancel Adding a row
posted

I have a grid "ugQtrSales".  To allow for only 4 rows  I want to cancel the add new row action if rowcount is greater than 4.  I know the escape key (twice) cancels the add row action.  What command(s) do I use and how would it look if I wanted to simulate that (pressing escape twice)  or accomplish same thing, using code (VB).

Parents
No Data
Reply
  • 69832
    Verified Answer
    Offline posted

    You can prevent a row form being added by canceling the BeforeRowInsert event.

    To simulate the action of canceling an edit mode session and then the modification of a row:

    Me.ultraGrid.PerformAction(UltraGridAction.UndoCell)
    Me.ultraGrid.PerformAction(UltraGridAction.UndoRow)

Children