473,408 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

how to connect a validator programmatically to a bound datagrid



Everyone--

I have a DataGrid that is bound at run-time.

Upon the click of the Add, a new row is added to the top and it has several
types of controls, (but, it is not permissible to use the built-in editing
functionality of the DataGrid).

The DataGrid is bound.

Now, the user fills out the controls and clicks Save at which point I need
to validate.

However, the ReqFieldValidator controls cannot be bound to the controls
they should because sometimes the grid is empty to begin with.

Therefore, I have a placeholder which is loaded programmatically with a
ValidationSummary control and several validation controls.

The problem is that the page is choking on trying to set the
controlToValidate property. Somehow, it cannot find the control it has to
bind, even though it is in the Declarations section and on the ASPX page.

I think this is because it is part of an itemTemplate, but I don't know for
sure.

So, how can this be done programmatically?

(The run-time engine will not allow it if I try to add the
ReqFieldValidators to the ASPX page and set their ControlToValidate
property to a control in an ItemTemplate-- it cannot find the control.)

Any ideas are welcome.

Thank you.

--Mark

Nov 17 '05 #1
0 1331

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

Similar topics

4
by: Aaron Ackerman | last post by:
I am using typed datasets in an N-Tier Windows app using VB.NET. I know this posting cannot be fully explained in a single post that is why I am asking for someone to point me to a real world...
2
by: Nicole | last post by:
I am creating template columns programmatically. I have read the msdn article on this and I'm so close. Article:...
18
by: Julia Hu | last post by:
Hi, I have a datagrid, and in different rows I need to programmatically bind different type of controls and load data into these controls. For example,in the first row I need to bind data into a...
2
by: JenC | last post by:
Hi, I need to add columns programmatically to a datagrid I have on my ASP page. I have approx 6 bound columns and I would like to add a few columns dynamically. Basically they are calculated...
1
by: Jay | last post by:
I'm wondering if anyone has even encountered a control or other scripting that will automatically rotate the rows of a datagrid... I am in the process of building an asp.net application that will...
3
by: Dave | last post by:
Is it possible to remove a row in a datagridview programmatically? If so, what is the code? Thanks -- L. A. Jones
3
by: Rich Squid | last post by:
Hello Here's my basic problem: On my asp.net form page I have a DetailsView (default mode=edit) bound to a AccessDataSource control. Users can successfuly update a databound template field,...
2
by: daft | last post by:
Hi guys Following on from an issue a couple of years back, now archived: http://www.thescripts.com/forum/thread208561-tabledef.connect.html I'm having the same problems. I can update the...
0
by: TonyJ | last post by:
Hello! I'm unsure when I can use a bound datagrid and when I can't. What limitations has a bound datagrid? 1. For example if I want to manipulate the data in the datasource before displaying...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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,...
0
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...

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.