troubleshooting Question

Gridview Item Template width

Avatar of TonyReba
TonyRebaFlag for United States of America asked on
4 Comments1 Solution993 ViewsLast Modified:
Can someone how can I define an static width  for a gridview so the bound objects doesnt auto increase the width of the cells, ( Iam planning to have a fixed size of character on the textboxes)

Will this be done in CSS?

<asp:gridview ID="Gridview2" runat="server" ShowFooter="True" 
            AutoGenerateColumns="False" onrowcreated="Gridview2_RowCreated" 
            <asp:BoundField DataField="RowNumber" HeaderText="Row Number" />
            <asp:TemplateField >
               <HeaderTemplate  >
               <asp:Label ID="Label2" runat="server">NT-1</asp:Label>
            <asp:TextBox ID="txt_Census19" runat="server" Width="50px" ></asp:TextBox>

                    <asp:TextBox ID="txt_Bed19" runat="server" Width="50px"></asp:TextBox>
                    <asp:DropDownList ID="txt_Comment19" runat="server" AppendDataBoundItems="True" 
                    style="text-align: left" >
                    <asp:ListItem value="0" text="Select">  </asp:ListItem>
                    <asp:ListItem>Blocked Room</asp:ListItem>
                    <asp:ListItem>Open NS</asp:ListItem>


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros