Two rows for each record in DataGrid

H

Hrvoje Vrbanc

Hello all,

I have posted similar question in another group a while ago (before this
group came into existence) but would like to double-check on dedicated
DataGrid group:

is it anyhow possible to make Datagrid display one database record using two
rows? I'd like my DataGrid to display certain columns from the database in
one row and then the next colum in the row below that would have spanned
columns, similar to the example below:

ID Name Surname

1 Hrvoje Vrbanc
Web Developer

2 Test Test
Database Engineer

etc...

I know I can accomplish that with DataList but I'm curious is there any way
to make DataGrid behave this way.

Thank you in advance,
Hrvoje
 
J

Jos

Hrvoje said:
Hello all,

I have posted similar question in another group a while ago (before
this group came into existence) but would like to double-check on
dedicated DataGrid group:

is it anyhow possible to make Datagrid display one database record
using two rows? I'd like my DataGrid to display certain columns from
the database in one row and then the next colum in the row below that
would have spanned columns, similar to the example below:

ID Name Surname

1 Hrvoje Vrbanc
Web Developer

2 Test Test
Database Engineer

etc...

I know I can accomplish that with DataList but I'm curious is there
any way to make DataGrid behave this way.

Thank you in advance,
Hrvoje

You can use one cell in the DataGrid as a container for a HTML table
with 2 rows and 2 columns, the second row spanning two columns.

You can achieve this by using a TemplateColumn, in which you
put the HTML for the table. Also add the <%# %> binding blocks
for the 3 data fields (in the same TemplateColumn).
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top