Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > ASP, ASP.NET and Coldfusion

ASP, ASP.NET and Coldfusion Microsoft's Web Development Language (ASP/ASP.NET) and Coldfusion discussion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-2006, 02:46 PM
Silverback Silverback is offline
Newbie
 
Join Date: Jul 2006
Posts: 2
Rep Power: 0
Silverback is on a distinguished road
Default Datalist - Stylesheets

I am fairly new to .Net so my appologises if this is a stupid question:

I have just created a datalist with a dataset that is populated. I am having trouble getting the stylesheet parameters recognized.

Code:
                <asp:DataList ID="DataList1" runat="server" CssClass="DefaultClass">
works but it doesnt give me any flexibility for each row.

If I try the following it does not work:

Code:
                <asp:DataList ID="DataList1" runat="server" 
                       HeaderStyle-CssClass="DefaultHeaderRow" 
                       AlternatingItemStyle-CssClass="DefaultAltDetailRow" 
                       ItemStyle-CssClass="DefaultDetailRow" 
                       SelectedItemStyle-CssClass="DefaultDetailRow" 
                       OnSelectedIndexChanged="DataList1_SelectedIndexChanged" >
The properties are available in both Intellisense and on the Properties sheet. I have also found them in several code examples on the web.


I have also tried setting a base stylesheet and overriding each section with another stylesheet -

Code:
                <asp:DataList ID="DataList1" runat="server" CssClass="DefaultHeaderRowTest"
                    OnSelectedIndexChanged="DataList1_SelectedIndexChanged" >

                   <HeaderStyle CssClass="DefaultHeaderRow" />
                    <ItemStyle CssClass="DefaultAltDetailRow" />
                    <AlternatingItemStyle CssClass="DefaultAltDetailRow" />
                    <HeaderTemplate>
Normally I would just brute force add the parms manually but there are a lot of pages in this app.

Any help would be greatly appreciated by this newbie...
Thanks.
SB

EDIT: Added code tags around code so smilies don't appear

Last edited by Jordan; 07-21-2006 at 03:28 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-21-2006, 03:37 PM
Jordan's Avatar   
Jordan Jordan is offline
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Age: 26
Posts: 5,846
Last Blog:
Performance or Maintai...
Rep Power: 20
Jordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud ofJordan has much to be proud of
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan
Default

Have you tried just doing something like:

Code:
<asp:DataList id="DataList1"
runat="server"
cellpadding="2"
cellspacing="2"
borderstyle="inset"
backcolor="#e8e8e8"
width="100%"
headerstyle-font-name="Verdana"
headerstyle-font-size="12pt"
headerstyle-horizontalalign="center"
headerstyle-font-bold="True"
itemstyle-backcolor="#778899"
itemstyle-forecolor="#ffffff"
alternatingitemstyle-backcolor="#e8e8e8"
alternatingitemstyle-forecolor="#000000"
footerstyle-font-size="9pt"
footerstyle-font-italic="True">
EDIT: Moved to ASP.NET Forum for more responses
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog
Don't hesitate to ask any questions that you have! Check out our ASCII Calculator!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-21-2006, 06:53 PM
Silverback Silverback is offline
Newbie
 
Join Date: Jul 2006
Posts: 2
Rep Power: 0
Silverback is on a distinguished road
Default Solution - Kind of...

Thanks Jordan but I dont think the issue was really whether they were in a stylesheet or not. I was able to get it close by adding tables within each template tag,
Ex.
<HeaderTemplate>
<table>
<tr >
<td width="21%" align="left">Domain</td>
<td width="20%" align="left">Pre2K</td>
<td width="40%" align="left">Scope</td>
<td width="18%" align="left">Members</td>
</tr>
<tr >
<td colspan="4">AD Path</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table>
....
</table>
</ItemTemplate>

The problem I now have is that I always have to play with the column widths in both the headers and the rows to get them to match up. By not being in the same table I couldnt get them to always be the same width.

Any other thoughts?
Thanks.
SB
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-24-2006, 09:49 PM
Blaze's Avatar   
Blaze Blaze is offline
Programmer
 
Join Date: Jun 2006
Posts: 117
Rep Power: 9
Blaze is on a distinguished road
Default

You can get them the same width if you use absolute pixel widths instead of percentages.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 10:56 PM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 65%

Ads