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

Dynamic Controls

Hi Mr.Steve,

First of all many thanks for your kind response. The thing is that I am
trying to control the user's action of deselecting a checkbox, once he has
selected it. Also the checkbox has been generated dynamically. If it is
selected I do some other processing, so if it is then deselected then the
whole page has to be resetted, hence the sense of displaying the warning
message. The problem is that I dont want the warning message to be displayed
when it is deselected, but only when it is deselected. Hope you understand
me....

Hope you have.....will wait for your kind reply...

Many thanks,

Irfan
Nov 19 '05 #1
5 3955
Actually I didn't really understand what you are trying to say. Maybe u could
write it more clearer so that you can get help faster..
From what I can understand, you want this :
whenever a checkbox is 'UnChecked' you want the app to notify you?
You can attach event handlers to your generated checkbox to notify you when
your check box is UnChecked.
I would have wrote more but, Is this what you want?
Hth...
R. Thomas

"Irfan Akram" wrote:
Hi Mr.Steve,

First of all many thanks for your kind response. The thing is that I am
trying to control the user's action of deselecting a checkbox, once he has
selected it. Also the checkbox has been generated dynamically. If it is
selected I do some other processing, so if it is then deselected then the
whole page has to be resetted, hence the sense of displaying the warning
message. The problem is that I dont want the warning message to be displayed
when it is deselected, but only when it is deselected. Hope you understand
me....

Hope you have.....will wait for your kind reply...

Many thanks,

Irfan

Nov 19 '05 #2
Hi Thomas Good Day

I had read the converzation between u and akram but this is
the same thing which i am looking for (i.e)

I have created a set of checkboxs dynamically and now i need
to fire there check and uncheck event so how can i achive this

can v handle this events from code-behind or v got to go for
some client side scripting.
Hope this time u got my query clear

Regards

Jameel

Nov 19 '05 #3
Ok Irfan and Jameel,
Here is what you guys can do.
I think by now you guys must already have a dynamic checkbox right?
So now what you guys need to do is to create a event handler and attach it
to your dynamic checkbox.
Also, do not forget to set the 'AutoPostBack' property of your checkbox to
true.
Here is how u attach an eventhandler to ur checkbox
myCheckBox.CheckedChanged += new EventHandler(myCheckBox_CheckedChanged);
Then make the method to handle it like this :
private void myCheckBox_CheckedChanged(object sender, System.EventArgs e)
{
//Do your processing here
}
After this, set the 'AutoPostBack' property of your dynamic checkbox to true
to that it can fire itself, and you are done!

P.S : If this post helped you, Click 'Yes' on top and rate this post. Thanks

Hth...
R. Thomas

"Irfan Akram" wrote:
Hi Mr.Steve,

First of all many thanks for your kind response. The thing is that I am
trying to control the user's action of deselecting a checkbox, once he has
selected it. Also the checkbox has been generated dynamically. If it is
selected I do some other processing, so if it is then deselected then the
whole page has to be resetted, hence the sense of displaying the warning
message. The problem is that I dont want the warning message to be displayed
when it is deselected, but only when it is deselected. Hope you understand
me....

Hope you have.....will wait for your kind reply...

Many thanks,

Irfan

Nov 19 '05 #4
Hi Thomas,

I have code to do that.

((CheckBox)ctl).CheckedChanged += new
System.EventHandler(this.checkBoxSelected1_3);

The problem is: -

1). This is fired both when the checkbox is selected as well as deselected.
I want a warning message to be displayed only when this is deselected once
selected. I have not managed to find an event handler which only fires when
the checkbox is deselected. How can I achieve that ?

2). I want then a warning message to be displayed, if the checkbox is
selected which I am not able to do.

I hope this clarifies my query.

Thanks,

Irfan

"R. Thomas, aka Xtreme.Net" wrote:
Ok Irfan and Jameel,
Here is what you guys can do.
I think by now you guys must already have a dynamic checkbox right?
So now what you guys need to do is to create a event handler and attach it
to your dynamic checkbox.
Also, do not forget to set the 'AutoPostBack' property of your checkbox to
true.
Here is how u attach an eventhandler to ur checkbox
myCheckBox.CheckedChanged += new EventHandler(myCheckBox_CheckedChanged);
Then make the method to handle it like this :
private void myCheckBox_CheckedChanged(object sender, System.EventArgs e)
{
//Do your processing here
}
After this, set the 'AutoPostBack' property of your dynamic checkbox to true
to that it can fire itself, and you are done!

P.S : If this post helped you, Click 'Yes' on top and rate this post. Thanks

Hth...
R. Thomas

"Irfan Akram" wrote:
Hi Mr.Steve,

First of all many thanks for your kind response. The thing is that I am
trying to control the user's action of deselecting a checkbox, once he has
selected it. Also the checkbox has been generated dynamically. If it is
selected I do some other processing, so if it is then deselected then the
whole page has to be resetted, hence the sense of displaying the warning
message. The problem is that I dont want the warning message to be displayed
when it is deselected, but only when it is deselected. Hope you understand
me....

Hope you have.....will wait for your kind reply...

Many thanks,

Irfan

Nov 19 '05 #5
Ok, When I wrote
//Do your processing here
that is where you CHECK, if the checkbox is being checked or unchecked!
If the checkbox is being checked then do nothing and exit the method
If the checkbox is being Unchecked then do your processing.
U can use an if else statement as so :
if(myCheckBox.Checked)
{
//do nothing and exit the function
}
else
{
//do your processing cause u know that the checkbox in being unchecked!
}

I hope this helps you.

P.S : If this post is helpfull to you, pls click 'Yes' on top of this post

R. Thomas
Nov 19 '05 #6

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

Similar topics

1
by: Will | last post by:
Hi all. I'm learning VB.Net and am developing a WinForms app. I'm trying to make an app that I will use to scan in one or more than on image. I want to use a tabbed interface to hold each image....
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...
1
by: hybrid | last post by:
I have problems in understanding the behavior of the events triggered by dynamically created controls over a webform. Could you help me? In a webform, I have a static PlaceHolder PH containing...
2
by: Dave Williamson | last post by:
When a ASPX page is created with dynamic controls based on what the user is doing the programmer must recreate the dynamic controls again on PostBack in the Page_Load so that it's events are wired...
3
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which...
5
by: mytestemailaccount | last post by:
Hi, Hope you can help. I am relatively new to all this but would appreciate the groups help. The scenario: I am c# and asp.net to create a web application. The web page contains a user...
1
by: pbb | last post by:
I'm creating a set of dynamic controls on a webpage by calling my BuildControls sub in the Page_Init sub. I recreate the controls by calling the BuildControls sub in the LoadViewState override...
3
by: WebBuilder451 | last post by:
I have a series of dynamic link buttons created based upon a datareader. I've added a click event and it calls the sub ok: example: "while loop through the reader" Dim ltrCtrl As New...
1
by: Diffident | last post by:
Hello All, I am trying to add dynamic controls onto my page and here is how I am doing that. I have a page which has a button called as "AddMoreControls" and in this button's event handler I...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
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: 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
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
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...

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.