473,403 Members | 2,183 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,403 software developers and data experts.

Validations for controls on a panel not firing???

I am having problems with controls on a panel not firing. The controls that
are directly on the form will validate, but the controls on the panel will
not validate.

I have the AutoValidate property for the form set to EnableAllowFocusChange
and then I call the ValidateChildren method when the save button is clicked.
If I cannot get the form to validate the controls, can I loop through each
control and call the validate event?

Thanks

private void toolStripReviewActionItemsSaveItem_Click(object sender,
EventArgs e)

{

// Validate all of the children controls

// If any controls fail validation then show message box and return

if (!this.ValidateChildren(ValidationConstraints.Enab led))

{

// At least one of the controls failed validation

MessageBox.Show(

"Please correct the data and attempt the save again.",

this.Text + " - Invalid Data",

MessageBoxButtons.OK,

MessageBoxIcon.Error,

MessageBoxDefaultButton.Button1);

// Return from the form and correct the bad data

return;

}

// Validation was successful so save the dataset to the database

doActionItemsSaveRecord();

// Disable the controls that are used to add or edit records

disableActionItemsAddEdit();

}
May 30 '07 #1
0 1199

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

Similar topics

2
by: theComputer7 | last post by:
I cut down the code to make this half way understandable... I have read Data Grid girls caution about over use of dynamic controls. I truly believe what I am doing requires dynamically inserted...
9
by: David | last post by:
hello... i want to renove all controls from panel... i use this: foreach (Control c in panel.Controls) panel.Controls.Remove(c); but it's doesn't work... -- not all controls are removed...
2
by: Avad | last post by:
I have a following screen. The login is a "user control" with validations controls in it. This side I have address book in which "name" is required field. But when I click on "add new user" the...
4
by: Keith Patrick | last post by:
I'm running into a wall with a custom control that gets populated via asynchronous I/O. Basically, my control takes its datasource and renders some controls that have events (OnClick). However,...
10
by: Robert | last post by:
I have created an array of panels (dim panels(100) as new panel). I've succesfully loaded them on the form. What code should I write in order to have acces to the mouseover event for each of the...
1
by: Rajani | last post by:
Hi, I have designed a form which process database Insert, edit and Delete(datagrid). I input userid,password and privilege in textboxes which has validation controls to verify data keyed in....
2
by: Rajani | last post by:
Hi, I have designed a form which process database Insert, edit and Delete(datagrid). I input userid,password and privilege in textboxes which has validation controls to verify data keyed in....
1
by: ThunderMusic | last post by:
Hi, In a page, I dynamicly generate a table in which there are ImageButtons... When the table is first loaded, it's fine, but as soon as the table is modified, the events are not fired until the...
0
by: RTT | last post by:
Hi, I wonder if anyone can help me before I spend any more hours trying to fix this. Some of my controls, specifically databound drop down lists and buttons that use values in the lists to display...
5
by: vidishasharma | last post by:
Hi, I have a windows from with few controls over it. Now I have to see if the cursor goes outside the bounds of the windows form then I have to close the form. I added mouse leave for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...
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
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.