Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

checkbox within datagrid (ASP.NET)

Original Message
Name: sthchris
Date: August 24, 2004 at 22:33:30 Pacific
Subject: checkbox within datagrid (ASP.NET)
OS: Win2Kserver
CPU/Ram: P4 2G/512MB
Comment:
Hi all,

It is an ASP.NET (vb) question regarding the checkboxes within a datagrid.

What I wanna to do is - when I check/uncheck a checkbox within the datagrid, it will call another function/procedure to do another thing. Can anybody please assist me in giving the appropriate coding to me?

Thanks in advance!


Report Offensive Message For Removal


Response Number 1
Name: SN
Date: August 24, 2004 at 22:59:54 Pacific
Subject: checkbox within datagrid (ASP.NET)
Reply: (edit)
Just make sure that the postback property (or maybe it's autopostback) is set to true for the checkbox (in the item template of the datagrid). Then point the onClick attribute of the checkbox to the function of your choice.

-SN


Report Offensive Follow Up For Removal

Response Number 2
Name: CraigStone
Date: September 2, 2004 at 12:16:23 Pacific
Subject: checkbox within datagrid (ASP.NET)
Reply: (edit)
I would like to modify the checkbox control's NAME attribute, in order to make it javascript-friendly? Any ideas would be greatly helpful. Right now, .net spits out a NAME attribute for the checkbox as "dgMyGrid:_ctl0:_chkMyCheckbox". Javascript will throw an error when you attempt to reference that checkbox (any of them) with that name. I would need to remove the colons (:) in order for javascript to accept the explicit reference. Microsoft has done this with their linkbuttons for example. They use dollar signs ($) and have the __doPostback javascript function split on the dollar signs and re-concatenate with colons before posting back to the server (triggered by clicking the linkbutton). Attempting to modify an attribute of a checkbox in a datagrid on the ItemDataBound event, results in a wrapping of a SPAN tag with the desired attribute and value inline with the tag. The checkbox's NAME attribute remains unchanged and the entire checkbox HTML markup is placed inside of this newly generated SPAN tag.

Any idea how to set/reference the checkbox NAME attribute in the datagrid on the ItemDataBound event?

Thanks in advance.

Craig


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: checkbox within datagrid (ASP.NET)

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




XP Installed to G?

exessive internet traffic

ZoneAlarm Question. Blocked Connect

Windows Live Messenger Problem

Delete $Uninstall after SP3 updates


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC