Wrox Programmer Forums
|
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 April 26th, 2004, 10:36 PM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Easy PostBack Question

I have a datagrid with one template column (for input) and the remainder of the grid being filled out with a datatable and databind - easy. I then realized that I needed more control for formatting and hiding some columns, etc. So I tried setting AutoGenerateColumns = false, using bound columns and setting it up manually. Again, worked beautifully. The catch is that on Postback, the grid is empty (besides the template column)

I tried setting EnableViewState = true, but no luck.

Am I missing something easy? Please?

Paul

 
Old April 26th, 2004, 10:42 PM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Forgot to subscribe...

 
Old May 1st, 2004, 07:16 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Can you post the relevant bits of your code involving how you are populating the grid? By default, the datagrid should persist its source data thru viewstate.
 
Old May 1st, 2004, 08:39 AM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply, I have gotten much further in my testing. Actually, now I don't understand why it ever worked, because I have never changed what I believe the problem must be...

Using a simple (and single) html page, I tried testing my problem and can make it work beautifully every time by either manually generating columns or letting databind do it for me. So I went back to my site and tried to look for differences. The only one I have found so far is that the button causing the postback is a part of a user control and the data grid and this user control are part of a subpage that are embedded in a parent html document.

Are you aware of any problems with children docs or controls having problems with viewstate? If I put a regular button (not a user control in the same page, viewstate is maintained.

If this doesn't help, I'll try making an example page or two and posting them here.

Thanks again for the reply.






Similar Threads
Thread Thread Starter Forum Replies Last Post
hopefully an easy question davehodges Access 1 November 7th, 2007 06:36 AM
Easy Question hexOffender Beginning PHP 2 July 12th, 2006 05:03 AM
Easy Question yikomaka Visual C++ 0 June 13th, 2005 08:50 PM
Easy Question - I think gmoney060 Classic ASP Basics 3 November 2nd, 2004 06:54 PM
easy question khautinh C# 4 August 6th, 2003 01:17 PM





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