Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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
  #1 (permalink)  
Old November 22nd, 2006, 03:05 PM
Registered User
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default delete using checkboxes in gridview

hey everyone

im having problems with a few things
im using a gridview to display my data from my access database using an accessdatasource. i have set the auto generated column to false and i have bounded all my columns to correspoings fields. i have also added a checkbox to the gridview as another column as a template field
oncheckedchanged im calling a subroutine which takes the index of the gridviewrow and display it in a messagebox. this was just to test whether it gives me the primary key value but it keeps giving me -1
on any checkbox i check. i hear something about binding the data to the checkbox but im not too familiar with all this as i have only been working on this for a while. any help is very much appreciated

Sub CheckBox1_CheckedChanged1(ByVal sender As Object, ByVal e As EventArgs)

      Dim pkey As String = GridView1.SelectedIndex

End Sub

once i know that every checkbox is uniquely binded by the primary key then i can delete it but i might also need help on that. thanks

  #2 (permalink)  
Old November 22nd, 2006, 08:28 PM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkboxes in Gridview ramuis78 ASP.NET 2.0 Basics 0 October 11th, 2007 09:55 AM
Gridview with checkboxes kgaughan1 ASP.NET 2.0 Professional 0 February 11th, 2007 11:31 PM
The use of checkboxes to delete records inoracle9i luisbueno Classic ASP Databases 0 December 24th, 2004 12:07 PM
Cannot get multiple delete using checkboxes workin gmizzell Classic ASP Databases 0 July 13th, 2003 04:22 PM

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