By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,659 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,659 IT Pros & Developers. It's quick & easy.

Dynamic Tables

P: n/a
I used to develop with Classic ASP. Now I'm learning ASP.NET

I used to create tables 'on-the-fly' using recordsets. My code
would loop through the recorset.Fields to make the headers.
If I added a field to the table, I didn't have to update my code.
I liked the fact that I could test for a field.name to customize
a column title if I wanted to. Same goes for the rows, I often inserted
something in the cells of certain columns (textboxes, links, etc.)

Correct me if I'm wrong, but the only way I have found to achive this
is by using a Repeater. I would appreciate your opinions on any other
way to do this.

The problem with the repeater (to my best knowledge) is that you have
to know the fields of the table beforehand. The DataGrid doesn't cut it because I
still want to modify a title if it matches certain name and insert something
on the row cell if it is part of that column. Any way to dynamically create
a table regardless of the fields?

Thanks in advance.

-----------------------------
Note: I got this answer but the problem is that it seems like 'going backwards'
because I'd be using ASP.NET the same way as Classic ASP

"You can using place holder tag in where you'd like to place table, and
dynamic generate HTML content based-on recordsets, and assign that content
(string) to place holder's innerHTML property."
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Carlos,
Using AutoGenerateColumns="true" can make your datagrid show all the
columns from a datasource without
specifying columns separately.
You can customize things in the Itemdatabound,ItemCreated etc.
events of the datagrid.
here is a link for datagrid events :

http://msdn.microsoft.com/library/de...boundtopic.asp
You can create templates programmatically depends on your needs as well.
Here is another link for that..

http://msdn.microsoft.com/library/de...ridcontrol.asp

Hope this helps.
Regards,
Marshal Antony
http://www.dotnetmarshal.com

"Carlos Gomez" <co********@yahoo.com> wrote in message
news:84**************************@posting.google.c om...
I used to develop with Classic ASP. Now I'm learning ASP.NET

I used to create tables 'on-the-fly' using recordsets. My code
would loop through the recorset.Fields to make the headers.
If I added a field to the table, I didn't have to update my code.
I liked the fact that I could test for a field.name to customize
a column title if I wanted to. Same goes for the rows, I often inserted
something in the cells of certain columns (textboxes, links, etc.)

Correct me if I'm wrong, but the only way I have found to achive this
is by using a Repeater. I would appreciate your opinions on any other
way to do this.

The problem with the repeater (to my best knowledge) is that you have
to know the fields of the table beforehand. The DataGrid doesn't cut it because I still want to modify a title if it matches certain name and insert something on the row cell if it is part of that column. Any way to dynamically create a table regardless of the fields?

Thanks in advance.

-----------------------------
Note: I got this answer but the problem is that it seems like 'going backwards' because I'd be using ASP.NET the same way as Classic ASP

"You can using place holder tag in where you'd like to place table, and
dynamic generate HTML content based-on recordsets, and assign that content
(string) to place holder's innerHTML property."

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.