No "bordercolorlight" or "bordercolordark" table attributes with DataGrid ??

J

Jim Moon

I'm trying to get the same look and feel from a new ASPX page that I have in
some older ASPs. They run side-by-side in a website.

How do I get the <asp:DataGrid> to write the "bordercolordark" and
"bordercolorlight" table attributes that I'm accustomed to using?

Thanks,
Jim
 
J

Jim Moon

Furthermore, how do you assign align="center" and other such attributes to
individual columns?

Jim
 
E

Eliyahu Goldin

The easiest approach is to leave your table with all attributes as it is and
to use a Repeater bound to your datasource with ItemTemplate ressembling the
rows. You can use HeaderTemplate for the header. Something like this:
<table width="100%" cellspacing="1">

<colgroup span=3 class=TabGridItem></colgroup>

<asp:Repeater Runat="server" id="dgActivity" DataMember="tblActivity"
OnItemDataBound="dgActivity_ItemDataBound">

<HeaderTemplate>

<tr>

<td class=TabGridHeader>Date</td>

<td class=TabGridHeader>Event</td>

<td class=TabGridHeader>User</td>

</tr>

</HeaderTemplate>

<ItemTemplate>

<tr runat="server" id="trAct">

<td><%# ((System.Data.DataRowView)Container.DataItem)["Date"] %></td>

<td><%# ((System.Data.DataRowView)Container.DataItem)["Event"] %></td>

<td><%# ((System.Data.DataRowView)Container.DataItem)["User"] %></td>

</tr>

</ItemTemplate>

</asp:Repeater>

</table>


I use this techigue quit a lot when I first make an html proptotype and than
turn it into an aspx page.

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top