Solved

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

Posted on 2014-07-18
2
261 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 34

Author Closing Comment

by:Mike Eghtebas
ID: 40204202
Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

840 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