Hello!
Can you show the sample how to add the row programmatically ( without ItemsSource property)?
Thank you.
Thank you for reply!
1. What should I do with templated columns when I use for binding an anonymouse types?
2. How to bind this anonymouse source to templated columns?
3. What is the best way to create this templated columns when I should bind anonymouse source?
4.How to create in this case subtables? If some columns in this subtables contain templated columns?
Can you show me some lines of code.
I am really disapointed by complexity of it.
So the approach that should be suggested is Anonymous Types.
However, Silverlight doesn't support Anonymous types very well, which makes it impossible to bind a collection of Anonymous types to any control, even the MS DataGrid.
For now, i found an article a while ago that creates object types dynamically, which allows you to kind of fake Anoymous types. You can then create a collection of those dynamic types and bind them to the grid.
http://blog.bodurov.com/How-to-Bind-Silverlight-DataGrid-From-IEnumerable-of-IDictionary
Hope this helps.
-SteveZ
Thank you for reply.
I need to have the ability to create a structure of the xamwebgrid programmatically.
I have no linq on the server side, just dataset and datatable, and all data in this (dataset, datatable) is very different (different column names, columns count ). This tables in database creates and changes dynamically by user.
What is the best way in this situation?
Hi,
The xamWebGrid doesn't have an unbound mode. So there must always be an ItemSource set.
One options, is that you can add an empty ObservableCollection to the xamWebGrid. Then, whenever you add a row to that collection, the xamWebGrid will automatically show that row, as an ObservableCollection implements INotifyCollectionChanged.
I hope this helps,