Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

gridview column width setting not working.

Posted on 2007-03-20
2
Medium Priority
?
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 16

Accepted Solution

by:
Edwin_C earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

650 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