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
731
AfterExitEditModeHandler problem...
posted

i am using following code....

if(!ispostback())

UltraWebGrid1.DisplayLayout.ClientSideEvents.AfterExitEditModeHandler = "AfterExitEditModeHandler";

loadgrid()

after that on button click i am loading the grid also but in load grid i have written

UltraWebGrid1.Rows.Clear();

UltraWebGrid1.Columns.Clear();

before to load the grid with dynamic columns  first time handler works fine but on clicking on button it does not can any one guide which thing is missing in my code???

  • 45049
    posted

    You likely need to set this property during all postbacks, not just initial load.  I'm not sure if this property is stored in ViewState; if you have ViewState turned off, then you definitely need to set it each time.

    Test to see if moving your setting of the AfterExitEditModeHandler porperty out of the "if(!ispostback())" condition helps.  This property "sets" the handler, rather than "adding" a new handler to the event, so it won't cause your event handler to be raised multiple times even if you set the property multiple times.