Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 1 grid view in my web page. In that row style ,i make wrap=false. I want rows in single line.Witout warping the text.
HTML
<RowStyle Wrap="false"  />


So this code is working for IE8 and IE9. But IE7 it is not working.

Can any one tell me how to make this workable in IE7?

Thanks
Posted

1 solution

Have a look at this thread ASPxGridView - How to no wrap a text[^] particularly the response from "Marion".

[Edit]
Try putting adding a nowrap attribute to the cells themselves ...
ASP
XML
<asp:GridView ID="GridView1" runat="server"
       onrowdatabound="GridView1_RowDataBound">
...
   </asp:GridView>

Code behind C#
C#
protected void GridView1_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;");
    }
}

or VB.
VB
Protected Sub GridView1_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs)
    For i As Integer = 0 To e.Row.Cells.Count - 1
        e.Row.Cells(i).Attributes.Add("style", "white-space: nowrap;");
    Next
End Sub
 
Share this answer
 
v3
Comments
londhess 29-May-14 9:37am    
here they have devexpress control. I used simply asp gridview and i do not find ASPxGridView.CustomColumnDisplayText event. This is for devexpress gridview not asp gridview
CHill60 29-May-14 10:34am    
Updated my solution
londhess 30-May-14 1:15am    
its working fine. Thanks for your support

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900