Width in GridView

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
mcrmgAsked:
Who is Participating?
 
Ryan ChongCommented:
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">
0
 
mcrmgAuthor Commented:
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.