473,769 Members | 6,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4957
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******@hseni d.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.Ena bled = 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="s omething")

~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~
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="s omething")

~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~
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****@PeterBlu m.com

"George Birbilis" <bi******@kagi. com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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="s omething")

~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~
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
3181
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. When I try to add a new row to UC1 the requiredfieldvalidators for UC2 fire and therefore the page is not posted. If I remove one control, everything works fine. I have 2 questions. 1. How can I get the validators for each control to only...
4
5481
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
1936
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 page to the second page of the datagrid, the user contorl stops working correctly (displaying the correct data). I have attached the code that is envolved. Thanks a lot
2
2049
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 an item from the list, I am unable to trap the DropDownList SelectedIndexChanged event. This is a snippet of my DataGrid: <asp:TemplateColumn> <ItemTemplate> <%# DataBinder.Eval(Container.DataItem, "State") %>
2
423
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' page button. ('Process' button saves all data on the page to database). When I click 'Process' button datagrids footer textbox are being validated and becouse they are empty error message pops up. I don't want to set CausesValidation to false for...
9
5066
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: ******************************************************************************* <asp:DataGrid visible="False" border=1
2
3233
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 Control (which I'm sure is not done correctly) and get errors as I try to execute it. What I want to do is take all the data from between the ItemTemplate tags and put a control there. The I hope to be able to hide all the user
0
1018
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 : <%@ Register TagPrefix="TAG" TagName="MyUserControl" Src="~/ascx/myUC.ascx" %> <TAG:MyUserControl runat="server"> <Header>
5
1420
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 or could be kept in the content pages (still not confirmed and looking for any suggestion)
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7409
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3562
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.