473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Dynamic Tables

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
1 2363
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
2
by: MacKenzieMouse | last post by:
I have been struggling with creating dynamic tables populated with rows and cells the top row has one cell with a label the next row has four cells with a label each the last row has 4 cells...
7
by: CanoeGuy | last post by:
I have been trying for the last two weeks to display a dynamic DataGrid. The data that I'm pulling from a SQL Server DB will have whole columns that will be either NULL or 0. I want to display...
3
by: piscogirl | last post by:
Hi there, I am about to build a small db in Access. Among the tables I plan to have are a Person table, an Event table, and an EventRegistration table. The EventRegistration table will...
13
by: salad | last post by:
Operating in A97. I didn't receive much of a response conserning Pivot tables in Access. Pivot tables are nice, but a CrossTab will work for me too. Using a Pivot table, one is actually...
4
by: Chris | last post by:
Can't seem to figure out how to do this and have been reading for some time now...... I want to select a row count from a table name in SYSTABLES. This statement does not return what I needed,...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
0
by: KA NMC | last post by:
I have a dataGrid that is populated by SQL table. The Datagrid has two dynamic columns - that I created to for calculations. I want to sort the grid on frmload by one of the dynamic columns is that...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.