Solved

Wrap="False" and Fixed width Gridview...

Posted on 2014-07-18
2
255 Views
Last Modified: 2014-07-18
In a gridview like :

<ItemStyle HorizontalAlign="Left" Width="10px" Wrap="True" /> </asp:BoundField>

When set Wrap="False", it ignores Width="10px". It uses as much as it needs to display the data in full.

Question: Is there any way to have Wrap="False" and force not to exceed 10px?

visual studio 201 c#.

Thank you.
0
Comment
Question by:Mike Eghtebas
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 40204194
The simplest way would be to apply a CSS style to your page to add an overflow style to your td elements by adding the following to the HEAD section of your page:
<style type="text/css">
   td { overflow: hidden; }
</style>

Open in new window

Bear in mind that would apply to all td elements. If you just wanted it for the single column you would need to add the CssClass attribute to your ItemStyle and then create a named CSS style.
0
 
LVL 33

Author Closing Comment

by:Mike Eghtebas
ID: 40204202
Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now