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
70
Ultrawingrid.Ultragrid Cancel adding a row but keep the data in the addrow
posted

Hi,

I'm having trouble finding a solution for my problem.

I have a Ultrawingrid.Ultragrid with an addrow on top. The grid contains data for addresses. One of the columns is addresstype. 

Some types of addresses should be unique. (ex. Default Address).

In the BeforeRowUpdate I check if the type of address already exists and had to be unique.

Now I want to cancel the adding of the row if this type had to be unique and already exists. But I want to return to the addrow and keep the data entered, so the user just can change the addresstype and doesn't have to enter all the other data again.

How can I do this?

  • 34810
    Offline posted

    Hello Dieter,

    I have been investigating into the behavior you are looking for in this case, and I would like you to take a look at the attached sample, as I believe it demonstrates this.

    Essentially, in the BeforeRowUpdate, if the “duplicate” condition is met, I cancel the event and queue up an action to update the AddNewRow with the information that was entered by caching it into an object[]. In the sample, the ID field cannot be duplicated.

    Please let me know if you have any other questions or concerns on this matter.

    UltraGridAddNewCancelDemo.zip