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?