473,382 Members | 1,302 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,382 software developers and data experts.

ASP.NET User control in Datagrid Footer

Hi,
I use the asp.net datagrid footer to add new records. In the footer I
use a web user control to read a date. it is made of a text box, a required
field validator and a compare validator. When the grid is in edit mode I
hide the footer. The problem is when the datagrid footer is hidden the
required field validator of my user controls fails validation even though
the control is hidden. I am totally confused with this any help is greatly
appreciated.

Thanks
Chamindu
Nov 18 '05 #1
5 4940
Disable the validation controls whenever your user control is hidden
(Enabled = false).

HTH,

--
Scott
http://www.OdeToCode.com

On Fri, 9 Jan 2004 11:54:24 +0600, "Chamindu R Munasinghe"
<ch******@hsenid.lk> wrote:
Hi,
I use the asp.net datagrid footer to add new records. In the footer I
use a web user control to read a date. it is made of a text box, a required
field validator and a compare validator. When the grid is in edit mode I
hide the footer. The problem is when the datagrid footer is hidden the
required field validator of my user controls fails validation even though
the control is hidden. I am totally confused with this any help is greatly
appreciated.

Thanks
Chamindu


Nov 18 '05 #2
Do this... if your validation control is called
myValidator, myValidator.Enabled = false.

This should disable the validation control

Regards

Michelle
-----Original Message-----
Hi,
I use the asp.net datagrid footer to add new records. In the footer Iuse a web user control to read a date. it is made of a text box, a requiredfield validator and a compare validator. When the grid is in edit mode Ihide the footer. The problem is when the datagrid footer is hidden therequired field validator of my user controls fails validation even thoughthe control is hidden. I am totally confused with this any help is greatlyappreciated.

Thanks
Chamindu
.

Nov 18 '05 #3
> Disable the validation controls whenever your user control is hidden
(Enabled = false).


indeed that's the trick, but it's very annoying unfortunately, in fact I
consider that behaviour a bug

an invisible validator should be a disabled validator (since if you just
wanted it to not show text but show it at the validation summary, you'd set
text=" " [a space char] and errormessage="something")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <bi******@kagi.com>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.................................................. .......................
Nov 18 '05 #4
I see your point, but I think a control's visibility and a control's
enabled / disabled state shouldn't be tied together. Think of a user
filling out an information form on a tabbed dialog. Not all of the
controls are visible at the same time but they all need to be
validated and stored.

On Fri, 9 Jan 2004 19:31:55 +0200, "George Birbilis"
<bi******@kagi.com> wrote:
Disable the validation controls whenever your user control is hidden
(Enabled = false).


indeed that's the trick, but it's very annoying unfortunately, in fact I
consider that behaviour a bug

an invisible validator should be a disabled validator (since if you just
wanted it to not show text but show it at the validation summary, you'd set
text=" " [a space char] and errormessage="something")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <bi******@kagi.com>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
................................................. .......................


--
Scott
http://www.OdeToCode.com
Nov 18 '05 #5
George,

This indeed is a bug. I reported it to Microsoft a few months ago and worked
with them to get it into their bug database. They will be considering it for
ASP.NET 2.0. (Read: its not guaranteed to get fixed.)

The datagrid has several bugs like this. Each of them calls the OnPreRender
method of the control but not the Render method when the containing area is
invisible. This causes problems when client-side code is output. That
happens in OnPreRender in validators and many third party controls. The
javascript is expecting to run on HTML that was output by Render. The HTML
isn't there. There are JavaScript errors.
You will find this bug:
- In the header when ShowHeader is false
- In the footer when ShowFooter is false
- In a column whose Column.Visible property is false.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com

"George Birbilis" <bi******@kagi.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Disable the validation controls whenever your user control is hidden
(Enabled = false).
indeed that's the trick, but it's very annoying unfortunately, in fact I
consider that behaviour a bug

an invisible validator should be a disabled validator (since if you just
wanted it to not show text but show it at the validation summary, you'd

set text=" " [a space char] and errormessage="something")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <bi******@kagi.com>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.................................................. ......................

Nov 18 '05 #6

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

Similar topics

10
by: Alphonse Giambrone | last post by:
I have a web form with 2 user controls on it (UC1 and UC2). Each control has a bound datagrid with textboxes in the footer to add a new row. There are also requiredfieldvalidators in each footer....
4
by: Kaung Htut O via DotNetMonster.com | last post by:
Hi to all Is there a way to access Datalist Footer's Control properties from outside of datalist event. Pls note that I mean not a datagrid, only for datalist. Thanks Kaung Htut Oo
0
by: Zi | last post by:
I have a user control within a data grid. I am binding the user control to one of the values from the data grid. The data grid implements paging. It is all working ok for the first page but once i...
2
by: Ali | last post by:
I am adding a DropDownList control to my DataGrid footer template. I load my DropDownList using a function that returns an arrayList. I can see all my items in the DropDownList, but when I select...
2
by: Sebastian | last post by:
Hi, I have datagrid. In its footer there is editbox to add new item. All is cool. Datagrids 'Delete' button has CausesValidation set to false and all is great. But the problem is in 'Process'...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
2
by: tshad | last post by:
This is related to my other Hiding datalistitems problem that I can't seem to solve. I have tried different methods which all seem to work only partially. I decided to try to use a User...
0
by: Mitkip | last post by:
Does someone know how can I make a user control which allow me to customize it like a datagrid or a repeater ... For example, I would like to call my control in an aspx page like this : <%@...
5
by: Annie | last post by:
hello guys, I have a scenario that I am confused about ... I have a number of pages which are using a Master page ... Then I have seperate Footer user control that can reside in master page...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.