Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 24, 2013 01:46 PM by Rion Williams
Member
310 Points
340 Posts
Jan 24, 2013 12:06 PM|LINK
Hi, I am trying to hide a text from overflowing and also hide it completely (not break) but I did this with no success, the text will break into another line instead, can someone assist. Thanks:
<asp:TemplateField HeaderText="Subject" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" SortExpression="MsgTitle" ItemStyle-Width="50%"> <ItemTemplate> <div style="cursor: pointer; overflow:hidden;" onclick=" getmessage('<%#Eval("AutoId") %>'); "><asp:Label ID="lblMsgTitle" Style=" overflow:hidden;" runat="server" Text='<%#Eval("MsgTitle") %>'></asp:Label></div> </ItemTemplate> </asp:TemplateField>
All-Star
27112 Points
4487 Posts
Jan 24, 2013 12:49 PM|LINK
If you want the text to not wrap and instead be "hidden" by your overflow property, try using the CSS whitespace: nowrap property :
<div style="cursor: pointer; overflow:hidden; white-space: nowrap;" ... > <asp:Label ID="lblMsgTitle" Style=" overflow:hidden; white-space: nowrap;" ... ></asp:Label> </div>
4 Points
2 Posts
Jan 24, 2013 01:19 PM|LINK
Try this
<div style="text-overflow : ellipsis; overflow: hidden; width: 55px; overflow-y: hidden; height:37px"> <asp:Label ID="lblMsgTitle" runat="server" Text='<%#Eval("MsgTitle") %>' Width="55px"></asp:Label> </div>
Jan 24, 2013 01:46 PM|LINK
@SoftwareDeveloper
You don't really need the second overflow property in there (overflow-y: hidden;) as overflow : hidden; takes care of that.
k80sg
Member
310 Points
340 Posts
Hiding the text of a overflow label inside TemplateField
Jan 24, 2013 12:06 PM|LINK
Hi, I am trying to hide a text from overflowing and also hide it completely (not break) but I did this with no success, the text will break into another line instead, can someone assist. Thanks:
<asp:TemplateField HeaderText="Subject" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" SortExpression="MsgTitle" ItemStyle-Width="50%"> <ItemTemplate> <div style="cursor: pointer; overflow:hidden;" onclick=" getmessage('<%#Eval("AutoId") %>'); "><asp:Label ID="lblMsgTitle" Style=" overflow:hidden;" runat="server" Text='<%#Eval("MsgTitle") %>'></asp:Label></div> </ItemTemplate> </asp:TemplateField>Rion William...
All-Star
27112 Points
4487 Posts
Re: Hiding the text of a overflow label inside TemplateField
Jan 24, 2013 12:49 PM|LINK
If you want the text to not wrap and instead be "hidden" by your overflow property, try using the CSS whitespace: nowrap property :
<div style="cursor: pointer; overflow:hidden; white-space: nowrap;" ... > <asp:Label ID="lblMsgTitle" Style=" overflow:hidden; white-space: nowrap;" ... ></asp:Label> </div>SofwareDevel...
Member
4 Points
2 Posts
Re: Hiding the text of a overflow label inside TemplateField
Jan 24, 2013 01:19 PM|LINK
Try this
<div style="text-overflow : ellipsis; overflow: hidden; width: 55px; overflow-y: hidden; height:37px"> <asp:Label ID="lblMsgTitle" runat="server" Text='<%#Eval("MsgTitle") %>' Width="55px"></asp:Label> </div>Rion William...
All-Star
27112 Points
4487 Posts
Re: Hiding the text of a overflow label inside TemplateField
Jan 24, 2013 01:46 PM|LINK
@SoftwareDeveloper
You don't really need the second overflow property in there (overflow-y: hidden;) as overflow : hidden; takes care of that.