• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

gridview column extends page for miles

I have a gridview with a label in it that is extending it's content page as well as the master page for miles across when there is a continuous entry of characters without spaces.  For example 100 d entries, dddddddddddddd....

 I've tried adding item-style wrap and item-style width to the field, but doesn't help, those d's just go straight across without breaking to next line.

I have to have whatever is entered, regardless of how bizarre the entry may be, so no truncation.

Is there a way to break to next line after so many chars?  I would have thought the item-style settings would have fixed, but no.


<ajax:UpdatePanel ID="updatePanelSecurityGroups" runat="server" UpdateMode="Conditional">
            <asp:GridView ID="_gridViewClientSecurityGroups" runat="Server" Width="100%" AutoGenerateColumns="False" OnRowCommand="_gridViewClientSecurityGroups_RowCommand" OnRowDataBound="_gridViewClientSecurityGroups_RowDataBound">
                    <asp:TemplateField HeaderText="Group Name">
                            <b><asp:Label ID="LabelGroupName" runat="Server"><%# Eval("SHORT_NAME")%></asp:Label></b><br />
                            <asp:Label ID="LabelDescription" CssClass="dataTableSmall" runat="Server"><%# Eval("Description")%></asp:Label>
                    <asp:BoundField DataField="CLIENT_SHORT_NAME" HeaderText="Client" />
                    <asp:TemplateField HeaderImageUrl="~/Library/Key.gif" ItemStyle-Width="0%">
                            <asp:HyperLink ID="HyperLinkMangePermissions" runat="Server" ImageUrl="~/Library/Key.gif" ToolTip="Manage Permissions" ></asp:HyperLink>
                    <asp:BoundField DataField="ASSOCIATE_COUNT" HeaderText="Members" ItemStyle-Width="0%" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField DataField="CREATED_BY" HeaderText="Created By" />
                    <asp:TemplateField HeaderImageUrl="~/Library/Icon-Trash.gif" ItemStyle-Width="0%">
                            <asp:ImageButton ID="ImageButtonDeleteGroup" runat="Server" ImageUrl="~/Library/Icon-Trash.gif" AlternateText="Delete" CommandName="DeleteGroup" CommandArgument='<%# Eval("SECURITY_GROUP_ID") %>' />
1 Solution
Elvio Lujan.Net Senior DeveloperCommented:
the wrap don't work when there are no spaces...
i suggest you use that way...

   <asp:Label ID="LabelDescription" CssClass="dataTableSmall" runat="Server"><%# Eval("Description").ToString.SubString(0,20) & "..."%></asp:Label>

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now