label or textbox for a multiline text?

vagelis

Member
Joined
Nov 7, 2009
Messages
8
Programming Experience
Beginner
i want to display a multiline text in a datagrid

i try with a textbox and with a label
but with the textbox
<asp:textbox ID="textbox1" runat="server" style="overflow:hidden" Font-Size="15px" BackColor="#FFFFC0" TextMode="multiline" Width="750px" Wrap="true" borderstyle="None" BorderWidth="0" Text='<%# Databinder.Eval(Container.Dataitem,"text_caption") %>'></asp:textbox>

i receive only the first two lines

and with the label
<asp:Label ID="Label112" runat="server" BorderStyle="None" Width="750px" BorderWidth="0" Text=' <%# Databinder.Eval(Container.Dataitem,"text_caption").ToString.Replace(chr(13),"<br />") & "<br/>" & "<br/>" %>' ></asp:Label>

if the text is too big without an enter then the datagrid width becomes too big
although the text is diplayed normal with new lines


the textbox that i use to insert new text is here
<asp:TextBox ID="tbox_text_caption" runat="server" Height="232px"
Style="left: 400px; position: absolute; top: 8px" MaxLength="750" TextMode="MultiLine" Width="752px"
Wrap="true" TabIndex="5" BackColor="#FFE0C0"></asp:TextBox>


any idea for normal display?
 
You should solve this issue with CSS. Either a label or a TextBox can display multiple lines. You only have to accomodate your grid for it.

Make the column width or the row height fixed and the text will wrap exactly as it is supposed to be
 
and how can i do the column width fixed??

i mean to make the column not to be enlarge but always have a specific width
not only set width="500px" but for example if exists somthing like this
widths-size="fixed"
 
Last edited:
Back
Top