title: How do I add row data directly to a DataGrid Class?
body: <p>How do I add row data directly to a DataGrid Class?</p>
  
  <p>I am using a free opensource class from a company that I will not name (even if it is RadiantQ) that I like a lot.  It has this cool MuLtiColumnTreeList control that is a combination of a tree control and a datagrid.  It comes with an example code that you can look at and everything.  It is pretty cool. It is inherited from the DataGrid class.</p>
  
  <p>The problem is that I am kind of new to databinding on this level and so I would like to just go ahead and write some code that forces the data that I have gathered from another class into the  control.</p>
  
  <p>So I looked online for how to do that for a DataGrid class and the information is not easily available.  Can anyone help?</p>
  
  <p>It seems that once the databinding is done, and if you change the data you have to rebind to the control.  This is what was giving me difficulty before.  So what I have to do is run some command like this:</p>
  
  <p>this.mutlicoolgridview.ItemsSource = null;
  this.mutlicoolgridview.ItemsSource = SampleData.GetSampleDataNew();</p>
  
  <p>The problem I am having now is this.  After running his command about one thousand times, I actually run out of memory.  I think that doing this:</p>
  
  <p>this.mutlicoolgridview.ItemsSource = null;</p>
  
  <p>is not such a good idea.  Is there a better command to do to free up the memory?</p>
  
  <p>This is a similar looking crash:
  [<img src="https://i.stack.imgur.com/FMMHD.png" alt="IMG]http://i67.photobucket.com/albums/h292/Athono/unusual.png[/IMG">]</p>