473,395 Members | 1,571 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,395 software developers and data experts.

Data Repeater :: Can you?

Hi all...
I've been training a little on the whole ASP.NET and would like to know
how someone would use the data repeater like this:

For example, I have some data coming from a table and let's say for
some of the rows, I would like to show a website for the company if
they had that level of membership but for others, I would like to HIDE
the website for the company. It could be as easy as a BIT field in the
table like SHOWURL, if checked, it shows, if not, the URL should not
show.

Is there a way to do this? Do you use another control?

Thoughts?

Jun 13 '06 #1
2 1202
You can use a DataBinding expression that calls a custom function.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

"mikeyatsony" <mi*********@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Hi all...
I've been training a little on the whole ASP.NET and would like to know
how someone would use the data repeater like this:

For example, I have some data coming from a table and let's say for
some of the rows, I would like to show a website for the company if
they had that level of membership but for others, I would like to HIDE
the website for the company. It could be as easy as a BIT field in the
table like SHOWURL, if checked, it shows, if not, the URL should not
show.

Is there a way to do this? Do you use another control?

Thoughts?

Jun 13 '06 #2
you could also hide the control in markup ... eg.
<asp:Label runat="server" id="lbl" visible="<%# Eval("AllowedToView")
%>" />

or control it via an ItemDataBound event handler

protected void rpt_ItemDataBound(object sender, RepeaterItemEventArgs
e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
WhateverYouBound ob = e.Item.DataItem as WhateverYouBound;
Label lbl = (Label)e.Item.FindControl("lbl");
lbl.Visible = ob.AllowedToView
}
}

sound good?

Kevin Spencer wrote:
You can use a DataBinding expression that calls a custom function.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

"mikeyatsony" <mi*********@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
Hi all...
I've been training a little on the whole ASP.NET and would like to know
how someone would use the data repeater like this:

For example, I have some data coming from a table and let's say for
some of the rows, I would like to show a website for the company if
they had that level of membership but for others, I would like to HIDE
the website for the company. It could be as easy as a BIT field in the
table like SHOWURL, if checked, it shows, if not, the URL should not
show.

Is there a way to do this? Do you use another control?

Thoughts?


Jun 14 '06 #3

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

Similar topics

0
by: mark | last post by:
My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater to work just fine, as long as it's not...
1
by: VIswanathan S | last post by:
Hi All! How to use Data Repeater in VB.NET? Data Fields are Employee Number Name Photo Date of Joining Salary
2
by: John Holmes | last post by:
I am using radioButton controls in a data repeater and would like to incorporate the 'key' field into the 'id' attribute of the radioButton controls and name them something like: 'rad' + '<%#...
2
by: Steve | last post by:
Hi All I am trying to find a way of displaying data in a datatable in such a way that ALL rows (only about 5 - 10) are editable and are updated from a single button press. I thought the best way...
3
by: Chad A. Beckner | last post by:
Hey all, I have a repeater setup which pulls data from a SQL server. If there is no data, I want to display a message "No Data". How can I do this? Thanks in advance! Chad
8
by: darrel | last post by:
*sigh*...I've asked this before, but have long forgotten the answer. In the past, I'd often use repeater controls, bind data to it, and then reference the data fields from within the repeater: ...
4
by: Joel | last post by:
Hey all- I'm new to asp.net so please bear with me -- I'm attempting to reference the repeater's Container.DataItem outside the repeater object. In other words -- In a seperate sub routine:...
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...
1
by: jeremystein | last post by:
With nested repeaters, how can I access the outer repeater's DataItem from the inner repeater? Here's a snippet from my aspx: <asp:repeater id="OuterRepeater" runat="server"...
3
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...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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...
0
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,...

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.