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
930
UpdateCellBatch: Check where postback comes from
posted

Hi,

I have a class that represents a grid, inheriting from UltraWebGrid. In the OnLoad method I set an eventhandler for UpdateCellBatch (called Grid_OnUpdateCellBatch). On the page where the grid resides, there are multiple controls that can trigger a post-back. If some changes have been made to the grid and the user initiates a postback with one of these controls, the Grid_OnUpdateCellBatch function is invoked regardless of which control was used. Can I somehow ensure that the work of Grid_OnUpdateCellBatch will only be done if a specific control is clicked? How?

I am not sure how it can be done as the only information that is sent to Grid_OnUpdateCellBatch is the "sender" which is the grid itself and the CellEventArgs which does not hold information about anything else than the row+cells that were updated. If only I could get access to the Request...... Then I could use this method: http://ryanfarley.com/blog/archive/2005/03/11/1886.aspx

Regards,

 

Parents
No Data
Reply
  • 49378
    posted

    Hi epb1,

    One approach for your scenario would be to change a property of a control on your client in order to be able to determine whether the serverside OnUpdateCellBatch code is to be executed.

    I am attaching such a sample where the text of a text area is modified on a client button click.  Based on the textAreas' text value  the cell update method code may be skipped. The sample uses the Northwind DB.

    Please tell me if this helps.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://es.infragistics.com/support

     

     

    UltraWebGridOnUpdateCellBatch.zip
Children