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
25
After igtbl_deleteSelRows, postback occurs twice
posted

I am using the 9.1 WebGrid. I am calling a client-side function AfterSelectChange to determine if I want to perform a task based on the column selected or just select the entire row. If the user selects one or more rows, he can delete the selected rows by pressing a button defined outside the WebGrid. This delete button calls a client-side function that utilizes the igtbl_deleteSelRows function to delete the rows and force a server-side DeleteRow event. On the server-side, the rows that were selected are deleted from the database. All of this works as expected however another postback occurs which causes me some headaches. This is what happens after the delete button is pressed:

Page_PreInit
UG1_InitializeDataSource
UG1_DataBinding
UG1_InitializeLayout
Page_Load
UG1_DeleteRow
UG1_SelectedCellsChange (make sure that nothing happens when deleting)
UG1_SelectedRowsChange (make sure that nothing happens when deleting)
Page_PreRender
Page_PreInit
UG1_InitializeDataSource
UG1_DataBinding
UG1_InitializeLayout
Page_Load
UG1_SelectedCellsChange
UG1_SelectedRowsChange
Page_PreRender

Another thing to mention is when a row is selected a "div" area is displayed with additional information based on what row is selected. The second postback appears to show a selection is made and indeed a row in the grid shows up in the "div" area however no row in the grid is selected.

Does igtbl_deleteSelRows or DeleteRow functions select another row in the grid after the delete event happens? What event is happening to cause a second postback? Can I prevent changes to grid from happening while in the UpdateGrid function? Looking for any kind of help here.