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

RadioButton Change validation

Hi
I have 2 radio buttons and want to perform some kind of validation before I
allow the checked state to move from one to another. I tried overriding the
validating callback but I noticed that it is called when loosing focus and
that is not good enough because I need to know when one radio button is
checked.
The only way I found is to create a class deriving from RadioButton and I
override the OnClick event. I have an event handler that you can register to
and can confirm of the click should be performed or not.

Isnt there any built in way to handle this. ?

public class ControlledRadioButton : RadioButton
{

public delegate bool ConfirmClick(EventArgs e);
public event ConfirmClick ConfirmClickEvent = null;
protected override void OnClick(EventArgs e)
{
if(ConfirmClickEvent == null || ConfirmClickEvent(e))
base.OnClick(e);
}
}
Thanks

Sep 26 '06 #1
0 1271

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

Similar topics

1
by: Bob Greschke | last post by:
Root.option_add("*Menu.Font", "Veranda 9") as an example, works fine in my program. Root.option_add("*Radiobutton*selectColor", "black") also works fine for regular radiobuttons. What I...
8
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from...
3
by: sofie | last post by:
Hello all, I use the following javascript function in a html document to set the level of one of eight available radiobuttons. The line that's commented out works fine under IE, but I need to...
1
by: Dmitry V. Markin | last post by:
Good day! Here is my problem: I need to have a radiobutton column in my DataGrid for a representation of a bool column, where only row can be checked at one time(only one value in bool column...
3
by: dave | last post by:
I have half a dozen web form radio buttons on a web form. Each of them is set to postback=true. However, if for instance radiobutton1 is already selected and the user selects it again, it performs...
1
by: Nathan Sokalski | last post by:
I have a set of RadioButtons in my form. I want to make sure that the user selects one of them, and therefore am initially having none of them selected. However, I want an error message to be...
3
by: jahuer1 | last post by:
On my Form I have several Panels with several RadioButtons on it. When I start the Form, on each Panel a RadioButton should be selected if it was selected when I called the Form some time ago. ...
5
by: Matt B | last post by:
I know this is a bit of nonstandard behavior, but I would like the Enter key to move focus through a group of radiobuttons without selecting them. The user would then have to use Space or actually...
5
by: techvaibhav | last post by:
Hello everyone i am stuck in a very annoying problem.Hope you guys help me fix this out. I am displaying questions form a Question database along with its options. Options can be controlled by...
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: 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: 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...
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
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...

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.