473,494 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datagrid, validation and scroll position...

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
3 2986
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1647
by: Frnak McKenney | last post by:
I have a (small) multi-table database application which allows edits, print reports, and has two scrolling screen displays which show information merged from multiple tables. I'm having trouble...
3
6803
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
7
1991
by: EMW | last post by:
I have used the info on this page to create a scrollable datagrid. http://www.datawebcontrols.com/faqs/CustomizingAppearance/ScrollableDataGrid.shtml But now everytime after a postback the...
6
1998
by: Paul | last post by:
not sure if I should post this in the web controls newsgroup but just wondering if there is a way to limit the size of a datagrid and instead of cutting dat off the user will have a scroll down bar...
2
1723
by: Carlo Marchesoni | last post by:
I have an editable Datagrid and memorize its datasource with a Session variable. On each Page_Load I simply Bind the Datagrid. Everything works fine. The problem comes, when I have a lot of...
0
1215
by: Jeremiah Adams | last post by:
I am having two issues with the Datagrid and I hope that someone can help me out with them. 1) Printing. I pulled the code for sending the control to a printer off the msdn site. It works for...
0
1044
by: Grant Smith | last post by:
I've been creating my own datagrid control which I'm inheiriting from the standard datagrid control and I have come across two very interesting behaviors with the datagrid control. 1. If you...
0
1681
by: jasondavidcarr | last post by:
Hello all, I have a "comments" page that contains three sections; the article to be commented on is on top, followed by previous comments, and on the bottom a place to add new comments. It's a...
1
2567
by: daveh551 | last post by:
I have a web page with an address entry form and some other things on it. The form has field validators on several of the fields, and a validation summary at the bottom. Because of the size of...
0
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.