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

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 14504
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**************@TK2MSFTNGP12.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*****************@newsfep1-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**************@TK2MSFTNGP12.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_*****************@newsfep1-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*****************@newsfep1-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**************@TK2MSFTNGP12.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
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...
1
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...
5
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...
4
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...
4
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...
19
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...
0
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...
3
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...
6
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...
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...
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
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...

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.