473,326 Members | 2,196 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,326 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 2524
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.