Need help with Gridview column width.

D

Durango2008

Hi, I am having a bit of trouble with my gridview table and the width of the
columns.
The gridview is made of Templates that contain LinkButton controls. The
LinkButtons will display a string based on their "text" property.
I have set a width for the Linkbutton control, and I am also using CSS to
set style word-wrap:break-word so that if there is a long string it will
break the word and wrap it. This works fine, however the column-width is
resized so that it fits the original long string rather than resizing it to
fit the wrapped text width.
I am wondering if there is a way to have fixed-width columns so regardless
of how long the string is the column does not resize? If not, is there a
way to remedy this?

If what I wrote is vague please let me know I will try to get a screenshot.

Here is some code to illustrate what I have:

<asp:TemplateField HeaderText="Algorithm" SortExpression="Algorithm"
ItemStyle-CssClass="linkButton">
<EditItemTemplate>
<asp:TextBox ID="txtAlgEdit" runat="server" Height="60px" MaxLength="255"
TextMode="Multiline" Text="AVeryVeryVeryVeryLongWord" />
</EditItemTemplate>

<ItemTemplate>
<asp:LinkButton ID="lblAlgorithm" runat="server" width="80px" Height="80px"
ForeColor="Black" Font-Underline="false" Text="AVeryVeryVeryVeryLongWord"/>
</ItemTemplate>
</asp:TemplateField>

Thank you for any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top