473,473 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can CompareValidator be used to compare cells in a gridview?

Is it possible to have a CompareValidator to compare values from two cells
in a gridview row? I'd like to do that while in edit mode.
Thanks,
Bogdan
Jun 27 '08 #1
2 3332
You'd need to have controls such as TextBoxes in the <EditItemTemplatewith
explicit ID as you need to assign the IDs to the validator so that it knows
which controls to compare/validate. And the validator must also exist in the
template, otherwise it cannot "see" the validated controls as they'd be in
different naming container. But that way it basically is possible.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"bogdan" <bo****@comany.comwrote in message
news:uj**************@TK2MSFTNGP06.phx.gbl...
Is it possible to have a CompareValidator to compare values from two cells
in a gridview row? I'd like to do that while in edit mode.
Thanks,
Bogdan


Jun 27 '08 #2
Thanks for the reply.

Do the controls to be validated have to be within the same
<EditItemTemplate>? If yes, then this would mean that they would have to
belong to the same gridview column, correct? So, I can't really have a
comparevalidator to span columns, can I?

Thanks,
Bogdan

"Teemu Keiski" <jo****@aspalliance.comwrote in message
news:ut**************@TK2MSFTNGP03.phx.gbl...
You'd need to have controls such as TextBoxes in the <EditItemTemplate>
with explicit ID as you need to assign the IDs to the validator so that it
knows which controls to compare/validate. And the validator must also
exist in the template, otherwise it cannot "see" the validated controls as
they'd be in different naming container. But that way it basically is
possible.

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"bogdan" <bo****@comany.comwrote in message
news:uj**************@TK2MSFTNGP06.phx.gbl...
>Is it possible to have a CompareValidator to compare values from two
cells in a gridview row? I'd like to do that while in edit mode.
Thanks,
Bogdan



Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Axel Dahmen | last post by:
Hi, I've got the same problem as described below. No answer found yet. Can someone please help? (I'm using .NET 1.0 on my development machine and 1.1 on my webserver. Like Susanna, I only get...
1
by: Joe | last post by:
Hello, I am new to asp.net. I have created a login page using dotnet. I am using CompareValidator but noticed that when I click on View Source in the browser I see the value assigned to...
2
by: Eric Maia | last post by:
I have a textbox (StartDateTextBox) in a UserControl on my page, that is supposed to have a date entered into it. I have a RequiredFieldValidator that has its ControlToValidate property set to the...
4
by: MattB | last post by:
I have a page that has gone through a lot of editing. It has many text box and validator controls, and one compare validator just isn't working. I have the control to validate set, and control to...
1
by: jobs | last post by:
Can somebody tell me why Jobno and Value BoundFields are not available during the command SaveParm ? i enter text into the box for Value and hit the Save button, but all I see is the Parmvalue. ...
2
by: desinerd | last post by:
Hi All. I am using a GridView to List contacts linked to a logged in User. I can successfully bind the Gridview with a DataTable. And the values in the GridView are correctly displayed. I...
1
by: mghihor | last post by:
Dear GridView Experts! I have problems with GridView when adding a column using TemplateField. I fill GridView1 from a stored procedure. It has a Select statement and returns 14 columns,...
5
by: Chris | last post by:
Hi, i want to make the forecolor of values into a gridview red but only when they equals 'n'. <asp:GridView ID="GridView1" runat="server" DataKeyNames="hour,place"...
0
by: edurazee | last post by:
I am able to create BoundFields and Footer-rows dynamically like this in my GridView: protected void Page_Load(object sender, EventArgs e) { CreateGridView(); ...
0
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
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.