Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 28th, 2005, 02:17 AM
Authorized User
 
Join Date: Nov 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Asp.Net Checkbox in Datagrid.

I have a datagrid that contains checkbox and displays data from database.

I want to select multiple checkbox to delete the details.
how this can be achived using C#.

Thanks.

Best Regards,
Vivek.
__________________
Best Regards,
Vivek.
 
Old November 28th, 2005, 09:23 AM
Registered User
 
Join Date: Nov 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ur post is not very clear of what u want. The line "I want to select multiple checkbox to delete the details." is little confusing. It would be better if u could elaborate on this.


Yagyesh Agrawal
Systems Executive
KPIT Cummins Infosystem Ltd
Ph:9890252515
 
Old December 5th, 2005, 02:40 PM
Registered User
 
Join Date: Sep 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If your datagrid displays correctly with a checkbox on each line item, then the following code should help:

foreach(DataGridItem DataGridItem in DataGrid1.Items)
            {
                if(DataGridItem.Cells[0].Controls[1] is CheckBox)
                {
                    CheckBox Checkbox1 = (CheckBox)DataGridItem.Cells[0].Controls[1];
                    if(Checkbox1.Checked == true)
{


//Then place your code to delete the entry here






Similar Threads
Thread Thread Starter Forum Replies Last Post
vb.net asp.net DataGrid krantips VS.NET 2002/2003 0 June 28th, 2006 01:22 AM
ASP.NET C# - Trouble with checkbox booksnore2 General .NET 1 October 5th, 2004 11:46 PM
ASP.NET datagrid marclena VS.NET 2002/2003 2 November 4th, 2003 11:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.