title: Prevent GridView from resizing when clicking on The LinkButton
body: <p>How can i prevent my grid from resizing when clicking on the edit link button? i just need my gridview to be fixed..</p>
  
  <p>note that when you click on the edit linkbutton 2 buttons appear : 1 for the update and 1 for the cancel and in the other cells textboxes appear to update the values that's why my grid is resizing.. how can i fix this?</p>
  
  <p>that's my asp code:</p>
  
  <pre><code>&lt;asp:GridView ID="GridView1" runat="server" AllowPaging="True" onrowdatabound="GridView1_RowDataBound" 
          AutoGenerateColumns="False" Width="604px" 
          DataKeyNames="id,firstname,lastname,adress,email,telephone,birthday"&gt;
  
          &lt;Columns&gt;
          &lt;asp:TemplateField&gt;
  
                  &lt;ItemTemplate&gt;
                        &lt;asp:CheckBox id="Select" runat="server" OnCheckedChanged="CheckedChanged" AutoPostBack="false"/&gt;
                        &lt;asp:LinkButton  ID="idedit" CommandName="Edit" CausesValidation="true" runat="server"
                              ToolTip="Edit"  Text="Edit"/&gt;
                        &lt;asp:LinkButton ID="selectID" CommandName="Select" CausesValidation="true" runat="server"
                              ToolTip="Select"  Text="Select" /&gt;
                      &lt;/ItemTemplate&gt;
  
                  &lt;EditItemTemplate&gt;
  
                   &lt;asp:LinkButton  ID="idupdate" CommandName="Update" runat="server" CausesValidation="false" Text="Update"
                              ToolTip="Update" OnClientClick="javascript:if(!confirm('Are you sure do you want to update this?')){return false;}" /&gt;
                          &lt;asp:LinkButton  ID="idcancel" runat="server" CommandName="Cancel" CausesValidation="false"
                              Text="Cancel" ToolTip="Cancel"/&gt;
                  &lt;/EditItemTemplate&gt;
                  &lt;/asp:TemplateField&gt;
  
              &lt;asp:TemplateField HeaderText="firstname"&gt;
                  &lt;EditItemTemplate&gt; 
                      &lt;asp:TextBox ID="fnmaetxt" runat="server" Text='&lt;%# Bind("firstname") %&gt;'&gt;&lt;/asp:TextBox&gt;
                      &lt;%--&lt;asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="fnmaetxt" Text="The first name field is required!"/&gt;--%&gt;
                  &lt;/EditItemTemplate&gt; 
                  &lt;ItemTemplate&gt; 
                      &lt;asp:Label ID="lblfirstname" runat="server" Text='&lt;%# Bind("firstname") %&gt;'&gt;&lt;/asp:Label&gt; 
                  &lt;/ItemTemplate&gt; 
              &lt;/asp:TemplateField&gt; 
  
              &lt;asp:TemplateField HeaderText="lastname"&gt;
                  &lt;EditItemTemplate&gt; 
                      &lt;asp:TextBox ID="lnametxt" runat="server" Text='&lt;%# Bind("lastname") %&gt;'&gt;&lt;/asp:TextBox&gt;
                      &lt;%--&lt;asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="lnametxt" Text="The last name field is required!"
                                          runat="server" /&gt;--%&gt;
                  &lt;/EditItemTemplate&gt; 
                  &lt;ItemTemplate&gt; 
                      &lt;asp:Label ID="lbllastname" runat="server" Text='&lt;%# Bind("lastname") %&gt;'&gt;&lt;/asp:Label&gt; 
                  &lt;/ItemTemplate&gt; 
              &lt;/asp:TemplateField&gt; 
  
              &lt;asp:TemplateField HeaderText="adress"&gt;
                  &lt;EditItemTemplate&gt; 
                      &lt;asp:TextBox ID="adresstxt" runat="server" Text='&lt;%# Bind("adress") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt; 
                  &lt;ItemTemplate&gt; 
                      &lt;asp:Label ID="lbladress" runat="server" Text='&lt;%# Bind("adress") %&gt;'&gt;&lt;/asp:Label&gt; 
                  &lt;/ItemTemplate&gt; 
              &lt;/asp:TemplateField&gt; 
  
              &lt;asp:TemplateField HeaderText="email"&gt;
                  &lt;EditItemTemplate&gt; 
                      &lt;asp:TextBox ID="emtailtxt" runat="server" Text='&lt;%# Bind("email") %&gt;'&gt;&lt;/asp:TextBox&gt;
                      &lt;%--&lt;asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="emtailtxt" Text="Not a Valid Email Address" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" /&gt;--%&gt;
                  &lt;/EditItemTemplate&gt; 
                  &lt;ItemTemplate&gt; 
                      &lt;asp:Label ID="lblemail" runat="server" Text='&lt;%# Bind("email") %&gt;'&gt;&lt;/asp:Label&gt; 
                  &lt;/ItemTemplate&gt; 
              &lt;/asp:TemplateField&gt; 
  
  
             &lt;asp:TemplateField HeaderText="telephone"&gt;
                  &lt;EditItemTemplate&gt; 
                      &lt;asp:TextBox ID="phonetxt" runat="server" Text='&lt;%# Bind("telephone") %&gt;'&gt;&lt;/asp:TextBox&gt;
                      &lt;%--&lt;asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="phonetxt" Text="Not a Valid phone number " SetFocusOnError="True" ValidationExpression="\d{8}"/&gt;--%&gt;
                  &lt;/EditItemTemplate&gt; 
                  &lt;ItemTemplate&gt; 
                      &lt;asp:Label ID="lbltelephone" runat="server" Text='&lt;%# Bind("telephone") %&gt;'&gt;&lt;/asp:Label&gt; 
                  &lt;/ItemTemplate&gt; 
              &lt;/asp:TemplateField&gt; 
  
  
             &lt;asp:TemplateField HeaderText="birthday"&gt;
                  &lt;EditItemTemplate&gt; 
                      &lt;asp:TextBox ID="birthdaytxt" runat="server" Text='&lt;%# Bind("birthday") %&gt;'&gt;&lt;/asp:TextBox&gt;
                  &lt;/EditItemTemplate&gt; 
                  &lt;ItemTemplate&gt; 
                      &lt;asp:Label ID="lblbirthday" runat="server" Text='&lt;%# Bind("birthday") %&gt;'&gt;&lt;/asp:Label&gt; 
                  &lt;/ItemTemplate&gt; 
              &lt;/asp:TemplateField&gt; 
  
          &lt;/Columns&gt;
  
      &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>and that's my code on the editing event:</p>
  
  <pre><code>Protected Sub GridView1_RowEditing(sender As Object, e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
      GridView1.EditIndex = e.NewEditIndex
      GridView1.DataSource = x.selectProfile
      GridView1.DataBind()
  End Sub
  </code></pre>
  
  <p>any help would be much appreciated</p>
  
  <p>thank you in advance</p>