difference between these 2?

J

Jay

In some examples I am looking through they are speaking of datagrids
and datalists (this is not the question :)

For the datalist a column is populated using
<%# Databinder.Eval(container.Dataitem, "some column") %>
For the datagrid...
<asp:Boundcolumn Datafield="some column" />

Is there any difference between the 2?
I'm assuming that both are saying look at the recordset (sorry classic
asp terminology :), find this column data and populate this column
with it?

Are they specific to the 2 controls or can they be mixed and matched?
Advantages/disadvantages of either?
Sorry to be vague, just trying to get my head around them.
 
J

Jos

Jay said:
In some examples I am looking through they are speaking of datagrids
and datalists (this is not the question :)

For the datalist a column is populated using
<%# Databinder.Eval(container.Dataitem, "some column") %>
For the datagrid...
<asp:Boundcolumn Datafield="some column" />

Is there any difference between the 2?
I'm assuming that both are saying look at the recordset (sorry classic
asp terminology :), find this column data and populate this column
with it?

Are they specific to the 2 controls or can they be mixed and matched?
Advantages/disadvantages of either?
Sorry to be vague, just trying to get my head around them.

A BoundColumn will automatically generate a label for
the item, and a TextBox when the item is in Edit mode.

You can use the first type of explicit databinding also in a
datagrid. You then put it in a TemplateColumn.

The disadvantage of a BoundColumn is that you don't have any
control about the layout, because it is automatic. For instance,
you can't set the width of the TextBox in Edit mode.
The advantage is that it's all automatic, you can get the datagrid
working in a minute.
 

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

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top