Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 May 5th, 2004, 09:44 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid control - Dynamic columns

We have a datagrid control on a web form with 2 fixed cols. and we dynamically add a different amount of columns each time we load the page. While still in the procedure that creates these columns, we are able to manipulate the columns and add controls to the specific column we choose. (at this point grid.column.count is correct and reflects all columns, including the dynamic ones)
However, once the page is fully loaded and displayed (the grid looks great), the user is able to edit the controls in the one specific column, but upon hitting save, only the two fixed columns are recognized by the code, and the grid.column.count property is equal to 2.

How do we reference dynamic columns on a datagrid from a cmdbutton (or anywhere else) after the page has been shown?
 
Old June 25th, 2004, 06:58 PM
Registered User
 
Join Date: Jun 2004
Location: Juneau, AK, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to brandonwood Send a message via MSN to brandonwood Send a message via Yahoo to brandonwood
Default

I have been having this same problem, does anyone know how to do this?
 
Old September 21st, 2004, 12:05 PM
Registered User
 
Join Date: Sep 2004
Location: Boone, NC, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You have to recreate the columns on postback so that the codebehind is aware that they exist.

Only design time columns are accessible each round trip.

Thanks,

Hal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Columns tray99 XSLT 2 July 29th, 2008 01:25 PM
Dynamic creation of Columns in datagrid p330418 ASP.NET 2.0 Basics 0 March 29th, 2008 07:33 AM
Dynamic Columns & Dynamic Grouping ??? nileshgambhava BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 1 March 24th, 2008 07:58 AM
Dynamic columns pankaj_daga Crystal Reports 1 August 30th, 2007 11:07 AM
Dynamic Columns & Dynamic Grouping ??? nileshgambhava SQL Server 2005 0 December 12th, 2006 12:45 AM





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