p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 (http://p2p.wrox.com/book-professional-asp-net-2-0-server-control-component-development-isbn-978-0-471-79350-2-275/)
-   -   Value must be of type 'GridView' (http://p2p.wrox.com/book-professional-asp-net-2-0-server-control-component-development-isbn-978-0-471-79350-2/71286-value-must-type-gridview.html)

onelittlefonzie November 2nd, 2008 09:53 AM

Value must be of type 'GridView'
Going through the book and I love it.

Just one question.
When I drag the Custom Gridview from ch 18 and 19 on a form I get a designer error saying:
Error 1 gv:Value must be of type 'System.Web.UI.WebControls.GridView'.
Parameter name: component

What is wrong?



mbedell1@msn.com January 19th, 2016 05:58 PM

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.

All times are GMT -4. The time now is 08:17 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.