473,796 Members | 2,462 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS work around on text wrapping in a datagrid does not work

TB
According to Microsoft (
http://support.microsoft.com/default...b;EN-US;323169 ), there
is bug in the the datagrid control, causing content to wrap in the
columns of a datagrid eventhough HeaderStyle Wrap or the ItemStyle Wrap
property to False.

Following the advice in the same support article, I have modified my
datagrid to become the following:

<asp:datagrid id="MySQLDataGr id" PageSize="6" DataKeyField="I D"
autogeneratecol umns="False" AlternatingItem Style-BackColor="#C0C 0C0"
AllowPaging="Tr ue" OnPageIndexChan ged="PageChange "
HeaderStyle-BackColor="#88B 5DA" Width="100%"
runat="server">
<SelectedItemSt yle BackColor="Gold "></SelectedItemSty le>
<EditItemStyl e CssClass="MyLis titem"></EditItemStyle>
<AlternatingIte mStyle BackColor="Silv er"></AlternatingItem Style>
<ItemStyle CssClass="myLis tItem"></ItemStyle>
<HeaderStyle CssClass="myLis tItem" BackColor="#88B 5DA"></HeaderStyle>
<Columns>
<asp:BoundColum n DataField="name " HeaderText="nam e">
<HeaderStyle Wrap="False" Width="40px"></HeaderStyle>
<ItemStyle Wrap="False" Width="40px"></ItemStyle>
<FooterStyle Wrap="False"></FooterStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="posi tion" HeaderText="pos ition">
<HeaderStyle Wrap="False" Width="90px"></HeaderStyle>
<ItemStyle Wrap="False" Width="90px"></ItemStyle>
<FooterStyle Wrap="False"></FooterStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="note 1" HeaderText="not e 1Regarding">
<HeaderStyle Wrap="False" Width="200px"></HeaderStyle>
<ItemStyle Wrap="False" Width="200px" Height="15px"></ItemStyle>
<FooterStyle Wrap="False"></FooterStyle>
</asp:BoundColumn >
<asp:BoundColum n DataField="note 2" HeaderText="not e 2">
<HeaderStyle Wrap="False" Width="200px"></HeaderStyle>
<ItemStyle Wrap="False" Width="200px"></ItemStyle>
<FooterStyle Wrap="False"></FooterStyle>
</asp:BoundColumn >
</Columns>
<PagerStyle Font-Size="Small"></PagerStyle>
</asp:datagrid>

However, the text still wraps in those columns. What am I missing here?

Any advice will be highly appreciated.

Thanks

TB

Feb 19 '06 #1
2 1994
TB
The problem remains. Any suggestions?

Thanks

TB

Feb 22 '06 #2
TB
There doesn't seem to be a lot of interest in this issue. Meanwhile, I
think I have found the origen of the problem within this line:

<ItemStyle Wrap="False" Width="200px"></ItemStyle>

Apparently, the Width parameter is not compatible with the Wrap
parameter. Without Width, the Wrap=False part is accepted.

That is a bit of a bother because I would like to be able to have
non-wrapping text in column with a predefined width.

Unless somebody in this news group has a better idea, I will stick with

<ItemStyle Wrap="False"></ItemStyle>

and the reduce limit the length of my unwrapped text by way of a
SUBSTRING argument in my SQL statement, thus reducing the column to the
desired width. Not very elegant but it works.

TB

Feb 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
13935
by: Suzanne Boyle | last post by:
I have the following code in a webpage: <p><img src="images/clydesdale.gif" width="100" height="41" style="float: left;" /> <strong>Test</strong><br /> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br /> visit website
14
12921
by: Steve Jorgensen | last post by:
Recently, I tried and did a poor job explaining an idea I've had for handling a particular case of implementation inheritance that would be easy and obvious in a fully OOP language, but is not at all obvious in VBA which lacks inheritance. I'm trying the explanation again now. I often find cases where a limited form of inheritance would eliminate duplication my code that seems impossible to eliminate otherwise. I'm getting very...
3
7166
by: Randy | last post by:
Hello, How would this be done? I've looked at the datagrid itself and also the tableStyle and can't find out how to make text wrap in a cell. Thanks
2
1889
by: Scott | last post by:
I having a problem where I need to turn off the wrapping feature for all columns in my datagrid. Example code would be: <asp:DataGrid id="ResultGrid" runat="server" AutoGenerateColumns="true"> <ItemStyle Wrap="false"></ItemStyle> <Columns> </Columns> </asp:DataGrid>
4
1922
by: rodchar | last post by:
Hey all, I have a datagrid that auto-generate the columns. When I run the app some of the column values are wrapping. How do I prevent the values from wrapping? Do I have to use template columns to accomplish this feat? thanks, rodchar
0
1142
by: Dan | last post by:
Unfortunately the property in Wrap="false" for a datagrid adds nowarp="false" to the TR not the TD. So to stop text wrapping in a Datagrid in asp.net do the following Add: <style> TD { WHITE-SPACE: nowrap } </style>
6
4904
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
0
992
by: glenn | last post by:
Hi folks, I have a DataGrid control and I have all of the columns wrapping their text except for one column which insists on placing the text all in one line without wrapping. All columns in my HTML are the same but obviously something is different. Thanks for any thoughts on this.
14
3496
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src="" id="eventImage0" class="eventImage"><img src="" id="eventImage1" class="eventImage"></div>
0
9683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.