Last post Dec 28, 2010 02:18 AM by brijeshvaidya
Apr 28, 2007 01:25 PM|aspnetdev2000|LINK
Here is what I tried which didn't work :
<div id="DIV1" style="position:absolute; width: 1009px; height: 287px; left: 18px; top: 44px; float: left; overflow: scroll;" nowrap="noWrap" >
<asp:GridView ID="gvOrders" runat="server" style="position:absolute;left:11px;top:5px;"
CssClass="DataWebControlStyle" Height="165px" Width="977px" RowStyle-Wrap="false">
<HeaderStyle CssClass="HeaderStyle" Wrap="False" Width="900px" />
<AlternatingRowStyle CssClass="AlternatingRowStyle" Wrap="False" />
<FooterStyle Wrap="False" />
<EmptyDataRowStyle Wrap="False" />
<RowStyle Wrap="False" Width="900px" />
<EditRowStyle Wrap="False" />
<SelectedRowStyle Wrap="False" Width="900px" />
<PagerStyle Wrap="False" />
The gridview columns are auto-generated and displays wrapped text which I don't want.
Has it got something to do with CSS setting?
Thanks in advance.
Apr 28, 2007 10:12 PM|Nullable|LINK
make this CSS rule:
and that should do it.
Apr 28, 2007 10:15 PM|Nullable|LINK
Apr 28, 2007 10:47 PM|aspnetdev2000|LINK
Nope, it didn't.
Here is the styles.css part. After it didn't work with .DataWebControlStyle I pasted the same code to HeaderStyle, AlternatingRowStyle and RowStyle. And it still didn't work.
/* Data Web Control Styles */
May 01, 2007 04:00 AM|Allen Chen – MSFT|LINK
By default GridView seems won't show wrapped text for auto-generated Columns. Is there any blank in the data string?
May 01, 2007 10:26 AM|aspnetdev2000|LINK
blank? Do you mean occurence of null value for one column in a record or spaces in the value of a column.
The answer is yes for both.
For instance, one column shows the full style of customer's company name, like ABC Pte Ltd., XYZ Development (Slovakia) Pte Ltd and it may be null for any customer who is an individual and not attached with any organization.
May 03, 2007 06:43 AM|Allen Chen – MSFT|LINK
Since auto generated column is built-in and difficult to change its style, you have two choices:
1. Set your GridView's width wide enough.
2. Use ItemTemplate instead, it's more flexible.
If you still have this problem, please inform us.
May 03, 2007 10:58 AM|aspnetdev2000|LINK
I will try as you suggested.
I will come back to you with the outcome.
Sep 19, 2007 05:02 PM|jay.d|LINK
What you can do is specify the OnRowDataBound and add the following code to the code behind:
protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
for (int i = 0; i < e.Row.Cells.Count; i++)
e.Row.Cells[i].Attributes.Add("style", "white-space: nowrap;");
Dec 28, 2010 02:18 AM|brijeshvaidya|LINK
it is answer.. what i am looking for..