Width in GridView

mcrmg used Ask the Experts™

I am trying to see if I could set the fixed width in GridView. This is what I use based on searching on Internet.

                    <asp:TemplateField HeaderText="Work Phone" SortExpression="WorkPhone" HeaderStyle-Width="20%">
                            <asp:Label ID="WorkPhone" runat="server" Text='<%#Eval("WorkPhone")%>' />

Open in new window

But it does not work. Am I missing something? thanks
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Team Lead
I am trying to see if I could set the fixed width in GridView
percentage is not measurable as fixed size.

to make it a fixed width for your header, you got to put a fixed size like this:

<asp:TemplateField HeaderText="Work Phone" SortExpression="WorkPhone" HeaderStyle-Width="200px">


thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial