Cool Grid View Width?

Jul 10, 2012 at 5:10 PM

What an awesome amazing control thank you!

Just having trouble with something basic that I don't understand... Why can I not change the column widths to a fixed width?

I tried everything from ItemStyle-Css and a css class as well as just itemstyle-width both of which work with a regular gridview....

The columns just will not change their width

any help appreciated

Sep 6, 2012 at 10:32 AM
Edited Sep 6, 2012 at 10:33 AM


I have this problem too ! I modify coolGridview.cs and resolve this problem.

Update line 228 :


if (fld.Visible && cI < columnWidths.Count)
                    fld.HeaderStyle.Width = columnWidths[cI++];

with :

if (fld.Visible && cI < columnWidths.Count)
                    fld.HeaderStyle.Width = columnWidths[cI++];
                    fld.HeaderStyle.Width = fld.ControlStyle.Width;

And write properties in your templateField of coolGridView aspx : ControlStyle-Width="30px" for exemple.
exemple :
<asp:TemplateField HeaderText="My column" ControlStyle-Width="30px">
                            <asp:Label ID="MyColumn" runat="server">Value</asp:Label>

I hope resolve your problem too.
Dec 24, 2013 at 10:23 AM
Hi I am also facing the same issue and how to Modify coolgridview.cs file. As i am directly using the DLL.
Can you please tell the steps to use cool grid view control.

Jan 9, 2014 at 3:02 PM
With the DLL, you cant use my solution. You need to use source code.