title: Updating/Refreshing a Gridview once a row has been deleted Using UpdatePanel. ASP.NET C# AJAX
body: <p>I am trying to update a gridview so that once a row has been deleted from it, it will then refresh and no longer show that row automatically. However this does not seem to be working.</p>
  
  <p>So far I have tried:</p>
  
  <pre><code>    &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional" &gt;
      &lt;ContentTemplate&gt;
          &lt;asp:GridView ID="BookingsGridView" runat="server" AutoGenerateColumns="False" 
              BorderColor="ForestGreen" BorderStyle="Ridge" BorderWidth="10px" 
              CellPadding="4" ForeColor="#333333" GridLines="None" 
              onrowdatabound="dgTest_RowDataBound" OnSelectedIndexChanged="Cancel_Booking"&gt;
              &lt;AlternatingRowStyle BackColor="White" /&gt;
              &lt;Columns&gt;
                  &lt;asp:CommandField ShowSelectButton="true" SelectImageUrl="~/Images/Icons/Cross.png" SelectText="Cancel"/&gt;
                  &lt;asp:BoundField DataField="Book_id" HeaderText="Book_id"/&gt;
                  &lt;asp:BoundField DataField="Username" HeaderText="Username" /&gt;
                  &lt;asp:BoundField DataField="Client" HeaderText="Client" /&gt;
                  &lt;asp:BoundField DataField="Description" HeaderText="Description" /&gt;
                  &lt;asp:BoundField DataField="BookingDate" HeaderText="BookingDate" /&gt;
                  &lt;asp:BoundField DataField="Duration" HeaderText="Duration" /&gt;
                  &lt;asp:BoundField DataField="Location" HeaderText="Location" /&gt;
                  &lt;asp:BoundField DataField="Payment" HeaderText="Payment" /&gt;
              &lt;/Columns&gt;
              &lt;EditRowStyle BackColor="#7C6F57" /&gt;
              &lt;FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /&gt;
              &lt;HeaderStyle BackColor="#546E96" Font-Bold="True" ForeColor="White" /&gt;
              &lt;PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /&gt;
              &lt;RowStyle BackColor="#E3EAEB" /&gt;
              &lt;SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333"/&gt;
              &lt;SortedAscendingCellStyle BackColor="#F8FAFA" /&gt;
              &lt;SortedAscendingHeaderStyle BackColor="#246B61" /&gt;
              &lt;SortedDescendingCellStyle BackColor="#D4DFE1" /&gt;
              &lt;SortedDescendingHeaderStyle BackColor="#15524A" /&gt;
              &lt;SelectedRowStyle CssClass="SelectedRowStyle" /&gt;
          &lt;/asp:GridView&gt;
          &lt;br /&gt;
      &lt;/ContentTemplate&gt;
      &lt;Triggers&gt;
      &lt;asp:AsyncPostBackTrigger ControlID="BookingsGridView" /&gt;
      &lt;/Triggers&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>and then I am calling </p>
  
  <pre><code> UpdatePanel1.Update();
  </code></pre>
  
  <p>once the row is deleted sucessfully.</p>
  
  <p>Why isn't this working?</p>