Solved

asp.net stop listview cells from wrapping

Posted on 2014-11-10
2
210 Views
Last Modified: 2014-11-11
I have a ListView control on a ASP form and I want to stop the individual cells from wrapping when the content is wider than the width of the cell.  How can you do this?
0
Comment
Question by:Siv
2 Comments
 
LVL 19

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
Comment Utility
I've not tested this, so I'm not 100% sure about the implementation, but to keep text from wrapping in *any* HTML element, this works like a charm:

<span style="white-space: nowrap;">Some really long text here you don't want wrapping.</span>

Open in new window


Put this HTML in your ListView text HTML and it should keep it from wrapping. You might be able to no-wrap the containing DIV instead it's a problem adding it to the ListView iteself.
0
 

Author Closing Comment

by:Siv
Comment Utility
Dan7el

Brilliant I just surrounded the table in the Layout template with your span and it works:

                        <span style="white-space: nowrap;">
                        <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color:royalblue; border-collapse: collapse;border-color: black;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:8pt;">
                            <tr runat="server" style="background-color:royalblue;color: white;">
                                <th runat="server">Select Item</th>
                                <th runat="server">Customer Name</th>
                                <th runat="server">Store Name</th>
                                <th runat="server">Officer Name</th>
                                <th runat="server">Total Amount</th>
                            </tr>
                            <tr id="itemPlaceholder" runat="server" >
                            </tr>
                        </table>
                        </span>

Thanks for your help.

Siv
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

10 Experts available now in Live!

Get 1:1 Help Now