Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old November 8th, 2007, 03:18 PM
Registered User
Join Date: Dec 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access User Control gridview

i got a user control that has a gridview with a checkbox in it.

 <cc1 agingGridView ID="gvDataNoBind" runat="server" CellPadding="4" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False" AllowPaging="true"
            OnPageIndexChanging="gvData_PageIndexChanging" OnRowDataBound="gvData_RowDataBound">
        <PagerStyle CssClass="Altlabel" HorizontalAlign="Center" />
        <HeaderStyle CssClass="subheader"/>
        <AlternatingRowStyle CssClass="Altlabel" />
        <RowStyle CssClass="GridviewRowStyle" />
        <AlternatingRowStyle CssClass="GridviewRowAlterStyle" />
        <PagerSettings Mode="NumericFirstLast" Position="bottom" />
            <asp:TemplateField HeaderText="Select">
                    <asp:CheckBox ID="chkData" runat="server" Enabled="true" />
    </cc1 agingGridView>

i have this control on a webform. here is my issue, i have added a select all button and remove all button on the webform below the control above.
how could i access the checkbox above on the select all button event to make all values checked and likewise with remove all?

thank you so much for the help..

  #2 (permalink)  
Old November 9th, 2007, 05:38 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts

I did this in javascript once, it basically involved looping through each input control on the form and seeing if its name ended with 'chkData' (if I remember correctly then the control gets a name like 'gvDataNoBind$chkData$1' but you can just check the source code to verify this).

/- Sam Judson : Wrox Technical Editor -/
  #3 (permalink)  
Old November 9th, 2007, 11:09 AM
Registered User
Join Date: Dec 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

thanks it worked better in javascript. thanks for the idea...

Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating a gridview control w/access database p3aul ASP.NET 1.0 and 1.1 Professional 0 October 2nd, 2007 06:14 PM
User Control in a GridView Colonel Angus ASP.NET 2.0 Basics 4 August 13th, 2007 10:28 AM
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM
Access a web user control from javascript? shenku ASP.NET 1.0 and 1.1 Professional 3 July 21st, 2005 07:24 AM

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