Solved

gridview column width setting not working.

Posted on 2007-03-20
2
243 Views
Last Modified: 2008-01-09
Hello experts,

I'm trying to keep data from one column expanding when it gets data.  I've tried setting the column.ItemStyle.Width and the column.HeaderStyle.Width as well, but no go.  I'm wondering if it is possible to set a length on a gridview column where if it gets data like:
"blah, blah, blah" I can actually cut it off to "blah, blah, b" without the column adjusting itself.  Any thoughts?

0
Comment
Question by:carmodyk
2 Comments
 
LVL 16

Accepted Solution

by:
Edwin_C earned 500 total points
ID: 18762086
You can use a templatefield like

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" >
            <Columns>
 <asp:TemplateField>
                    <ItemTemplate>
                        <div style="overflow: hidden; width: 20px">
                            <asp:Label ID="code" runat="server" Text='<%# Eval("myFieldName") %>'></asp:Label>
                        </div>
                    </ItemTemplate>
                </asp:TemplateField>
 </Columns>
        </asp:GridView>
0
 
LVL 6

Author Comment

by:carmodyk
ID: 18765238
Just the answer I was looking for.  You rock!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question