Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple dynamically generated columns for DataGrids

Status
Not open for further replies.

TeaAddictedGeek

Programmer
Apr 23, 1999
271
US
Not sure if this is a C# or ASP.NET question--it'd depend on the solution. So I'm posting to both places with apologies.

I'm looking to find a way to make the datagrid bleed over into multiple columns. I'd create multiple datagrids but this needs to be dynamic as I won't know how many I need.

It'd be something like this, where you have multiple grid lists:


Foo1 ... Foo2 ... Foo3
Col1 Col2 Col3 ... Col1 Col2 Col3 ... Col1 Col2 Col3


I'm looking into things like repeaters but I've never seen them used with datagrids. Maybe someone here has some insights into solving this?


Thanks!

"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum
 
hi,

Just some questions: Foo's are the grids? And each foo's column defs are fixed, but the number of foo's is variable?
 
The foos are the different columns of repeated data, and it's completely dynamic.

Say I was doing a page on fruits, for instance:

Apples Oranges Bananas
price color price color price color
$.99 red $1.19 orange $.50 yellow

I could have just apples, or apples and oranges, or apples, oranges, and bananas. I could add a fruit later or subtract. Problem is that I have repetative columns and data for each and am looking to generate them in an easy to view table format.

Make more sense now? :)

"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs."
-Joseph Weizenbaum
 
afaik go for repeaters. It's the first thing that popped out of my mind after understanding your sample. :) I find it easier to play around with different and even complex table displays/layouts using repeaters than with datagrids.

(Btw, this forum is general C# and WinForms forum. [wink] Just wanted to drop my opinion on this anyway. )

ciao
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top