Binding data to Table

  • Thread starter Thread starter Neven Klofutar
  • Start date Start date
N

Neven Klofutar

Hi,

How can I bind data to System.Web.UI.WebControls.Table control ?

I put a Table objet in the Form.
Then I create Table object in Page_Load (I fill Table with data), and then
I'm trying to bind data from CS code, to Table object in the Form.

ASPX
*****
<asp:Table id="table" runat="server"></asp:Table>

CS
***
protected System.Web.UI.WebControls.Table tableForm;
....
Page_Load() {

Table table = new Table();

... fill table ...

tableForm = table;
tableForm.Databind();
}
 
Correction ...



Hi,

How can I bind data to System.Web.UI.WebControls.Table control ?

I put a Table objet in the Form.
Then I create Table object in Page_Load (I fill Table with data), and then
I'm trying to bind data from CS code, to Table object in the Form.

ASPX
*****
<asp:Table id="tableForm" runat="server"></asp:Table>

CS
***
protected System.Web.UI.WebControls.Table tableForm;
....
Page_Load() {

Table table = new Table();

... fill table ...

tableForm = table;
tableForm.Databind();
}
 
No reason ...
In the begging Table seemed like a nice thing ... I'm thinking of rewriting
everything for mentinated controls, but if I can manage with Table it would
be great.

thanx, Neven
 
What is the reason for using a Table rather than one of
Datagrid/Datalist/Repeater?

Eliyahu
 
OK,

but I need to create the following output, how can I do it using
DataList/DataGrid/Repeater

Title 1
- option 1.1
- option 1.2
- option 1.3
Title 2
- option 2.1
- option 2.2
Title 3
- option 3.1
- option 3.2
- option 3.3
- option 3.4


Thanx, Neven
 
Neven,

Table is a container. What do you want to databind? The literal content of
the cells? If you think about it, you will logically come to a
datagrid-based solution.

Eliyahu
 
Hard to say without knowing anything about what is "Title" and what is
"option".

Eliyahu
 
Back
Top