Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 19th, 2003, 11:09 PM
Authorized User
 
Join Date: Oct 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGrid Not Visible at RunTime

I created a new form and dragged a Datagrid onto it. When I build and browse, the DataGrid does not show up. When I view the HTML source this appears instead.

<input type="hidden" name="__VIEWSTATE" value="dDwzMjcyNDM2ODY7dDw7bDxpPDE+Oz47bDx0PDtsPGk 8MT47PjtsPHQ8QDA8cDxwPGw8XyFEYXRhU291cmNlSXRlbUNvd W50O18hSXRlbUNvdW50O1BhZ2VDb3VudDtEYXRhS2V5czs+O2w 8aTwtMT47aTwtMT47aTwwPjtsPD47Pj47Pjs7Ozs7Ozs7Ozs+O zs+Oz4+Oz4+Oz4Du5SAp+LfNFt3kebSrRSIHcjNMg==" />

I even set the EnableViewState = True for the DataGrid and set the Page.EnableViewState = True in the PageLoad.

Does anyone have any idea why this control is not showing up?

 
Old November 20th, 2003, 05:45 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

A DataGrid is a databound control. That is, it needs a DataSource to determine which data it must display. If you don't provide a DataSource (you need to set one through the Properties Grid in Visual Studio .NET or through code) the control has no data, and will not show itself (after all, what's there to display).

Also, make sure you haven't set the visible property. A control with its visible property set to false will no render any output in the source of the HTML page.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy visible cells in a macro?Runtime 438 error? nbaj2k Excel VBA 2 April 7th, 2010 11:13 AM
certain columns of a row in datagrid visible false nanu yaru VS.NET 2002/2003 0 March 31st, 2008 08:27 AM
to make checkboxes visible in datagrid C# windows bhavna General .NET 1 March 5th, 2007 10:41 AM
Runtime Scrollbar In Datagrid monika.vasvani ASP.NET 1.0 and 1.1 Professional 3 December 1st, 2006 07:03 AM
Adding items to datagrid at runtime hisham_abu General .NET 1 August 24th, 2005 02:11 AM





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