Home All Groups Group Topic Archive Search About

Urgent! GridView and templated controls binding---------Plz help

Author
13 Apr 2005 8:35 AM
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

Author
13 Apr 2005 2:19 PM
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Author
13 Apr 2005 2:45 PM
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



Show quoteHide quote
  "Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:448013632489843756231440@msnews.microsoft.com...
  > > 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.
  >
  > -Brock
  > DevelopMentor
  > http://staff.develop.com/ballen
  >
  >
  >