Creating tables during runtime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello!

I'm trying to figure out how to do the following:

I need to show a table (perhaps using DataGrids, repeaters or others) for
each salesperson in the sales dept. But the no. of tables to be shown is to
be determined during runtime. It's possible that some salespersons have no
sales figures to begin with and therefore no table to show. Thanks in advance
and please help!
 
If you just need to create a datatable

DataTable DT = new DataTable;
DT.Columns.Add("Col Name");

DataRow R;
R = DT.NewRow;
R[0] = "Row 1";
DT.Rows.Add(R);

DataGrid1.DataSource = DT;

Hope that helps. Note: Syntax might not be perfect, converted it over from
VB in my head.

Chris
 
Hi Chris,

If I place a Panel on a Webform, then insert a Table (let's call this Outer
Table - only has one column) inside the Panel, and then insert another Table
(call it Inner Table) in one of the rows of the Outer Table, is there a way
to add new rows for the Outer Table during runtime? If so, is there a way to
replicate what's on the old row to the new row? In other words, is there a
way to copy what's on the existing row and replicate it on the newly added
row? I'm thinking that this is probably a way to add tables using DataGrids
during runtime. Each DataGrid sitting in each row. Thanks in advance.

Newbie


Chris said:
If you just need to create a datatable

DataTable DT = new DataTable;
DT.Columns.Add("Col Name");

DataRow R;
R = DT.NewRow;
R[0] = "Row 1";
DT.Rows.Add(R);

DataGrid1.DataSource = DT;

Hope that helps. Note: Syntax might not be perfect, converted it over from
VB in my head.

Chris



Newbie said:
Hello!

I'm trying to figure out how to do the following:

I need to show a table (perhaps using DataGrids, repeaters or others) for
each salesperson in the sales dept. But the no. of tables to be shown is
to
be determined during runtime. It's possible that some salespersons have no
sales figures to begin with and therefore no table to show. Thanks in
advance
and please help!
 
Back
Top