Use of Data Web Controls

G

Guest

Hello All:

I populate a datatable and want to display information in a table on a
webform. The information in a single row within the table, however, is not
necessarily located in a single datarow within the datatable. It may be in
two or more datarows.

Can I use any of the three web controls (repeater, datalist or datagrid) to
render the table in which the data displayed in a row comes from more than
one datarow?

My impression is that these control s are designed to "show one record at a
time" instead of allowing the developer to merge information into a table row
from more than one record.

Any insights are welcome.

TIA,
 
M

Marina Levit [MVP]

All those controls are designed to do something for every row. With the
option of doing something doing for alternating rows. But that's about it.

It's hard to imagine writing a generic control that can bind to data, but
can somehow treat sets of rows as one display row. And being able to allow a
generic way for the developer to specify how to figure out what the sets of
rows are, and how to handle each set to still render one visible row in the
control.

My recommendation would be to manipulate your data into being a 1 to 1
between the datarow and the control row if you want to use the built in web
controls. Or, I think you are on your own regarding displaying your data.
You would have to create dynamic controls manually and add them to your
page.
 
E

Eliyahu Goldin

Joe,

Theoretically you can use PreRender event to go through the fully built web
control, merge several rows into one and hide the ones you used up for
merging. But I would take a cleaner way of creating another datatable with
merged data and databinding to this table.

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

Top