|
-
October 4th, 2011, 06:02 AM
#1
How do I add row data directly to a DataGrid Class?
How do I add row data directly to a DataGrid Class?
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 MuttiColumnTreeList 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.
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.
So I looked online for how to do that for a DataGrid class and the information is not easily available. Can anyone help?
-
October 7th, 2011, 08:30 PM
#2
Re: How do I add row data directly to a DataGrid Class?
As far as I know, you the DataGrid class does not support adding rows yourself, it is for templating rows and binding to an ItemsSource. FYI that the Grid class does let you add rows.
You can just create an ObservableCollection<YourObject> and assign your DataGrid's ItemsSource to it.
Once you've got an ItemsSource set, you can define DataGridTextColumns in the XAML with Binding={Binding PropertyOnYourObject}.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|