Adam Sills
2007-09-10 15:29:54 UTC
I think most people (myself included) would like to skip validation because
typically the Delete button should avoid all input validation that is
associated with the current editing row (since you're deleting the row
anyway).
Adam..
-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Mark Brackett
Sent: Monday, September 10, 2007 9:38 AM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] GridView and Page.IsValid
The GridView seems to check Page.IsValid before handling an Update
(reflected C#):
private void HandleUpdate(GridViewRow row, int rowIndex, bool
causesValidation) {
if ((!causesValidation || (this.Page == null)) ||
this.Page.IsValid) {
// ... do update to datasource ... //
}
}
But not on Delete. It calls Page.Validate() in bool
HandleEvent(EventArgs e, bool causesValidation, string validationGroup),
but only actually checks Page.IsValid in HandleUpdate(). Personally, I
think it should be checking IsValid on both Delete and Edit commands at
a minimum....
This seems like a huge oversight to me - is everyone hooking a handler
to GridView.RowDeleting and setting e.Cancel = !IsValid?
===================================
This list is hosted by DevelopMentor� http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
typically the Delete button should avoid all input validation that is
associated with the current editing row (since you're deleting the row
anyway).
Adam..
-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:DOTNET-***@DISCUSS.DEVELOP.COM] On Behalf Of Mark Brackett
Sent: Monday, September 10, 2007 9:38 AM
To: DOTNET-***@DISCUSS.DEVELOP.COM
Subject: [DOTNET-WEB] GridView and Page.IsValid
The GridView seems to check Page.IsValid before handling an Update
(reflected C#):
private void HandleUpdate(GridViewRow row, int rowIndex, bool
causesValidation) {
if ((!causesValidation || (this.Page == null)) ||
this.Page.IsValid) {
// ... do update to datasource ... //
}
}
But not on Delete. It calls Page.Validate() in bool
HandleEvent(EventArgs e, bool causesValidation, string validationGroup),
but only actually checks Page.IsValid in HandleUpdate(). Personally, I
think it should be checking IsValid on both Delete and Edit commands at
a minimum....
This seems like a huge oversight to me - is everyone hooking a handler
to GridView.RowDeleting and setting e.Cancel = !IsValid?
===================================
This list is hosted by DevelopMentor� http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com