473,769 Members | 7,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

event handler for checkbox in datagrid

i have a checkbox and a dropdownlist in 2 templatecolumns in a datagrid.

how can i add a onClick/CheckedChanged event handler to a checkbox in the
datagrid ?

i want to enable a dropdownlist when the checkbox is checked and disable the
dorp when checkbox is not checked.

thanks.
Nov 13 '05 #1
3 14519
Hi Rodrigo

Add an event handler to the datagrid's ItemCommand event. It will fire when
either control raises an event passing you event args containing dataitem,
control reference etc.

HTH
Joe

"rodrigo guerra" <em************ @yahoo.com> wrote in message
news:eu******** ******@TK2MSFTN GP12.phx.gbl...
i have a checkbox and a dropdownlist in 2 templatecolumns in a datagrid.

how can i add a onClick/CheckedChanged event handler to a checkbox in the
datagrid ?

i want to enable a dropdownlist when the checkbox is checked and disable the dorp when checkbox is not checked.

thanks.

Nov 13 '05 #2
Sorry! Sorry ... I checked this with a LinkButton (works fine) but doesn't
work with a checkbox. Will post again if I find the real solution ...

Joe

"Joe Glover" <jo************ **@ntlworld.com > wrote in message
news:RL******** *********@newsf ep1-win.server.ntli .net...
Hi Rodrigo

Add an event handler to the datagrid's ItemCommand event. It will fire when either control raises an event passing you event args containing dataitem,
control reference etc.

HTH
Joe

"rodrigo guerra" <em************ @yahoo.com> wrote in message
news:eu******** ******@TK2MSFTN GP12.phx.gbl...
i have a checkbox and a dropdownlist in 2 templatecolumns in a datagrid.

how can i add a onClick/CheckedChanged event handler to a checkbox in the datagrid ?

i want to enable a dropdownlist when the checkbox is checked and disable

the
dorp when checkbox is not checked.

thanks.


Nov 13 '05 #3
Got it! This post says it all ...

http://groups.google.com/groups?hl=e...40cpmsftngxa07

HTH
Joe

"Joe Glover" <jo************ **@ntlworld.com > wrote in message
news:O_******** *********@newsf ep1-win.server.ntli .net...
Sorry! Sorry ... I checked this with a LinkButton (works fine) but doesn't
work with a checkbox. Will post again if I find the real solution ...

Joe

"Joe Glover" <jo************ **@ntlworld.com > wrote in message
news:RL******** *********@newsf ep1-win.server.ntli .net...
Hi Rodrigo

Add an event handler to the datagrid's ItemCommand event. It will fire

when
either control raises an event passing you event args containing dataitem,
control reference etc.

HTH
Joe

"rodrigo guerra" <em************ @yahoo.com> wrote in message
news:eu******** ******@TK2MSFTN GP12.phx.gbl...
i have a checkbox and a dropdownlist in 2 templatecolumns in a datagrid.
how can i add a onClick/CheckedChanged event handler to a checkbox in the datagrid ?

i want to enable a dropdownlist when the checkbox is checked and

disable the
dorp when checkbox is not checked.

thanks.



Nov 13 '05 #4

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

Similar topics

2
17032
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of the columns of the data grid contains a DropDownlist. I managed to create this datagrid control as follows.
1
4708
by: wsyeager36 | last post by:
I have a datagrid inside a datalist. The datalist shows parent info and the datagrid shows the child info for that parent. There is a checkbox on each row of the child datagrid. Also inside the datalist is a radiobuttonlist. When this radiobuttonlist is checked, I would like it to iterate thru each row on the child grid and either select or deselct the checkboxes (which are on each row of the child datagrid). In addition, the user can also check...
5
6174
by: J McD | last post by:
Hi I have a DataGrid with an ImageButton column. When I click on an imagebutton I get a postback but it doesn't run the OnImgBtnClick method. I can actually comment out the line where I add this Click event to the ImageButton Column and it makes no difference, I still get a postback. This is driving me crazy...something seems to be causing an OnClick postback and it isn't my Click event I've included the code below....any help will be...
4
2126
by: The Alchemist | last post by:
I am having a problem with a dynamically-generated Datagrid. It is important to point out that this problem does not exist with a design-time created Datagrid, but only with a dynamically generated Datagrid in a Web Custom Control (WCC) : The datagrid has LinkButton Column which has a select LinkButton for each row. When this button is clicked, the Datagrid raises its 'ItemCommand' event which captures the information for that row and...
4
1527
by: News | last post by:
I have a page with many controls. Among these controls there is a table which is a datagrid with nested repeater inside. My problem is that I can not use DataGridCommandEventArgs to get datagrid elements because submit button is not in datagrid and uses onClick event btnSaveServicePlanUpdate. Here is the code: Sub btnSaveServicePlanUpdate_OnClick(sender As Object, e As EventArgs) ' need to get the key value serviceplanprogram_id and...
19
2485
by: Sjaakie Helderhorst | last post by:
Hello, I need to add a Javascript event (onClick) to a servercontrol (asp:checkbox). Checkbox is named 'cbDoMail'. Assumed that 'cbDoMail.Attributes.Add("onClick", "doJavascriptThing()") would do the job, unfortunately it didn't. Can anyone point me in the right direction? Thanks!
0
5752
by: Oz | last post by:
Hi Using VS.NET 2003, Windows XP SP1, We have a page which has been developed using ASP.NET. On it, is a button which when clicked is supposed to add some data to a table. When the button is selected, it causes the ServerClick event to be called twice. Here's the code: You'll see that there are two grids on the page, and that the function SetupDataGrid populates data to the two grid. There are also
3
3462
by: danc | last post by:
I have a datagrid with a checkbox and dropdown list in each row. Both set AutoPostBack to true and ItemCommand and OnSelectedIndexChanged events for these controls works fine when DataGrid is not paged. As soon as I turn on paging support, I no longer get events properly for any page except the first. 1) The DataGrid displays the page numbers on the top (and bottom). Whenever I click to go to a specific page number, the DropDownList's...
6
2967
by: hazz | last post by:
ICollection CreateDataSource() { dt.Columns.Add(new DataColumn("ReportInclude", typeof(Boolean))); for (int i=0; i<=10; i++) { dr = dt.NewRow(); dr = 0; dt.Rows.Add(dr); } void Page_Load(Object sender, EventArgs e) { ItemsGrid.DataSource = CreateDataSource(); void Item_Bound(Object sender, DataGridItemEventArgs e) {
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
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...
1
9997
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
6675
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
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.