Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Formatting a DataList ItemTemplate using CSS

Reply
Thread Tools

Formatting a DataList ItemTemplate using CSS

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      10-14-2006
I have a DataList with the following ItemStyle and ItemTemplate:

<ItemStyle VerticalAlign="Top"/>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text="Label1" Width="300px"
style="word-wrap:normal;"/>
<asp:Label ID="Label2" runat="server" Text="Label2"
style="float:left;word-wrap:break-word;"/>
<asp:Button ID="Button1" runat="server" Text="Button1" style="float:right;"
Width="125px"/>
</ItemTemplate>

I want the output to be similar to the following:

Label1 Label2 Label2 Label2
Label2 Label2 Button1
Label2 Label2
Label2 Label2 Label2
Label2 Label2
Label2 Label2 Label2
Label2 Label2
Label2 Label2 Label2
Label2 Label2
Label2

What this is is a fixed-width label, a variable-width label that might wrap,
and a button. I want the variable-width label to take up the space between
the fixed-width label and the button, and I want the button to always be
right-aligned. What would be the best way to do this in an aspataList's
ItemTemplate? Thanks.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting a DataList ItemTemplate using CSS Nathan Sokalski ASP .Net Web Controls 0 10-14-2006 06:24 AM
Formatting a DataList ItemTemplate using CSS Nathan Sokalski ASP .Net 0 10-14-2006 06:24 AM
Using a Custom Server Control inside an ItemTemplate in DataList Charlie@CBFC ASP .Net 2 05-18-2006 04:25 PM
Using Custom Server Control inside ItemTemplate in DataList Charlie@CBFC ASP .Net 0 05-17-2006 04:17 PM
can code inside a Repeater's ItemTemplate modify controls in the ItemTemplate? Bennett Haselton ASP .Net 1 09-24-2004 01:59 AM



Advertisments