473,785 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get Repeater control to work the way I need it to

Hi, I have been trying to get a checkbox added to a repeater control
of mine and then try to access events of the repeater control when a
user clicks the checkbox. At first, since the control is tied to xsl,
I added the checkbox there. That works fine, but I cannot get any
information about the checkbox (i.e. checked, unchecked, etc) when I
pass data from the xsl over to a method in java. I can get info on
the other columns but not that one.

So I thought maybe it was because the repeater control's html doesn't
have the checkbox identified in it. Below is how the repeater control
looks:

<asp:repeater ID="RptTrip" Runat="server" EnableViewState ="false">
<ItemTemplate >
<trip_detail_in fo trip_detail_id ='<%#
Container.DataI tem("trip_detai l_id")%>'
leg_start_dt = '<%#
Container.DataI tem("leg_start_ dt")%>'
pickup_iso_dt = '<%#
Container.DataI tem("pickup_iso _dt")%>'
trip_status = '<%#
Container.DataI tem("trip_statu s")%>'
eqp_type = '<%#
filterPostrophe (Container.Data Item("eqp_type" ))%>'
expire_iso_dt = '<%#
Container.DataI tem("expire_iso _dt")%>'
dispatch_dt = '<%#
Container.DataI tem("dispatch_d t")%>'
dispatch_iso_dt = '<%#
Container.DataI tem("dispatch_i so_dt")%>'
trip_status_upd ate_dt = '<%#
Container.DataI tem("trip_statu s_update_dt")%> '
status_iso_dt = '<%#
Container.DataI tem("status_iso _dt")%>'
haz = '<%# Container.DataI tem("haz")
%>'
leg_type_ds = '<%#
Container.DataI tem("leg_type_d s")%>'
move_type_ds = '<%#
Container.DataI tem("move_type_ ds")%>'
cont_reefer = '<%#
Container.DataI tem("cont_reefe r")%>'
trip_bkg_nr = '<%#
Container.DataI tem("trip_bkg_n r")%>'
container_an = '<%#
Container.DataI tem("container_ an")%>'
orig_customer_n m = '<%#
filterPostrophe (Container.Data Item("orig_cust omer_nm"))%>'
dest_customer_n m = '<%#
filterPostrophe (Container.Data Item("dest_cust omer_nm"))%>'
orig_loc_nm = '<%#
filterPostrophe (Container.Data Item("orig_loc_ nm"))%>'
dest_loc_nm = '<%#
filterPostrophe (Container.Data Item("dest_loc_ nm"))%>'/>
</ItemTemplate>
</asp:repeater>
So I tried to add a checkbox like so:
<asp:repeater ID="RptTrip" Runat="server" EnableViewState ="false">
<ItemTemplate >
<td><asp:CheckB ox ID="cb" Runat="server" Checked="true"
Enabled="true"> </asp:CheckBox</td>
<trip_detail_in fo trip_detail_id ='<%#
Container.DataI tem("trip_detai l_id")%>'
leg_start_dt = '<%#
Container.DataI tem("leg_start_ dt")%>'
pickup_iso_dt = '<%#
Container.DataI tem("pickup_iso _dt")%>'
trip_status = '<%#
Container.DataI tem("trip_statu s")%>'
eqp_type = '<%#
filterPostrophe (Container.Data Item("eqp_type" ))%>'
expire_iso_dt = '<%#
Container.DataI tem("expire_iso _dt")%>'
dispatch_dt = '<%#
Container.DataI tem("dispatch_d t")%>'
dispatch_iso_dt = '<%#
Container.DataI tem("dispatch_i so_dt")%>'
trip_status_upd ate_dt = '<%#
Container.DataI tem("trip_statu s_update_dt")%> '
status_iso_dt = '<%#
Container.DataI tem("status_iso _dt")%>'
haz = '<%# Container.DataI tem("haz")
%>'
leg_type_ds = '<%#
Container.DataI tem("leg_type_d s")%>'
move_type_ds = '<%#
Container.DataI tem("move_type_ ds")%>'
cont_reefer = '<%#
Container.DataI tem("cont_reefe r")%>'
trip_bkg_nr = '<%#
Container.DataI tem("trip_bkg_n r")%>'
container_an = '<%#
Container.DataI tem("container_ an")%>'
orig_customer_n m = '<%#
filterPostrophe (Container.Data Item("orig_cust omer_nm"))%>'
dest_customer_n m = '<%#
filterPostrophe (Container.Data Item("dest_cust omer_nm"))%>'
orig_loc_nm = '<%#
filterPostrophe (Container.Data Item("orig_loc_ nm"))%>'
dest_loc_nm = '<%#
filterPostrophe (Container.Data Item("dest_loc_ nm"))%>'/>
</ItemTemplate>
</asp:repeater>

For some reason, it is not recognizing that checkbox and displaying it
on the screen. I've tried it with and without the <tdlines.

In addition, I can't go the route of checking this information within
the vb code because none of the Repeater's events will execute when I
click on the grid in the app. I've tried itemCommand as suggested by
someone but it doesn't execute when I click the grid.

I'm half-tempted to use a different control, but this control is tied
to a lot of xsl, javascript, vb code already in the app so that would
be a lot of work to do.

Can anyone see what I'm doing wrong?

Jun 18 '07 #1
1 1850
There does not appear to be any default behaviour in a check box thats going
to do what you want.

You could create a hack of some sort such as a piece of javascript
tosecretly click a hidden button thats in the repeater row. But thats a
real hash.

Another alternative which is slightly better is to use an ImageButton that
"looks" like check box and displays either a ticked on unticked image.

Jun 19 '07 #2

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

Similar topics

2
11792
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:
3
1980
by: Russ | last post by:
I have a huge form with 91 controls on it and about 1/3 of them are date fields. Is it possible to use just one compare validator to make sure dates are being entered or do I have to make one for each text box? Also can someone think of a easy way to make it so all of these date text boxes will convert a date entered like this 120203 to 12/02/2003?
3
2067
by: Oleg | last post by:
I am using asp:repeater control. I would like to create a conditional row <tr> when the data in DataBinder.Eval(Container.DataItem, "Activity") returns '1'. I need something like this: <%if( Convert.ToString(DataBinder.Eval(Container.DataItem, "Activity")) == "1") { %>...<%}%> My attempts putting 'DataBinder.Eval(Container.DataItem, "Activity")' in 'if' statement were not successfull. It seems like 'DataBinder.Eval(Container.DataItem,...
1
1259
by: Georg Mayer | last post by:
Hi, In my DataSet, which is bound to a repeater, I have two tables: item and child: ds = new DataSet(); itemadapter.Fill(ds, "item"); childadapter.Fill(ds, "child"); How do I access e.g. the item table and the colums in it from my itemtemplate of the repeater control?
1
2727
by: Dot net work | last post by:
Hello. I have an interesting data binding scenario: I have a repeater control. It repeats a typical custom web user control. I also have a collection object, and each collection element contains various pieces of information inside a custom object, including an id field.
0
1067
by: chris.reed | last post by:
I have a repeater control on a web form, which is using a dataset table as a data source. This is working fine. I need to add some additonal data that is related to the original table. I found an article about nesting a repeater control but the example uses a datarelation to link the two dataset tables, but I can't get that to work because the child table will not always have a matching value. So, in this instance, can I use a...
3
2781
by: webserverpete | last post by:
I would like to have multiple <td> in a repeater control. The below code does not work: <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" DataMember="DefaultView"> <HeaderTemplate> <table> </HeaderTemplate> <tr> <ItemTemplate> <td>
2
2174
by: Mike Cain | last post by:
Hi, The Repeater control seems like exactly what I want to output rows of data from my database. However I need to do some manipulation to the data prior to it being output and I'm not understanding how to go about this properly. For instance, the db column "myVal" is defined as a double in the db. In my table I want to display the value of that number by 1000. I used the code below and it does the trick. However, for some rows...
3
3967
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or maybe the repeater control doesn't have the capabilities...? The page needs to display a custom number of sections that appear the same but have different data..
0
9647
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
10357
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
10163
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
9959
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...
1
7510
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
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
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...
1
4063
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
3668
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.