I am attempting to wordwrap in detailsview, but my code looks alittle different then what is below (I was trying to follow your example, but my code is diff.) Could you explain with my code below:
<asp:DetailsVie w ID="DetailsView 1" runat="server" AutoGenerateRow s="False" BackColor="Whit e"
BorderColor="#3 36666" BorderStyle="Do uble" BorderWidth="3p x" CellPadding="4"
DataKeyNames="p k_empid" DataSourceID="O bjectDataSource 1" Font-Names="Arial" Font-Size="Small"
Height="50px" Width="640px" EditRowStyle-Wrap=true CommandRowStyle-Wrap=true InsertRowStyle-Wrap=true RowStyle-Wrap=true>
<FooterStyle BackColor="Whit e" ForeColor="#333 333" />
<EditRowStyle BackColor="Whit e" Font-Bold="True" ForeColor="Blac k" BorderColor="Ma roon" BorderStyle="Do uble" BorderWidth="1p x" Width="450px" Wrap=True CssClass="boxes " />
<RowStyle BackColor="Whit e" ForeColor="#333 333" Wrap="True" />
<PagerStyle BackColor="#336 666" ForeColor="Whit e" HorizontalAlign ="Center" />
<Fields>
<asp:BoundFie ld DataField="pk_e mpid" HeaderText="pk_ empid" InsertVisible=" False"
ReadOnly="True" SortExpression= "pk_empid" Visible="False" />
<asp:BoundFie ld DataField="vch_ empname" HeaderText="Nam e" SortExpression= "vch_empnam e">
<HeaderStyle Width="100px" />
</asp:BoundField>
<asp:BoundFie ld DataField="vch_ empdept" HeaderText="Dep artment" SortExpression= "vch_empdep t" />
<asp:BoundFie ld DataField="vch_ empext" HeaderText="Ext ." SortExpression= "vch_empext " />
<asp:BoundFie ld DataField="vch_ emppic" HeaderText="Mug Shot" SortExpression= "vch_emppic ">
<ControlStyle Width="350px" CssClass="boxes "/>
</asp:BoundField>
<asp:BoundFie ld DataField="vch_ atwork" HeaderText="At Work" HtmlEncode="Fal se" SortExpression= "vch_atwork ">
<ControlStyle Height="75px" Width="450px" CssClass="boxes " />
<ItemStyle Wrap="True" />
</asp:BoundField>
<asp:BoundFie ld DataField="vch_ forfun" HeaderText="For Fun" HtmlEncode="Fal se" SortExpression= "vch_forfun ">
<ControlStyle Height="75px" Width="450px" CssClass="boxes "/>
<ItemStyle Wrap="True" />
</asp:BoundField>
<asp:BoundFie ld DataField="vch_ mystory" HeaderText="My Story" HtmlEncode="Fal se"
SortExpression= "vch_mystor y" >
<ControlStyle Height="75px" Width="450px" CssClass="boxes "/>
<ItemStyle Wrap="True" />
</asp:BoundField>
<asp:CommandFie ld ShowDeleteButto n="True" ShowEditButton= "True" />
</Fields>
<HeaderStyle BackColor="#336 666" Font-Bold="True" ForeColor="Whit e" Width="75px" />
<CommandRowStyl e CssClass="boxes " Wrap="True" />
<InsertRowSty le Wrap="True" />
</asp:DetailsView >
Thanks!
"Jason" <jasonmwilkerso n@hotmail.com> wrote in message
news:1147710260 .805725.186660@ y43g2000cwc.goo glegroups.com.. .[color=blue]
> Anyone know how to make the text wrap in a text box of a DetailsView?
>[/color]
Convert the field to a templated, then in the textbox and set wrap="true".
You might also want to use the multi-line textbox attribute. Here is some
example code.
<asp:DetailsVie w ID="DetailsView 1" runat="server"
DataSourceID="S qlDataSource1" Height="50px"
Width="125px" AutoGenerateRow s="False" AllowPaging="Tr ue">
<Fields>
<asp:CommandFie ld ShowEditButton= "True" />
<asp:TemplateFi eld HeaderText="Fir stName" SortExpression= "FirstName" >
<EditItemTempla te>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("FirstName ")
%>'></asp:TextBox>
</EditItemTemplat e>
<InsertItemTemp late>
<asp:TextBox ID="TextBox1" Wrap="true" runat="server" Text='<%#
Bind("FirstName ") %>'></asp:TextBox>
</InsertItemTempl ate>
<ItemTemplate >
<asp:Label ID="Label1" runat="server" Text='<%# Bind("FirstName ")
%>'></asp:Label>
</ItemTemplate>
</asp:TemplateFie ld>
<asp:BoundFie ld DataField="Id" HeaderText="Id" InsertVisible=" False"
ReadOnly="True"
SortExpression= "Id" />
</Fields>
</asp:DetailsView >
Peter Kellner
http://peterkellner.net