Can 2 columns of a DataGrid have a single heading OR can I have two controls in 1 column?

M

mark4asp

This page is currently using a Repeater control to create a table with
6 columns. The first column has 2 ImageButton controls and a common
header.

How can I do this with a DataGrid ? I need either 7 columns in my
DataGrid with a shared column heading for the first two columns OR I
need 6 columns with the first DataGrid column showing two small
ImageButtons side-by-side.

PS: I need to use the DataGrid's ItemDataBound event e.g.
<http://www.codeproject.com/aspnet/ItemCreated.asp> - so I really need
to use a DataGrid and the HTML must look near identical afterwards.
 
S

sloan

When you need more control of the output, the repeater (asp:repeater) is a
better choice.

You can easily code up a

<th colspan='2'> </th>

in a repeater.

DataGrid = flexible and fast, but little control over the output
Repeater = more time to code up, but more control over the output.

..........
 
J

Jasbird

When you need more control of the output, the repeater (asp:repeater) is a
better choice.

You can easily code up a

<th colspan='2'> </th>

in a repeater.

DataGrid = flexible and fast, but little control over the output
Repeater = more time to code up, but more control over the output.

.........

Thanks,

My real problem is that I need to include a username as a parameter to a
client-side javascript function in an event handler for one of the table
columns. That involves nesting javascript quotes in HTML quotes which
are all conflicting with the quotes needed by the server tag. I want
this as an event, with Joe Doe coming from the dataset:

onclick="return confirm('Are you certain you want to delete: Joe
Doe');"

You'd think something that simple would be easy! The ItemDataBound event
looked like a solution to my problem.

Message-ID: <[email protected]>
 

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
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top