Solved

asp.net stop listview cells from wrapping

Posted on 2014-11-10
2
220 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
[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 20

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
ID: 40434959
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
ID: 40435108
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
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…

752 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