By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,364 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,364 IT Pros & Developers. It's quick & easy.

Datagrid, validation and scroll position...

P: n/a
Ben
Hi, I have a page with a datagrid that you have to scroll to see. I'm using
the StrengthControls SmartScroller as recommended to maintain my scroll
position.

Anyway, inside the datagrid I have fields that require validation. No
problem, I put the validators on them and they work just fine... Except for
the fact that when a user has an invalid entry and fires a validation event
client side the scroll position is reset to the top of the page...

I tried disabling client script and validating server side only, but the
validators inside the datagrid don't see to fire server side...

Any ideas?

Thanks,
Ben

Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Ben,

As for the Validation Control for the nested entry fields in DataGrid's
columns problem, this does be a normal behavior when we use validation
control in the sub container of a template databound control. Such as
DataGrid, DataList or Repeater, these template databound controls has no
design-time defined nested child controls. Their sub controls are
dynamically generated via the datasource bound to it. And each child
control's id will have a index number at the end of it. So the serverside
validation will not work for such scenario. And we need to use clientside
script to perform the validation.

In addition, as you mentioned that when you use clientside validation, the
postiion of the page will auto reset to top of the page after the client
validation occur. But based on my test( I use a RequiredFieldValidator) ,
the page will remain the position where the RequiredFieldValidator located.
Have you used a ValidationSummary control? Maybe it will be the cause of
the problem.
Anyway, if you have anyother findings or ideas, please feel free to post
here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2

P: n/a
Ben
I am using a validation summary. It seems like the only 'presentable' way
to display an error message with any information when you have a problem
inside a datagrid.
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:Wr**************@cpmsftngxa06.phx.gbl...
Hi Ben,

As for the Validation Control for the nested entry fields in DataGrid's
columns problem, this does be a normal behavior when we use validation
control in the sub container of a template databound control. Such as
DataGrid, DataList or Repeater, these template databound controls has no
design-time defined nested child controls. Their sub controls are
dynamically generated via the datasource bound to it. And each child
control's id will have a index number at the end of it. So the serverside
validation will not work for such scenario. And we need to use clientside
script to perform the validation.

In addition, as you mentioned that when you use clientside validation, the
postiion of the page will auto reset to top of the page after the client
validation occur. But based on my test( I use a RequiredFieldValidator) ,
the page will remain the position where the RequiredFieldValidator located. Have you used a ValidationSummary control? Maybe it will be the cause of
the problem.
Anyway, if you have anyother findings or ideas, please feel free to post
here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Nov 18 '05 #3

P: n/a
Hi Ben,

Thanks for your response. En, the Validation Summury is a good one to
display the validation errors on the webform. However, I think it is also
the cause of the problem that the page will reset to the validationSummary
's position after the validation, do you think so?
And based on my test, if I don't use validationSummary, just let the
validatoin control itself display error message, when the validation error
occurs, the page's position will remain at the validation control which is
displaying the error. I tested use the RequiredFieldValidator control (Put
it in a datagrid's cell and together with another textbox).

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.