Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | 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 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
Reply
 
Thread Tools Search this Thread Display Modes
  #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" />
        <Columns>
            <asp:TemplateField HeaderText="Select">
                <ItemTemplate>
                    <asp:CheckBox ID="chkData" runat="server" Enabled="true" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </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..

Reply With Quote
  #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
Default

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 -/
Reply With Quote
  #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
Default

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
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



All times are GMT -4. The time now is 06:57 PM.


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