datagrid question for the day....

G

Guest

i have a series of datagrids on a webform. it worked fine until i converted
one column to a template. My guess is i'm blanking on something, but that's
the problem with blanking, ...nothing....
ok now i get a "Expression does not produce a value" error when i run the
project.
What's going on? I know i've done this before...
 
G

Guest

ok, check it out:

this is what studio put in there:
<asp:TemplateColumn HeaderText="trkSite">
<ItemTemplate>
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.trkSite") %>'>
</asp:Label>
</ItemTemplate>

but had to change it to this to get it to work:
<asp:TemplateColumn HeaderText="trkSite">
<ItemTemplate>
<asp:Label runat="server" Text='<%# Container.DataItem("trkSite") %>'>
</asp:Label>
</ItemTemplate>

what's the deal?
 
M

mpraneetha

i would do
<asp:Label runat="server" Text='<%#
DataBinder.Eval(Container.DataItem,
"trkSite") %>'>

container.dataitem...
 
G

Guest

thanks for replying and for the code snipit,
my question is why doesn't vs.net convert the item to a template correctly?
thnaks
kes
 

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,046
Latest member
Gavizuho

Latest Threads

Top