473,624 Members | 2,447 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4015
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.Chec kedChanged += new EventHandler(my CheckBox_Checke dChanged);
Then make the method to handle it like this :
private void myCheckBox_Chec kedChanged(obje ct sender, System.EventArg s 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.EventHan dler(this.check BoxSelected1_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.Chec kedChanged += new EventHandler(my CheckBox_Checke dChanged);
Then make the method to handle it like this :
private void myCheckBox_Chec kedChanged(obje ct sender, System.EventArg s 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.C hecked)
{
//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
6318
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. Here's the code I'm using for testing purposes. I've got the code in the form's load event, but I think I'd have the same problems no matter where the code existed. Right now, the form has an empty tab control, everthing else is dynamic. <code>
2
5306
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 user controls. Worse I'm trying to add dynamic user controls from within a repeater loop (looping through attributes)... I bind to a function in the code behind and pass in the attribute. <asp:repeater id="rAttributes" Runat="server">
1
1998
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 a table of controls, dynamically generated. Among these, a linkbutton (LinkBtn) to which have attached a click handler method, LinkBtn_Click(...) . Generally it works fine, but if in the LinkBtn_Click(...) code I try to access a webform control,...
2
2548
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 and are called like a static control. Here is the problem that I need to solve. The processing overhead that occurs to determine what dynamic controls need to be added involves business logic and a query or queries of data in a sql server...
3
3969
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 step you're on. This all works fine, but I ran into some trouble when I started creating controls dynamically in my code-behind file. Each panel contains a table which is filled with various radio buttons, text fields and the such which are...
5
2407
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 control (.ascx).
1
1914
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 procedure. The set of controls will not always be the same (based on the selection the user makes in a static ddl). The controls are persisted perfectly. The problem I'm experiencing is that when one of the dynamic ddl's (let's say ddl1) is...
3
1851
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 LiteralControl Dim lbtnCtrl As New LinkButton ltrCtrl.Text = "<br>" lbtnCtrl.Text = "WE: " & dtrCal(10).ToString lbtnCtrl.ToolTip = dtrCal(10).ToString & " these events" & dtrCal(1) lbtnCtrl.ID = "wecc" & i.ToString
1
2185
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 am creating controls dynamically and adding them to a panel on the page. For example, if the button is clicked once, the page is posted back and the controls are added properly. However, if I click the "AddMoreControls" for the second time the...
9
3617
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 to create the dynamic controls in the OnInit stage of the lifecycle. Since data from static controls is not yet available in the OnInit stage I can't know what dynamic control I have to create.
0
8672
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8614
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8330
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8471
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.