c# - fixing the gridview column width not working. -


I have the following code I set "150px" for width = footerstyle, rowstyle and headerstyle

Code

  & lt; Strong & gt; Title & lt; / Strong> & Lt; Br / & gt; & Lt; Asp: GridView ID = "socGridView" runat = "server" CaptionAlign = "top" HorizontalAlign = "justify" DataKeyNames = "id" onselectedindexchanged = "socGridView_SelectedIndexChanged" tooltip = "Excel file download tool" CellPadding = "4" ForeColor = " # 333333 "Gridline =" none "& gt; & Lt; RowStyle width = "150px" BackColor = "# E3EAEB" /> & Lt; Columns & gt; & Lt; Asp: CommandField ShowSelectButton = "True" SelectText = "Download" ControlStyle-ForeColor = "Blue" /> & Lt; / Column & gt; & Lt; FooterStyle width = "150px" BackColor = "# 1C5E55" font-bold = "true" ForeColor = "white" /> & Lt; PagerStyle BackColor = "# 666666" ForeColor = "White" Horizontal Align = "Center" /> & Lt; SelectedRowStyle BackColor = "# C5BBAF" font-bold = "true" ForeColor = "# 333333" /> & Lt; Header style width = "150px" backAcllor = "gray" font-bold = "true" ForeColor = "white" /> & Lt; EditRowStyle BackColor = "# 7C6F57" /> & Lt; AlternatingRowStyle BackColor = "White" />   

However, does not it work for me. Is it any way to solve this?

I had the same problem that the column width was not changed, but after setting Gridwu width , Does it work! Like

  & lt; ASP: GridView ID = "GV" runat = "server" AutoGenerateColumns = "false" DataSourceID = "datasource_ssc" EnableModelValidation = "true" width = "50%" BackColor = "white" BorderColor = "# DEDFDE" BorderStyle = "none" BorderWidth = "1px" CellPadding = "4" ForeColor = "black" gridlines = "vertical" DataKeyNames = "SSC, sales" AllowSorting = "true" & gt;    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -