Urgent! GridView and Templated controls binding. Plz help

S

Shafia

Hi,

My GridView has templated controls in it and I'm binding to an
ObjectDataSource. The problem is it refused to bind to my grid column
"ColumnName" which is also an UpdateCommand Parameter for the
ObjectDataSource. It displays the following error
"DataBinding: 'System.String' does not contain a property with the name
'ColumnName'.
I've also cheched it with FormView and that is not binding either. same
error.

<ItemTemplate>

<asp:Label ID="Label5" runat="server" Text='<%# Eval("ColumnName")
%>'></asp:Label>

</ItemTemplate>



Plz help,

Shafia
 
S

Shafia

Hi,
Can you plz explain what is "Container" the following code gives me an
error

"The Name Label6 does not exist in the current context"

<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text = '<%#
DataBinder.Eval(Label6.DataItem, "ColumnName") %>'
OnDataBinding="Label6_DataBinding"></asp:Label>

</ItemTemplate>



Thanks,

Shafia
 
S

Shafia

Hi,

Please let me know what is the container supposed to be
is this correct?


<%# DataBinder.Eval(Label5.Text, "MyColumn") %>

where Label5 is a Label control on a Column Template for GridView. It
gives me compilation error
Label5 can not be refencened in this context

Thanks
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top