Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 1st, 2004, 01:41 PM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple and Dynamic DataGrids

Ok, I am slowly progressing along at the design of my application and here is the problem. I will have multiple datagrids on a page. Each data grid will be the same in structure, but seperate from the others due to user requirements of collabsibility, totalling, etc. Now the database will determine how many datagrids I will need to display. I have read about doing this programatically; but, in addition to the datagrids I need to display a bunch of descriptive text for each datagrid. What is the best way to do this in a loop like strucutre? I have thought about trying to use the repeater and in each iteration create the datagrid and all that stuff, except that seems kind of strange. Any help would be great, thanks.

 
Old April 3rd, 2004, 08:29 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Definitive answer: It depends.

A repeater is more than acceptable presuming that you have something you can bind it to. If the grids are going to show data that are children of some other data, then it makes perfect sense to build a repeater that binds to the parent data (that's your outer loop) and then the grid withing the repeater template (which also contains the text elements) binds to child data.

Take a look at this sample for the general idea. It has a datagrid that contains a dropdownlist, but the theory and technique will be the same for a datagrid within a repeater. You will most likely need to do much customization of each individual grid based on the various requirements. You can tap into the datagrid's "ItemCreated" event so you can manipulate the various parts of each grid when each item of the grid is created (i.e. the header, item/alternate item, footer).

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Menus - Using multiple dropdown boxes Sebastiaan ASP.NET 1.0 and 1.1 Basics 1 April 18th, 2007 06:25 AM
multiple dynamic checkboxes mlog Classic ASP Basics 0 February 14th, 2004 04:49 AM
Dynamic Menu - Using multiple dropdown boxes Sebastiaan Javascript How-To 2 December 1st, 2003 05:36 AM
Dynamic Menu - Using multiple dropdown boxes Sebastiaan Classic ASP Basics 3 June 7th, 2003 06:38 AM





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