Featured post
asp.net - GridView PreRender not firing after RowDeleted -
when deleting gridview row in ui (via linkbutton commandname="delete"), view not automatically refresh , continues display deleted row until take other action (manually refresh page, navigate away , again, etc).
in debugger, see row deleted, , both rowdeleting , rowdeleted events fire, gridview's prerender event not fire afterwards (in contrast, prerender event does fire when first loading page, when adding new row, etc).
i've used gridviews in similar configurations without having problem, don't see obvious differences. seems process aborting before prerender event, no exceptions being thrown, , stepping off end of rowdeleted event in debugger brings me ui though process completing normally.
any ideas should trouble or solution? other possibly-relevant details: gridview bound sqldatasource; data source not declare deletecommand; handle deletion calling stored procedure in rowcommand handler, after rebind gridview databind(), @ point can see gridview's rows.count has decreased 1 i'd expect. seems fine through rowdeleted event, then... nothing!
update: tried calling sp delete in rowdeleting handler rather rowcommand handler... made no difference. row still deleted processing terminates without calling gridview's prerender, , deleted row left on display until further ui interaction updates view.
update2: i'm not getting page's prerender event, precedes control prerender events. continue working backwards see if can find things halting, since stepping out of rowdeleted event seems end of line...
update3: i've been poking around more and, although complicates code, able things working declaring deletecommand in gridview's sqldatasource simple row (record) deletion, , in rowdeleted handler calling additional stuff had in stored procedure needs happen along primary deletion. while it's less convenient having primary deletion in 1 place , related processing in another, @ least it's working.
but don't know conclude this: deletecommand needed proper page life cycle? 1 shouldn't deletion in stored procedure in rowcommand handler? else? wish identify what, specifically, broken initial attempt...
just bind gridview fresh data database after deleting row.
- Get link
- X
- Other Apps
Comments
Post a Comment