473,756 Members | 3,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing the properties of a checkbox within a repeater

I have a repeater control that contains a HeaderTemplate and an ItemTemplate.
Each item contains a checkbox with an ID of chkReconciled, and the header
contains a single checkbox with an ID of chkAll. I simply want to have
chkAll be checked if every item in the repeater has its checkbox checked. In
the code behind page, I can access the checked property of chkReconciled by
doing the following:

Dim CurrentCheckBox As CheckBox
CurrentCheckBox = rptDeposits.Ite ms(I).FindContr ol("chkReconcil ed")

Then I can check if CurrentCheckBox .checked is true. That works fine.
However, I haven't been able to set the checked property for chkAll. Since
it isn't part of the items, I have been trying the following:

Dim CheckAll As CheckBox
CheckAll = rptDeposits.Fin dControl("chkAl l")
CheckAll.Checke d = True

However, when I try to set the checked property, I get an exception saying,
"Object reference not set to an instance of an object." I've experimented
with a dozen different ways of setting the checked property of CheckAll, to
no avail. Can anyone set me on the right path?! I'm pasting the ASPX code
for the repeater below.

Thanks!
Keith

<%@ OutputCache Location="None" Duration="1" VaryByParam="No ne" %>
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Ban k_recon_deposit .aspx.vb"
Inherits="IAMVF O_DEV.Bank_reco n_deposit"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Bank_rec on_deposit</title>
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta content="Micros oft Visual Studio.NET 7.0" name="GENERATOR ">
<meta content="Visual Basic 7.0" name="CODE_LANG UAGE">
<meta content="JavaSc ript" name="vs_defaul tClientScript">
<meta content="http://schemas.microso ft.com/intellisense/ie5"
name="vs_target Schema">
<LINK href="Styles.cs s" type="text/css" rel="stylesheet ">
</HEAD>
<BODY onresize="retur n Height();"
onload="setTime out('SessionTim eout()',1080000 ); return Height();"
class="backgrou nd">
<!--<p class="sectionH eader">Bank Reconciliation</p>-->
<form id="frmBankReco nDep" method="post" runat="server">
<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD class="Report_H eaderColor" style="FONT-WEIGHT: bold; FONT-SIZE:
12pt">Bank
Reconciliation
<asp:button id="btnBack" runat="server" Text="<
Back"></asp:button> <asp:button id="btnCancel" Text="Cancel and Lose Changes"
runat="server" Width="146"></asp:button>
<asp:button id="btnSave" Text="Save and Finish Later" runat="server"
Width="146px"></asp:button>
<asp:button id="btnNext" runat="server" text="Next >"
DESIGNTIMEDRAGD ROP="65"></asp:button></TD>
</TR>
</TABLE>
<table cellSpacing="1" cellPadding="3" style="FONT-SIZE: 11pt; WIDTH:
100%">
<tr>
<TD class="Report_H eaderColor" align="middle">
<asp:Button id="btnCleared " runat="server" Text="Total Cleared
Deposits" Width="141px"></asp:Button></TD>
<td class="Report_H eaderColor" style="WIDTH: 175px">
<asp:Label id="lblAmount" runat="server"
Font-Size="11pt"></asp:Label></td>
<td rowSpan="2" class="Report_H eaderColor" style="FONT-SIZE: 11pt">
Please check-off the deposits that have cleared the bank, as listed on
your
bank statement.</td>
</tr>
</table>
<asp:repeater id="rptDeposits " runat="server">
<HeaderTemplate >
<div id="divTransHea der" style="VISIBILI TY: hidden">
<table id="tblTransHea der" border="0" cellspacing="0"
class="HeaderTa ble">
<colgroup class="ShadeCol HeaderDark">
<col id="colHeader1 " align="center">
<col id="colHeader2 " align="center">
<col id="colHeader3 " align="center">
<col id="colHeader4 " align="center">
<col id="colHeader5 " align="center">
<col id="colHeader6 " align="center">
<col id="colHeader7 " align="center">
<col width="*">
</colgroup>
<tr class="TableHea ders">
<td id="tblTransHea der1_0">
<asp:label text="R/C" id="lblReconcil ed"
Runat="server"> </asp:label></td>
<td id="tblTransHea der1_1">
<asp:LinkButt on id="lnkSortDate " CausesValidatio n="false"
OnCommand="Sort Data" CommandArgument ="transdate" text="Date" Runat="server"
ForeColor="#000 000"></asp:LinkButton> </td>
<td id="tblTransHea der1_2">
<asp:LinkButt on id="lnkSortNumb er" CausesValidatio n="false"
OnCommand="Sort Data" CommandArgument ="depositID" text="Number" Runat="server"
ForeColor="#000 000"></asp:LinkButton> </td>
<td id="tblTransHea der1_3" colspan="2">
<asp:LinkButt on id="lnkSortDesc " CausesValidatio n="false"
OnCommand="Sort Data" CommandArgument ="TransDesc" text="Descripti on"
Runat="server" ForeColor="#000 000"></asp:LinkButton> </td>
<td id="tblTransHea der1_4">
<asp:LinkButt on id="lnkSortPayT ype" CausesValidatio n="false"
OnCommand="Sort Data" CommandArgument ="paymenttyp e" text="Payment Type"
Runat="server" ForeColor="#000 000"></asp:LinkButton> </td>
<td id="tblTransHea der1_5">
<asp:LinkButt on id="lnkSortRece ipt" CausesValidatio n="false"
OnCommand="Sort Data" CommandArgument ="receipt" text="Deposit" Runat="server"
ForeColor="#000 000"></asp:LinkButton> </td>
<td id="tblTransHea der_SCROLL_BAR_ HACK_COLUMN_1"> </td>
</tr>
<tr class="TableHea ders">
<td id="tblTransHea der2_0" style="BORDER-TOP: white 2px solid">All
<asp:CheckBox ID="chkAll" AutoPostBack=Tr ue
OnCheckedChange d="CheckAll" Runat="server" EnableViewState ="true"/></td>
<td id="tblTransHea der2_1"> </td>
<td id="tblTransHea der2_2"> </td>
<td id="tblTransHea der2_3" style="BORDER-TOP: white 2px solid">
<asp:LinkButt on id="lnkSortCat " CausesValidatio n="false"
OnCommand="Sort Data" CommandArgument ="category" text="Category"
Runat="server" ForeColor="#000 000"></asp:LinkButton> </td>
<td id="tblTransHea der2_4" style="BORDER-TOP: white 2px solid">
<asp:LinkButt on id="lnkSortSubC at" CausesValidatio n="false"
OnCommand="Sort Data" CommandArgument ="subCategor y" text="Sub-Category"
Runat="server" ForeColor="#000 000"></asp:LinkButton> </td>
<td id="tblTransHea der2_5"> </td>
<td id="tblTransHea der2_6"> </td>
<td id="tblTransHea der_SCROLL_BAR_ HACK_COLUMN_2"> </td>
</tr>
</table>
</div>
<DIV id="divTransBod y" style="VISIBILI TY: hidden; OVERFLOW: auto;
WIDTH: 100%; HEIGHT: 180px">
<table border="0" cellspacing="0" id="tblTransBod y" width="100%">
<colgroup class="ShadeCol HeaderDark">
<col width="80" id="tblTransBod y1" align="center">
<col width="80" id="tblTransBod y2" align="center">
<col width="100" id="tblTransBod y3" align="center">
<col width="155" id="tblTransBod y4" align="center">
<col width="145" id="tblTransBod y5" align="center">
<col width="100" id="tblTransBod y6" align="center">
<col width="200" id="tblTransBod y7" align="center">
</colgroup>
</HeaderTemplate>
<ItemTemplate >
<tr class="Shade_Tr ans_light">
<td>
<asp:CheckBox ID="chkReconcil ed" Checked
=<%#Container.D ataItem("Reconc iled")%> Runat="server" />
<asp:Label ID="lblDepositI d" Runat=server Visible=false
text=<%#Contain er.DataItem("De positID")%>/></td>
<asp:Label ID="lblType" Runat=server Visible=false
text=<%#Contain er.DataItem("Ty pe")%>/></td>
<td><%# Format(Containe r.DataItem("Tra nsDate"), "MM/dd/yyyy") %></td>
<td><%# Container.DataI tem("Number")%> </td>
<td colspan="2">
<asp:Label ID="lblTransDes c" text=<%#
Container.DataI tem("TransDesc" )%> Runat=server visible=true>
</asp:Label>
</td>
<td>
<asp:Label ID=lblPayType text=<%# Container.DataI tem("PaymentTyp e")%>
Runat=server visible=true>
</asp:Label>
</td>
<td>
<asp:Label ID=lblReceipt text=<%# Container.DataI tem("Receipt") %>
runat=server>
</asp:Label></td>
</tr>
<tr class="Shade_Tr ans_dark">
<td colspan="3">
<asp:Label ID="lblAdjustTr ans" text=<%#
Container.DataI tem("AdjustTran saction")%> runat=server>
</asp:Label>
<asp:Label ID="lblBatchID " Runat=server Visible=false
text=<%#Contain er.DataItem("pa yroll_ind")%>/>
</td>
<td>
<asp:Label ID="lblCategory " text=<%# Container.DataI tem("Category") %>
Runat=server visible=true>
</asp:Label></td>
<td>
<asp:Label ID=lblSubCatego ry text=<%#
Container.DataI tem("SubCategor y")%> Runat=server visible=true>
</asp:Label></td>
<td></td>
<td colspan="2">
<asp:LinkButt on ForeColor ="#3333ff" CausesValidatio n=false
ID="lnkAdjust" CommandArgument =<%# Container.DataI tem("DepositID" )%>
OnCommand="lnkA djust_Click" Runat="server">
</asp:LinkButton>
</td>
</tr>
</ItemTemplate>
<SeparatorTempl ate>
<tr>
<td colspan="10" height="2" bgcolor="black" style="BORDER-RIGHT: white
1px solid; BORDER-LEFT: white 1px solid;"></td>
</tr>
</SeparatorTempla te>
<FooterTemplate >
</table> </div>
</FooterTemplate>
</asp:repeater>
<asp:button id="BtnRefresh " CausesValidatio n="false" Runat="server"
Text="refresh"> </asp:button>
<input type="hidden" id="hdnlnkAdjus t" runat="server"
NAME="hdnlnkAdj ust"> <input type="hidden" id="hdnCancel" runat="server"
NAME="hdnCancel ">
<asp:DataGrid id="DataGrid1" runat="server"> </asp:DataGrid>
</form>
<script language="javas cript" src="AlignGridH eaders.js"></script>
<script language="javas cript">
<!--
Resizecolumns(t blTransHeader, tblTransBody, divTransBody, 7);
divTransHeader. style.visibilit y = "visible";
divTransBody.st yle.visibility = "visible";

//-->
</script>
<script language="javas cript">
<!--
//4/11/05-Wrote this function, and added the onload & onresize events
to the <body> tag,
// to resize the transaction log based on screen resolution.
function Height()
{if ((screen.width= =1024) && (screen.height= =768))
return divTransBody.st yle.height = 402;
else if ((screen.width= =800) && (screen.height= =600))
return divTransBody.st yle.height = 192;}

// 03/06/2006-Added the SessionTimeout( ) function to warn a user of a
timeout.
function SessionTimeout( )
{
alert("Your session will Timeout in 2 minutes!\n Any changes will be
lost if that happens.\n Click NEXT or SAVE AND FINISH LATER on the page to
save your changes.");
}
//-->
</script>
</FORM>
</BODY>
</HTML>

Jun 6 '06 #1
0 2807

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
14728
by: DonRex | last post by:
Hello all! I couldn't find a web application-newsgroup for ASP.NET, so I'm sorry if this is the wrong forum! Synopsis: In my webform I have 3 nested repeaters: rpWeeks ----- rpTime
2
11791
by: Thomas R | last post by:
Is is possible? In VS.NET 2003, Binding data to the repeater is easy, but when I try to add an ASP:checkbox to the .aspx page, the designer won't recognize it, hence the code view doesn't allow me to access it. The funny thing is that it compiles fine, and the checkboxes are there, I just can't write to them! Is there a way around this problem? My HTML is as follows:
2
5051
by: Mark | last post by:
I am attempting to build a repeating list using a repeater control. I want to add a checkbox to each item (line) and 'Select All' and 'Clear All' buttons. I have figured out how to do this until it comes time to implement paging. Without paging I can iterate through the repeater when I click 'Select All' and set the checked property to true for all items in the repeater. However when I implement paging, I have to rebind the repeater...
4
2055
by: John Holmes | last post by:
I'm using data to rename some web controls on a form that uses a repeater contol and so it can have mulitple instances of the same control set. The controls get renamed (thanks to Steven Cheng's help) in a click event of the button that is pushed to enter data. Each time the button is clicked it sends the ID entered by the user to query the database and return information. The renamed controls then include the ID in the name of the...
3
4852
by: Jack Turnbull | last post by:
Hi, I have a Checkbox in a Repeater set to AutoPostBack = true. I have pointed OnCheckedChanged to a Sub but it doesn't fire. If I move the checkbox out of the Repeater it fires! Any ideas? Thanks
2
2087
by: Alan Silver | last post by:
Hello, I have a repeater with a list of products in it. Each item in the repeater has a checkbox, allowing the product to be selected. When a link button is clicked, I want to loop through the repeater and handle each product whose checkbox is checked. The repeater looks (greatly chopped down) like this... <asp:Repeater ID="rptProducts" RunAt="Server">
2
6453
by: Andrew | last post by:
Hi, I have a problem capturing the checkboxes that are checked, I get false irrespective of wether they are checked or not. I have gone thru the sample code on this forum, but they dun seem to work. This is the code that I used to go thru the repeater control to find my checkboxes. foreach(RepeaterItem r in MyRepeater.Items)
2
5522
by: Ceema M via DotNetMonster.com | last post by:
Hello all, I have a nested repeater, which displays categories(parent repeater) and corresponding subcategories(child repeater). Both repeaters have checkboxes. When I check category checkbox and subcategory check boxes and click on submit button , I have to retrieve the corresponding categoryid and subcategory id, so that I can store it to a table. I am getting the categoryid but I am failing to get subcategoryid(actually I don't know...
0
2285
by: Keith | last post by:
I have a repeater control that contains a HeaderTemplate and an ItemTemplate. Each item contains a checkbox with an ID of chkReconciled, and the header contains a single checkbox with an ID of chkAll. I simply want to have chkAll be checked if every item in the repeater has its checkbox checked. In the code behind page, I can access the checked property of chkReconciled by doing the following: Dim CurrentCheckBox As CheckBox...
0
10031
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9869
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9708
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7242
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5140
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2665
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.