Wrox Programmer Forums
BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Server Control and Component Development by Dr. Shahram Khosravi; ISBN: 9780471793502
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 2nd, 2008, 09:53 AM
Registered User
Join Date: Nov 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?


Old January 19th, 2016, 05:58 PM
Registered User
Join Date: Oct 2014
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.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM
Schema derived type and the base type bonekrusher XML 5 January 8th, 2008 09:04 AM
Guidelines Item 3: Replace System.Type with Type Ixtlia BOOK: Professional .NET 2.0 Generics 0 August 19th, 2007 04:09 AM
Conversion from type 'DBNull' to type 'String' is GailCG ASP.NET 2.0 Basics 5 February 22nd, 2007 03:12 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.