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

Discussion in 'ASP .Net Web Controls' started by Shafia, Apr 13, 2005.

  1. Shafia

    Shafia Guest

    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
     
    Shafia, Apr 13, 2005
    #1
    1. Advertising

  2. Shafia

    Brock Allen Guest

    > 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
     
    Brock Allen, Apr 13, 2005
    #2
    1. Advertising

  3. Shafia

    Shafia Guest

    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



    "Brock Allen" <> wrote in message
    news:...
    > > 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
    >
    >
    >
     
    Shafia, Apr 13, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shafia
    Replies:
    2
    Views:
    2,641
    Shafia
    Apr 14, 2005
  2. Replies:
    0
    Views:
    2,252
  3. sanju
    Replies:
    1
    Views:
    6,164
    Islamegy®
    Aug 6, 2006
  4. Replies:
    1
    Views:
    401
  5. Shafia

    Urgent! GridView and templated controls binding. Plz help

    Shafia, Apr 13, 2005, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    108
Loading...

Share This Page