Asp net gridview rowupdating firing twice
I'm writing a custom control that will automatically wrap controls in an Update Panel dynamically at run-time. // You can try Auto Generating the select and delete buttons to see the grid exhibit different behaviour // too.
I've written a quick tutorial on my blog: am having somewhat of a challenge though. Can anyone offer help, or have you seen the problem yourself? The comments are in there to illustrate the problems I'm having. Drop a Grid View on the page, set the Auto Generate Edit button to true and paste the rest of the code here over the contets of the cs code-beside page.
I don't know how many controls do I have to create and I don't know what kind of control will it be. I know that the problem is that I create the controls in the Page_Load.
What happens with this is that the source is being created every time the user submits the page.
After it has been clicked the postback places that row in edit mode. At this point in time the above Edit Item Template is displayed with two Image Buttons within it. My problem lies in that the click on the Update Image Button posts back, but neither the Row Command nor Row Updating events get triggered.
I have set the requisite attributes in the Grid View tag.
In the Row Command method of the Grid View, I have the following attribute definition: With CType(Edit Control, Text Box). Specifically, the Row Updating method of the Grid View doesn't fire. If I am correct, you'll see a pesky error saying something along the lines of, "What the hell is rowupdating??
I used to have this Grid View control connected to a Sql Data Source with the Update Command property defined, and then Grid View_Row Updating would fire. " What do you mean, "get Row Updating to fire without the Sql Data Source"?
Even comments about manipulating the page controls collection from within a custom control on the page - am I breaking best practice here? Then When i add new row or column at runtime ,then that newly add cell also contain control. good day to all, i'm also having the problem of the Grid View1_Row Updating event not firing... the gridview is inside an update panel and the columns are generated in code behind...
When I take a standard Grid View, bind it to a Data Table and dynamically wrap it in an Update Panel at run-time, the Row Updating event stops firing my handler.
all of the other events are firing except the Row Updating event..
This means that when the user does an update, the data from that update is lost.
But I think I can´t avoid to do this, because if I don't, the runtime created controls fade away.