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
285
UltraWinGrid Template Add Row not being removed
posted

Hi

I have a WinGrid that is bound to a BindingSource and has an 'add row' at the bottom of the entries. I am instantiating a new object in the BindingSource's AddingNew when a new object is required.

If the user has entered the Add Row but has not made any changes, when they click or tab away, the data in the row is cleared and the row is blank again. In normal operation, this works beautifully and is exactly the behaviour I want for the application.

My problem is that the form's 'Save' button is on the UltraToolbarsManager toolbar.  If the focus is on the unmodified Add Row when 'Save' is clicked, the Add Row does not disappear in the normal way and the app attempts to save the empty row.

I know that clicking a toolbar button does not normally take focus or cause validation. I have tried moving focus in code with a SelectNext, which does get around the problem but I don't like this as a solution and wondered if there was a setting that I could use that would improve things.  We are forcing validation of the active control on toolbar_click so if we could somehow make use of this, that would be good.

Thanks in advance.

Parents
  • 469350
    Offline posted

    Hi,

    Just to be clear, you are saying that if the focus is on the TemplateAddRow in the grid and you click your ToolBar button, which presumably calls UpdateData on the grid, the row gets saved to the underlying data source - even though not changes have been made to it?

    That doesn't sounds like correct behavior to me. What version of the grid are you using? Do you have the latest service release?

Reply Children