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
655
Add Row in Bands. Focus on the new row.
posted

Hello

We have an issue working with Bands.
When the last cell of a child band is commited, a new row is added. But the cursor goes to the next row from his parent band.
We want to have the focus in the new row.
Is it possible?

This is before add the new row

Before Add Row

This is after the row is added

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    What event are you using to add the new row?

    What is the user doing to commit the current row?

    My guess is that the user is pressed Tab and that you are using either BeforeRowUpdate or AfterRowUpdate to add the new row. This won't work because the focus will always move to the next cell before the new row gets added.

    I don't see any simple way around this. What I would do is handle the BeforePerformAction event and watch for an action of NextCellByTab. You would also have to check to make sure the user is in the last cell of the row, which could be tricky, since the user might have rearranged the columns. But basically, by trapping when the user is about to tab out of the last cell of the row with pending changes, you could cancel the action, add the new row, and then set the focus into the first cell of that row.

Children