Binding data to Table

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();
}
 
N

Neven Klofutar

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();
}
 
N

Neven Klofutar

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
 
E

Eliyahu Goldin

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

Eliyahu
 
N

Neven Klofutar

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
 
E

Eliyahu Goldin

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
 
E

Eliyahu Goldin

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

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top