By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,000 Members | 1,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,000 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

Nov 10 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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.

..........


"mark4asp" <ma******@gmail.comwrote in message
news:11**********************@f16g2000cwb.googlegr oups.com...
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.

Nov 10 '06 #2

P: n/a
On Fri, 10 Nov 2006 10:27:04 -0500, "sloan" <sl***@ipass.netwrote:
>
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.

.........


"mark4asp" <ma******@gmail.comwrote in message
news:11**********************@f16g2000cwb.googleg roups.com...
>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.
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: <11**********************@h48g2000cwc.googlegroups .com>
Nov 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.