Home All Groups Group Topic Archive Search About

GridView... RowUpdating event not firing....

Author
18 Dec 2006 4:29 PM
Jim Butler
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]

Author
19 Dec 2006 3:02 AM
Walter Wang [MSFT]
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.
Author
20 Dec 2006 2:15 AM
Jim Butler
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.
>
Author
21 Dec 2006 3:04 AM
Walter Wang [MSFT]
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.
Author
13 Feb 2007 2:09 AM
kyle
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?
Author
13 Feb 2007 3:56 AM
kyle
On Dec 20 2006, 10:04 pm, waw***@online.microsoft.com (Walter Wang
[MSFT]) wrote:
Show quoteHide quote
> Hi Jim,
....
> 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 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
Author
21 Dec 2006 5:22 AM
Walter Wang [MSFT]
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.
Author
26 Dec 2006 2:17 PM
Jim Butler
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.
>
Author
30 Jan 2007 4:31 PM
thiru
Hi,

Really, Its helped me alot.
For time being I have used CauseValidation = false. Works fine now.

Thanks a lot.

Thiru.