Width in GridView

mcrmg
mcrmg used Ask the Experts™
on
Hi,

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%">
                        <ItemTemplate>
                            <asp:Label ID="WorkPhone" runat="server" Text='<%#Eval("WorkPhone")%>' />
                        </ItemTemplate>
                    </asp:TemplateField>

Open in new window


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

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Team Lead
Commented:
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">

Author

Commented:
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