473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Repeater Question

Im using ASP.NET 2.0 and I have a repeater question.

I am trying to make a change to the ItemTemplate in the itemdatabound event.

Basically, this is a follow on from my previous question anyhow. I have rows
being display like so
Category Data Data Data
Green 1 2 3
Green 2 2 2
Blue 4 2 1
Blue 5 5 4
What I want out of my repeater "WHEN" the category changes

<tr>
<td colspan=4>'TheCategory"</td>
</td>
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

And when "NOT CHANGED"
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

So this would result in

Green
1 2 3
2 2 2

Blue
4 2 1
5 5 4
This means I have to manipulate the ItemTemplate, but im not sure how to go
about doing this in the Databound event. I need to hide / not display the
category row. Im sure there is an easy way to do this, but im struggling.
Cheers

Sep 18 '07 #1
1 2529
Put both rows in the ItemTemplate:

<itemtemplate>
<tr runat="server" id="headerRow">
<td colspan=4>'TheCategory"</td>
</td>
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

<itemtemplate>

and hide is in either ItemDataBound or PreRender event as

item.FindControl("headerRow").Visible = false;

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Just Me" <news.microsoft.comwrote in message
news:u6****************@TK2MSFTNGP02.phx.gbl...
Im using ASP.NET 2.0 and I have a repeater question.

I am trying to make a change to the ItemTemplate in the itemdatabound
event.

Basically, this is a follow on from my previous question anyhow. I have
rows being display like so
Category Data Data Data
Green 1 2 3
Green 2 2 2
Blue 4 2 1
Blue 5 5 4
What I want out of my repeater "WHEN" the category changes

<tr>
<td colspan=4>'TheCategory"</td>
</td>
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

And when "NOT CHANGED"
<tr>
<td>Category</td>
<td>Data1</td>
<td>Data2</td>
<td>Data3</td>
</tr>

So this would result in

Green
1 2 3
2 2 2

Blue
4 2 1
5 5 4
This means I have to manipulate the ItemTemplate, but im not sure how to
go about doing this in the Databound event. I need to hide / not display
the category row. Im sure there is an easy way to do this, but im
struggling.
Cheers



Sep 18 '07 #2

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

Similar topics

0
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to...
0
by: Fraggle | last post by:
I am using PlaceHolders in a Repeater to generate a multi choice survey. I need a way of testing to see what the placeholder has been turned into at runtime, and reading out the data. The admin...
1
by: Fraggle | last post by:
I have a repeater with controls added at run time. the <template> also contains a <asp:textbox that is made visible on some repeater elements. when I come to read the text info out it has...
8
by: Invalidlastname | last post by:
Hi, We are developing an asp.net application, and we dynamically created certain literal controls to represent some read-only text for certain editable controls. However, recently we found an issue...
1
by: olduncleamos | last post by:
Hello all, I am experimenting with the repeater control and ran into something that I wasn't expecting. I would appreciate if the experts can confirm or correct my understanding. Here is a...
7
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the...
3
by: Andrew | last post by:
Hi, I am working on a questionnaire. I have displayed a questionnaire using a repeater control. The itemtemplate is as below (quite cut down): <ItemTemplate> <tr><td> <%#...
3
by: GD | last post by:
I need to bind my repeater to a DataSet for which the number of columns is always different (cross-tab report). However, I need to exlude an Id column from displaying on the Repeater. As shown...
3
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't...
12
by: =?Utf-8?B?Qi4gQ2hlcm5pY2s=?= | last post by:
I'm doing a web app in VB/Dot Net 2.0. I'm probably a bit rusty and I have no experience using the repeater control. I have a user control I've created with multiple properties. I've created a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...

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.