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
 
B

Brock Allen

ObjectDataSource. It displays the following error
"DataBinding: 'System.String' does not contain a property with the
name 'ColumnName'.

Sounds like what you're databinding to is a String.
 
S

Shafia

Yes I'm binding to a string type "UpdateCommandParameter" of
"ObjectDataSource".
Please tell me what am I doing wrong

<ItemTemplate>

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

</ItemTemplate>

Even the following doesnt work


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

</ItemTemplate>


Thanks,
Shafia
 

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