datagrid - label - method syntax problem

C

CharlieOz1

Hi,

I am having trouble with the datagrid.
I have a label in an ItemTemplate.
I have a simple function in the label which I have tested and works
(the function does pass back a system.drawing.colour)

I do not know the syntax to pass "theID" into this function!

I am trying stuff like

<asp:Label id="lblName" runat="server" BackColor="<%#
functionName(Container.DataItem) %>">Some Text</asp:Label>
and
<asp:Label id="lblName" runat="server" BackColor="<%#
functionName(Container.DataItem.theID) %>">Some Text</asp:Label>
and
<asp:Label id="lblName" runat="server" BackColor="<%#
functionName(DataBinder.Eval(Container, "DataItem.theID")) %>">Some
Text</asp:Label>
and
<asp:Label id="lblName" runat="server" BackColor="<%#
functionName(DataItem.theID) %>">Some Text</asp:Label>
and
<asp:Label id="lblName" runat="server" BackColor="<%#
functionName(DataBinder.Eval(Container.DataItem.theID)) %>">Some
Text</asp:Label>


Help please
Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top