You can use the ItemDataBound Event, and cast your Item as its Object.
Then set a Label in your repeater to that string returned by the method
So Repeater:
<asp:Repeater id="rpt">
<ItemTemplate>
<asp:Label id=lbl runat="server"></asp:Label>
<ItemTemplate>
</asp:Repeater>
In your code behind
private void rpt_OnItemDataBound(object Sender, RepeaterItemEventArgs e)
{
if(e.Item.ItemTemplate != ListItemType.Header && e.Item.ItemTemplate
!= ListItemType.Footer)
{
//Lets say your Object is name MyObject
MyObject thisObject = (MyObject)e.Item.DataItem; //This is
sometimes a bit tricky, hope its right
string StrFromMethod = thisObject.GetStringMethod();
((Label)e.Item.FindControl("lbl")).Text = StrFromMethod;
}
}
HTH
"ChrisA" <Ch****@discussions.microsoft.com> wrote in message
news:7E**********************************@microsof t.com...
I have an array of objects I'm binding to a Repeater. Unfortunately, I
need to bind to the value returned from a method, while Eval() only seems
to
work on Properties.
Is there a way to do this?
Can I intercept an Event to provide a value?