title: refresh gridview after adding or deleting new record in c#
body: <p>i've a grid on my page i need to refresh gridview add and delete new record but its not?</p>
  
  <p>here is the code:</p>
  
  <p>Add Row To GridView:</p>
  
  <pre><code>    private void AddClientToGrid()
      {
          int clientID = int.Parse(ddlClient.SelectedValue);
          int clientTypeID = int.Parse(ddlClientType.SelectedValue);
          ClientsAllCDO client = new ClientsBL().ClientsAllSelectByIDAndClientTypeID(clientID, clientTypeID);
          List&lt;ClientsAllCDO&gt; clientList = new List&lt;ClientsAllCDO&gt;();
          clientList = GetClientsFromGrid();
          clientList.Add(client);
          gvClient.DataSource = clientList;
          gvClient.DataBind();
      }
  </code></pre>
  
  <p>Delete Code: </p>
  
  <pre><code>    protected void btnDeleteClient_Click(object sender, EventArgs e)
      {
          LinkButton btnDeleteClient = sender as LinkButton;
          int rowIndex = int.Parse(btnDeleteClient.Attributes["RowIndex"]);
          if (Request.QueryString["BailiffID"] == null)
          {
              gvClient.DeleteRow(rowIndex);
          }
          else
          {
              int bailiffID = int.Parse(FormCrypto.Decrypt(Request.QueryString["BailiffID"]));
              GridViewRow gvRow = gvClient.Rows[rowIndex];
              int clientTypeID = int.Parse(((Label)gvRow.FindControl("lblClientTypeID")).Text);
              int clientID = int.Parse(((Label)gvRow.FindControl("lblClientID")).Text);
              gvClient.DeleteRow(rowIndex);
              new BailiffClientsBL().BailiffClientDelete(clientID, bailiffID, clientTypeID);
          }         
      }
  </code></pre>
  
  <p>Thanks alot...</p>