Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 10th, 2008, 02:27 AM
Registered User
 
Join Date: Jul 2008
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Detailview with Checkbox

Hi Guys
   I am Created GridView with one of the Column having Checkbox.Using Template Field I created Chockbox for that particular column.see the code below
<asp:TemplateField HeaderText="Status" SortExpression="Status">
<ItemTemplate>
<asp:CheckBox ID="Ch1" runat="server" Enabled="false" Checked="false" />
</ItemTemplate>
</asp:TemplateField>
It is displayed in the GridView.Now I created one Detailview for performing Edit operation.Here also I created Checkbox Using </asp:TemplateField> but I don't know how to perform the Update for Checkbox field,ie,I don't know how to find the Checkbox is checked or Unchecked and how to get the current value and store in the database..Please give any Sample code...


  #2 (permalink)  
Old July 10th, 2008, 04:20 PM
Friend of Wrox
 
Join Date: Nov 2007
Location: Central Florida, USA.
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default

loop through the gridview rows and find the control named Ch1 and see if it's checked or not

Dim gvRow as GridViewRow
For Each gvRow in GridView1.Rows
  If ctype(gvRow.FindControl("Ch1"), CheckBox).Checked = True Then
     'Do something here
  End IF
Next

Jason Hall
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing in DetailView using objectdatasourse balesh.mind ASP.NET 2.0 Professional 0 May 22nd, 2008 03:12 AM
Linking GridView to DetailView BOS ASP.NET 1.0 and 1.1 Basics 0 July 7th, 2007 01:40 AM
Detailview insert tombert ASP.NET 2.0 Basics 1 April 26th, 2007 06:00 AM
checkbox checked by default by html:checkbox sachin.tathod Struts 3 December 4th, 2006 03:41 PM
DetailView Control Showkkath ASP.NET 2.0 Professional 1 November 23rd, 2005 02:48 PM



All times are GMT -4. The time now is 09:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.