DataGrid - DataBinder.Eval

Discussion in 'ASP .Net Datagrid Control' started by Ganesh, Nov 13, 2003.

  1. Ganesh

    Ganesh Guest

    I am using a Datagrid and am populating the column header
    which is being picked up from a database.
    My problem is that if the column name conatins a "."
    within the name then it throws an error as follows

    DataBinder.Eval: 'System.Data.DataRowView' does not
    contain a property with the name The Tools Mfg.
    Error Stack :at
    System.Web.UI.DataBinder.GetPropertyValue(Object
    container, String propName)

    Any help on this issue will be appreciated.
    PLease if anyone reading this help asap as I'm stuck with
    the same.

    Regards,
    Ganesh Mahadevan
    ()
     
    Ganesh, Nov 13, 2003
    #1
    1. Advertising

  2. Hi Ganesh,

    I created a column named a.a and I put some data in it b.b

    Then I setup a datagrid with this binding:
    <%# DataBinder.Eval(Container, "DataItem.a.a") %>
    It failed as you described.

    Then I got it to work by changing the binding function to this
    <%# Container.DataItem("a.a") %>

    I hope this helps.

    Thank you, Mike
    Microsoft, ASP.NET Support Professional

    Microsoft highly recommends to all of our customers that they visit the
    http://www.microsoft.com/protect site and perform the three straightforward
    steps listed to improve your computer’s security.

    This posting is provided "AS IS", with no warranties, and confers no rights.


    --------------------
    > From: (Ganesh)
    > Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridcontrol
    > Subject: DataGrid - DataBinder.Eval
    > Date: 12 Nov 2003 23:00:00 -0800
    > Organization: http://groups.google.com
    > Lines: 18
    > Message-ID: <>
    > NNTP-Posting-Host: 203.199.91.66
    > Content-Type: text/plain; charset=ISO-8859-1
    > Content-Transfer-Encoding: 8bit
    > X-Trace: posting.google.com 1068706800 10604 127.0.0.1 (13 Nov 2003

    07:00:00 GMT)
    > X-Complaints-To:
    > NNTP-Posting-Date: Thu, 13 Nov 2003 07:00:00 +0000 (UTC)
    > Path:

    cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
    e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews1.google.com!no
    t-for-mail
    > Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.datagridcontrol:7427
    > X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridcontrol
    >
    > I am using a Datagrid and am populating the column header
    > which is being picked up from a database.
    > My problem is that if the column name conatins a "."
    > within the name then it throws an error as follows
    >
    > DataBinder.Eval: 'System.Data.DataRowView' does not
    > contain a property with the name The Tools Mfg.
    > Error Stack :at
    > System.Web.UI.DataBinder.GetPropertyValue(Object
    > container, String propName)
    >
    > Any help on this issue will be appreciated.
    > PLease if anyone reading this help asap as I'm stuck with
    > the same.
    >
    > Regards,
    > Ganesh Mahadevan
    > ()
    >
     
    Mike Moore [MSFT], Nov 13, 2003
    #2
    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. Don Pedro
    Replies:
    0
    Views:
    485
    Don Pedro
    Jul 3, 2003
  2. Simon Storr

    Complete syntax of DataBinder.Eval() ?

    Simon Storr, Jul 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    424
    Simon Storr
    Jul 30, 2003
  3. MS
    Replies:
    0
    Views:
    3,234
  4. Eric Newton
    Replies:
    3
    Views:
    9,550
    Brock Allen
    Apr 4, 2005
  5. DataBinder.Eval and Eval.

    , Jun 16, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    572
    Karl Seguin [MVP]
    Jun 16, 2006
Loading...

Share This Page