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
55
Ultraweb grid add row event firing twice on save button click
posted

Hi,

I am using Infragistics 9.1 ultrawebgrid control. My scenario is as follows.

I have one grid - say Parent grid, contains 3 columns i.e. ID, Name, Address and for each row we will have User Phone information, this will be multiple rows. I am populating Phone information into another grid - say Phone Grid.

On Parent Grid - ActiveRow change, am populating ID, Name, Address and Phone information. These controls are available in one panel.

On Parent Grid - ActiveRow change - am making Panel visible true.

In Panel i have  1 button - say Save. On click of save button am saving all the data and making panel as visible false.

Everythig is working fine.

If user clicks on any part of the form or tab out on the grid and click on the save button,  panel becomes visible false(expected output).

The only one problem is after entering the Phone information in the Phone grid and if user  clicks immidiately on save button, panel is not becoming visible false.

For saving phone information am calling Phone_AddRow, Phone_UpdateRow events.

On click of Save buttong Following events are firing.

1. PhoneGrid_AddRow Event

2. PhoneGrid_UpdateRow Event

3. Phone Grid_DeleteRow Event

4. SaveButton_Click

{

SaveParentInfo()

SavePhoneInfo()

Panel.visible = false;

}

//again Phone grid events are firing. I dont know why 2 times grid events are firing.

5. PhoneGrid_AddRow Event

6. PhoneGrid_UpdateRow Event

7. Phone Grid_DeleteRow Event

Please let me know if you require any information. I am using typed datasets.

Any help would be really appreciated.

 

Thanks,

Srinivas

  • 12025
    posted

    Hello Srinivas, 

    You should explicitly have the grid loose focus before the save button executes. The reason being that the grid is trying to post back and fire row update event, but then save button is also initiating a postback, so there is mix up in the event routine. 

    If the user click the save button immediately after a row is being updated, then queue the post back initiated by the save button, let the row update complete its round trip, and then process the save button click. 

    Hope this helps. 

    Taz.