Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > asp:label width

Reply
Thread Tools

asp:label width

 
 
Robert
Guest
Posts: n/a
 
      01-12-2006
I need to set the width of an asp:label at runtime based on the length of the
data going into the cell of the grid. Below is my code:

<asp:TemplateColumn HeaderText="Patient Name">
<ItemTemplate>
<asp:Label id="lblPatName" runat="server" width="150px"
CssClass="standard-label" Text='<%# DataBinder.Eval(Container,
"DataItem.pat_name") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>

I need to set the width based on the length of the patients name. Is this
possible?

Thanks in Advance
--
Robert Hill

 
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
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM
JComboBox width, dropdown list width Xu Java 11 07-15-2005 11:54 PM
min-width max-width again Paul Furman HTML 10 02-09-2004 06:20 PM
Table width and columns width kris HTML 11 11-18-2003 06:49 AM
Re: resized image in table extends table width to original image width Sean Jorden HTML 1 08-19-2003 08:59 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57