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

datagrid - label - method syntax problem

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.th eID)) %>">Some
Text</asp:Label>
Help please
Charlie
Nov 19 '05 #1
2 1220
Actually BackColor is misleading in the design view of a label, the
background color in the template should be something like
style="background-color: pink"

Note there is a colon right after "color" in the above.
"CharlieOz1" <Ch********@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
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.th eID)) %>">Some
Text</asp:Label>
Help please
Charlie

Nov 19 '05 #2
Charlie,

What id are you trying to pass?

Eliyahu

"CharlieOz1" <Ch********@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
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.th eID)) %>">Some
Text</asp:Label>
Help please
Charlie

Nov 19 '05 #3

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

Similar topics

2
by: Clayton Hamilton | last post by:
I have a DataGrid on a webform bound to a Datasource and can successfully use <ItemTemplate> to create edit/update/cancel functionality for user maintenance of data. I use separate logic to delete...
2
by: Dave Bailey | last post by:
I am trying to dynamically build a DataGrid dynamically. The code runs OK but the DataGrid is never built and displayed. Can someone look at the following code and see if they can determine what...
1
by: Joe Bloggs | last post by:
I am trying display the contents of a table in a web page, select certain rows from that table and then display the fields that I have selected (now table columns) as text in a Label object....
1
by: Webgour | last post by:
Hi, I'm tring to add a column to a datagrid with a linkbutton as header that can be used to sort the column. The column and the linkbutton are added programmatically (see below). However the...
12
by: James Norton-Jones | last post by:
Hi, Am I trying to hold the data of a DataGrid in a label so that when the form is reposted the DataGrid can be repopulated. The problem I am having is that I don't understand how to get the...
1
by: Mike Speak | last post by:
On my page_load, I am populating a Datagrid through the normal manner (which works) before attempting to pick out the items in one column to use in another part of my page. This is all within...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.