473,857 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing checkbox properties in a repeater control

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>


Expand AllCollapse All
Jun 8 '06 #1
0 2292

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

Similar topics

3
14732
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
11804
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:
4
2062
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...
2
1691
by: Imran Aziz | last post by:
Hello All, I have added html checkboxes in each row of the repeater control that I draw on the page. Now when I wan to find out if the check boxes have been checked or not, I cannot seem to access them. Can anyone please guide me how to access child items in a repeater control. Here is my code. <ASP:Repeater id="lstOtherRepeater" runat="server" >
2
6468
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)
8
16628
by: Alan Silver | last post by:
Hello, I have a repeater that has code like this... <ItemTemplate> <asp:CheckBox ID="chkDelete" Text="" RunAt="server"/> .... other stuff goes here </ItemTemplate> There is a button below the repeater. When clicked, it is supposed to
2
3725
by: RichardH | last post by:
Hi, I have x number of table rows that all should have a checkbox and a dropdownlist on each row. The checkbox could be checked and the dropdown should contain y number of values that are related to the row. I can't find a good control for this in ASP.Net 2.0. Now I use a repeater and check the checkbox on ItemDataBound, I also fill the dropdown on this event. My first problem is that i find this event very messy. I have to cast...
0
2816
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...
5
24533
by: c_shah | last post by:
using VB.net (2005) ASP.net 2.0 I have a repeater control with the item template, in the item template I have two checkboxes How to capture event When user checks the checkboxes? What event fires on the repeater Repeater Control Item Template
0
9923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9767
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11082
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
10711
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...
1
10807
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9549
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
7939
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...
1
4592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4190
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.