473,320 Members | 2,112 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,320 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 3942
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.