|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GridView... RowUpdating event not firing....All,
For the life of me, i can't determine why the event isn't firing... I have attached a simple repro and sure it must be something simple... Thanks for all the help, jim [attached file: WebSite1.zip] Hi Jim,
There's an error when you click the Update command; try to remove the 'EnableEventValidation="false"' or set to "true" in your aspx @ Page directive and you will see the error. However, this error is strange for such a simple updating scenario. Also, if we change the ButtonType of CommandField to "Link", the event works correctly (change to "Button" also doesn't work). This will need further investigation. I'll keep you updated as soon as possible. Thank you for your patience and understanding. Sincerely, Walter Wang (waw***@online.microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. If you are using Outlook Express, please make sure you clear the check box "Tools/Options/Read: Get 300 headers at a time" to see your reply promptly. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Thanks for the info Walter, i put the enableeventvalidation in there and set
it to false to see what the problem was with the post... I didn't see anything crazy, but decided for now to set it to false so i could move on and fix later. If you could figure out what is wrong with the post two, that would be a double bonus and save me from posting that next.... anyway, thanks for the response and look forward to hearing the solution (unfortunately those graphics/ui guys want to make these grids eye appealing with our icons for editing/updating/saving/canceling and so on.... jim Show quoteHide quote "Walter Wang [MSFT]" <waw***@online.microsoft.com> wrote in message news:bIUXroxIHHA.2300@TK2MSFTNGHUB02.phx.gbl... > Hi Jim, > > There's an error when you click the Update command; try to remove the > 'EnableEventValidation="false"' or set to "true" in your aspx @ Page > directive and you will see the error. > > However, this error is strange for such a simple updating scenario. Also, > if we change the ButtonType of CommandField to "Link", the event works > correctly (change to "Button" also doesn't work). This will need further > investigation. I'll keep you updated as soon as possible. Thank you for > your patience and understanding. > > > Sincerely, > Walter Wang (waw***@online.microsoft.com, remove 'online.') > Microsoft Online Community Support > > ================================================== > Get notification to my posts through email? Please refer to > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif > ications. If you are using Outlook Express, please make sure you clear the > check box "Tools/Options/Read: Get 300 headers at a time" to see your > reply > promptly. > > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues > where an initial response from the community or a Microsoft Support > Engineer within 1 business day is acceptable. Please note that each follow > up response may take approximately 2 business days as the support > professional working with you may need further investigation to reach the > most efficient resolution. The offering is not appropriate for situations > that require urgent, real-time or phone-based interactions or complex > project analysis and dump analysis issues. Issues of this nature are best > handled working with a dedicated Microsoft Support Engineer by contacting > Microsoft Customer Support Services (CSS) at > http://msdn.microsoft.com/subscriptions/support/default.aspx. > ================================================== > > This posting is provided "AS IS" with no warranties, and confers no > rights. > Hi Jim,
Thank you very much for your follow-up. Yes we've confirmed this is an issue with the GridView. We're very sorry for the inconvenience. I've created a simplified reproducible webform: ================ <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Page_Load(object sender, EventArgs e) { BindGrid(); } private void BindGrid() { System.Data.DataTable dt = new System.Data.DataTable(); dt.Columns.Add("Name"); dt.Rows.Add("T1"); dt.Rows.Add("T2"); GridView1.DataSource = dt; GridView1.DataBind(); } protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { GridView1.EditIndex = e.NewEditIndex; BindGrid(); } protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { Response.Write("RowUpdating"); } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:GridView AutoGenerateColumns="false" ID="GridView1" runat="server" OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating"> <Columns> <asp:CommandField ShowEditButton="true" ButtonType="Button" /> <asp:CommandField ShowEditButton="true" ButtonType="Link" /> <asp:TemplateField> <ItemTemplate> <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox> </EditItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </div> </form> </body> </html> ================ The Update works for the Link instead of the Button (or Image). I've reported this issue to our product team, hopefully it will be fixed in future versions. If this issue is critical for your project, I suggest you contact PSS for more information. Again, thank you for your feedback and understanding! Regards, Walter Wang (waw***@online.microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Walter,
I had the same issue except my validation WAS working fine until I made a minor change in my code-behind. Then, without warning, NOTHING happened when I clicked the "Update" button. In search of a solution, I found your posting. Yes, turning off "CausesValidation" did in fact work. However, the validation I needed is mission-critical so I kept trying. On a whim, I went into the ASPX source code and changed my <asp:Button> attributes... WAS: <asp:Button ID="cmdGVUpdate" runat="server" CausesValidation="true" CommandName="Update" Text="Update" ToolTip="Update" /> CHANGED TO: <asp:Button ID="cmdGVUpdate" runat="server" CommandName="Update" CausesValidation="true" Text="Update" ToolTip="Update" /> Somehow (and it seems REALY flakey as to why), by changing the position of "CausesValidation" attribute AFTER the "CommandName" attribute, my validation started working again....weird. The next day, with no changes at all, the validation quit work again! Where can I turn for some help on this? On Dec 20 2006, 10:04 pm, waw***@online.microsoft.com (Walter Wang
[MSFT]) wrote: Show quoteHide quote > Hi Jim, Walter,.... > The Update works for the Link instead of the Button (or Image). > > I've reported this issue to our product team, hopefully it will be fixed in > future versions. > > If this issue is critical for your project, I suggest you contact PSS for > more information. > > Again, thank you for your feedback and understanding! > > Regards, > Walter Wang (waw***@online.microsoft.com, remove 'online.') > Microsoft Online Community Support > > ================================================== > When responding to posts, please "Reply to Group" via your newsreader so > that others may learn and benefit from your issue. > ================================================== > > This posting is provided "AS IS" with no warranties, and confers no rights. I posted a reponse to this thread earlier explaining my problem. As I re-read your note above, I notice that you say, "If this issue is critical for your project, I suggest you contact PSS for more information." My issue IS a mission-critical one that is of the upmost importance. Who is PSS, and how do I contact them? Regards, Kyle Peters Hi Jim,
I've found a workaround, for ButtonType="Image" or ButtonType="Button", you will have to turn off CausesValidation: <asp:CommandField ShowEditButton="true" ButtonType="Image" CausesValidation="false" ... Hope this helps. Regards, Walter Wang (waw***@online.microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== When responding to posts, please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Walter,
Thanks for the workaround, i just got back from some time off. The workaround works perfectly. thanks again, jim Show quoteHide quote "Walter Wang [MSFT]" <waw***@online.microsoft.com> wrote in message news:LGtSSAMJHHA.2300@TK2MSFTNGHUB02.phx.gbl... > Hi Jim, > > I've found a workaround, for ButtonType="Image" or ButtonType="Button", > you > will have to turn off CausesValidation: > > <asp:CommandField ShowEditButton="true" ButtonType="Image" > CausesValidation="false" ... > > > Hope this helps. > > Regards, > Walter Wang (waw***@online.microsoft.com, remove 'online.') > Microsoft Online Community Support > > ================================================== > When responding to posts, please "Reply to Group" via your newsreader so > that others may learn and benefit from your issue. > ================================================== > > This posting is provided "AS IS" with no warranties, and confers no > rights. > Hi,
Really, Its helped me alot. For time being I have used CauseValidation = false. Works fine now. Thanks a lot. Thiru.
No open/save prompt
Required multiple instances of a UserControl loaded at runtime Wizard.FinishButtonClick - launch browser AND redirect Return Values from Popup to UserControl How can I send shell-commands to the web-server in webcontrols? Keeping 2 user controls of the same class synced How to close multiple web pages data field - change true/false to Yes/No ObjectDataSource TableAdapters Point-N-Click HELL How to create Treeview in ASP.Net 1.1? |
|||||||||||||||||||||||