title: Keeping a current list of running processes using a DataGridView?
body: <p>I'm trying to make a program similar to task manager in C#. My current method is to get a list of processes at application startup, then get a new list if the user presses the "update" button. I would like to keep a current list in my control instead, and "save" where the user has selected instead of the selection and the scroll bar being reset. What is a proper way of doing so in C#?</p>
  
  <p>Here is how I currently update the control:</p>
  
  <pre><code>public void UpdateForm()
  {
      processGridView.Rows.Clear();
      Process[] processes = Process.GetProcesses();
  
      for (int i = 0; i &lt; processes.Length; ++i)
      {
          processGridView.Rows.Add();
          processGridView.Rows[i].Cells["processName"].Value = processes[i].ProcessName + ".exe";
          processGridView.Rows[i].Cells["processID"].Value = processes[i].Id;
      }
  }
  </code></pre>