DataGrid - DataBinder.Eval

G

Ganesh

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
([email protected])
 
M

Mike Moore [MSFT]

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.


--------------------
 

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,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top