Can't center a checbox in a datagrid column

J

John Dalberg

I am trying to center a checkbox in a datagrid column but the checkbox
always displays to the right. Below is the rendered html. I also used a
css-class with the same text-align: center attribute. The checkbox is used
in a TemplateColumn. Any ideas?

Also since a datagrid is rendered as an html table, how do I put custom
attributes in the <TD> tags since these tags are not in my aspx page?

Thanks.

<td>
<span style="text-align: center;"><input
id="dgLists__ctl3_active" type="checkbox"
name="dgLists:_ctl3:active" checked="checked" /></span>

</td>

John Dalberg
 
T

Teemu Keiski

And setting ItemStyle-HorizontalAlign="Center" to the TemplateColumn doesn't
produce what you are looking for?
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top