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

Delete a control from a User control?

I have a user control that gets dynamically added to a page. It has a
couple of validators that I programmatically set properties for. All of
this works, but my problem is:
When not in use, I make validators Visible property = False
But the validators still take up space on the page, shifting other
elements if they wrap, etc.

Can I just delete the validator control from the user control? I fished
around the me.Controls collection a little but couldn't see a way to do
it. If you have any suggestions, I'd love to hear them!

Thanks!

Matt
Feb 3 '06 #1
2 914
Set the Display property to ValidatorDisplay.None

-Brock
http://staff.develop.com/ballen

I have a user control that gets dynamically added to a page. It has a
couple of validators that I programmatically set properties for. All
of
this works, but my problem is:
When not in use, I make validators Visible property = False
But the validators still take up space on the page, shifting other
elements if they wrap, etc.
Can I just delete the validator control from the user control? I
fished around the me.Controls collection a little but couldn't see a
way to do it. If you have any suggestions, I'd love to hear them!

Thanks!

Matt

Feb 3 '06 #2
Brock Allen wrote:
Set the Display property to ValidatorDisplay.None

-Brock
http://staff.develop.com/ballen

I have a user control that gets dynamically added to a page. It has a
couple of validators that I programmatically set properties for. All
of
this works, but my problem is:
When not in use, I make validators Visible property = False
But the validators still take up space on the page, shifting other
elements if they wrap, etc.
Can I just delete the validator control from the user control? I
fished around the me.Controls collection a little but couldn't see a
way to do it. If you have any suggestions, I'd love to hear them!

Thanks!

Matt



What is this a property of? The page? The User Control?
I didn't see it I still have another validator I want to use (Required
field) and I just want the RegEx validator to go away.
Thanks for the reply!

Matt
Feb 3 '06 #3

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

Similar topics

4
by: Timothy Madden | last post by:
Hello Is my program legal and well formed: class Data; class SMax { class Data &Buffer; public: SMax(class Data &buffer)
9
by: Melissa | last post by:
What is the code to delete a command button from a form? Can the code be run from the click event of the button to be deleted? Thanks! Melissa
3
by: Ryan Liu | last post by:
Hi there, I got a NullReferenceException when delete last row in a datagrid. I had hard time to solve since it does not occur in my own code. I put a datagrid in my inherited user control,...
3
by: Dave | last post by:
How can I add the confirmation dialog on record delete to the "Delete" command column in DataGrid control?
3
by: vcornjamb | last post by:
Hello, I am developing a web form that contains some buttons and a data grid which has as its last column link buttons that will delete the data associated with that row. Everything works fine,...
4
by: DrData | last post by:
I'm working on an ASP.Net application written in C#. On one page, there are several datagrid controls used to display, edit and delete detail records relating to the master record also displayed on...
9
by: Woody Splawn | last post by:
On a winform, how do I trap for the user pressing Control Delete? I thought perhaps something like the following in the keydown event of the grid, but the code below does not work. If e.KeyCode...
3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
11
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.