title: Refresh RadGridview when Insert,Update and Delete Operation done on Database in WPF
body: <p>WPF and C#:
  Problem:
      1. How to Refresh Radgridview when i Insert,update and Delete Record in database anrecord.
      2.when i am Insert or Update Record than in radgridview that row is selected.</p>
  
  <p>i am useing sql server 2005.</p>
  
  <p>i am use to set data source of radgridview like " radgridview1.ItemsSource = ds; "  ==> ds is dataset.</p>
  
  <p>i am beginner so if possible than tel me by code it is easy to understand.......</p>
  
  <p>can u help me as early as possible ....</p>
  
  <p>i give some code which i am useing for update RadGridview</p>
  
  <p>con.ConnectionString = @"Data Source=(local);Initial Catalog=DigiDms;Integrated Security=True";</p>
  
  <pre><code>        cmd1.Connection = con;
          con.Open();
          cmd1.CommandType = CommandType.StoredProcedure;
          cmd1.CommandText = "Pro_Insurance_Master_Select";
          da1.SelectCommand = cmd1;
          da1.Fill(ds1);
          con.Close();
  
          //dataGrid.clear();
          //dsGrid.Reset();
          //dsGrid = dataGrid.GetData("Pro_Insurance_Master_Select"); //set datasource of gridview
  
          gridShowData.ItemsSource = null;
          gridShowData.ItemsSource = ds1;
  </code></pre>
  
  <p>doing this ,</p>
  
  <p>when i am delete or update record than folloning error generated...
  Error: >> "Object reference not set to an object"<br>
  when i am doing the "gridShowData.ItemsSource = null;"</p>
  
  <p>and when i am doing insert operation than this error is not generated and RadGridview also updated.....</p>
  
  <p>so pls help me as early as possible.... 
  i am beginer ........</p>
  
  <p>my email address is patelriki13@gmail.com</p>