0
votes

I try different "properties":

  • ItemStyle-Width
  • ControlStyle-Width
  • HeaderStyle-Width

I set ItemStyle-Wrap in "true". I use css class:

.wraptext
{
    word-wrap:break-word;
    -ms-word-wrap: break-word;
    -moz-word-wrap: break-word;
    -webkit-word-wrap: break-word;
}

It didn't help me. My GridView:

<asp:Panel ID="Panel2" Height="570px" Width="100%" runat="server" ScrollBars="Vertical" BackColor="White">
    <asp:GridView ID="tableResults" runat="server" DataSourceID="sourceDetails"
        AutoGenerateColumns="False" OnDataBound="tableResults_Bound"
        OnRowDataBound = "tableResults_DataBound" DataKeyNames="i_id"
        AutoGenerateDeleteButton="True" OnRowDeleted="tableResults_RowDeleted"
        AutoGenerateEditButton = "True" OnRowUpdating="tableResults_RowUpdating"
        OnRowUpdated="tableResults_RowUpdated" AllowSorting="true" AllowPaging="true" PageSize="150"
        Height="300px" BorderStyle="None" Font-Size="12px">            
        <RowStyle BorderColor="Black" />
      <Columns>          
        <asp:TemplateField HeaderText="Код патча" SortExpression="patchcode" ItemStyle-Width="4%">
            <HeaderStyle Width="4%" />
            <ItemTemplate>
                <asp:Label Width="4%" ID="lblPatchCode" runat="server" Text='<%# Eval("patchcode") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField HeaderStyle-Width="3%" ItemStyle-Width="3%" DataField="i_number" ReadOnly="true" HeaderText="П/п" SortExpression="i_number"/>
        <asp:BoundField HeaderStyle-Width="20%" ItemStyle-CssClass="wraptext" ItemStyle-Width="20%" DataField="s_name" ReadOnly="true" HeaderText="Наименование работы" SortExpression="s_name"/>            
        <asp:TemplateField HeaderText="Статус" SortExpression="status" ItemStyle-Width="7%">
            <HeaderStyle Width="7%" />
            <ItemTemplate>
                <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("status")%>'></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("status")%>' Visible = "false"></asp:Label>                     
                <asp:DropDownList AutoPostBack="true" OnSelectedIndexChanged="ddl_OnSelectedIndexChanged"
                    ID="ddlStatuses" runat="server"></asp:DropDownList>
            </EditItemTemplate>
        </asp:TemplateField>             
      </Columns>           
     </asp:GridView>
1
ie8, google chrome. I don't use another browsers - user1848942
Please provide GridView code that you have tried.. - Harsh Baid

1 Answers

0
votes

CSS3 word-wrap Property is an CSS3 feature so that would work in modern browsers only which support the css3 word-wrap

For fallback to non-supportive browsers use .NET GridView in conjuction with Eval and public method in page-behind to break the letters.