View Single Post
  #2 (permalink)  
Old January 19th, 2016, 05:58 PM
mbedell1@msn.com mbedell1@msn.com is offline
Registered User
Points: 55, Level: 1
Points: 55, Level: 1 Points: 55, Level: 1 Points: 55, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2014
Location: Colorado
Posts: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Default Custom Gridview from ch 18 and 19

This problem is related to the Designer attribute. The line of code in question is in GridView.cs and is written as [DesignerAttributre("system.Web.UI...")]
If you rem this line out the error will go away but then you will get an error stating that the "...DataRowView does not expose the BookID field". If you remove the DataKeyNames="BookID" from the tool that problem will go away and the tool will appear as it should.

I don't believe that these are the solutions to the problems and I have tried to find the correct answer for both them. I consider my "fixes" more as workarounds than fixes. It's possible that earlier versions of Visual Studio (i.e. 2005) needed the design attribute and later versions (i.e. 2010 and up) don't need it or need something else instead. I can't find a list of possible values and the internet talks more about attributes I already know about than this one.

Let me know if you found/find anything out about this.