Hello,
I would like to know if loading a xamdatagrid 100% from code is possible. If so where is an example I can look at? Feature browser didn't have what I am looking for. Also I do not want to bind a list to the datasource or bind anything to the datacontext. I want to programmatically add the row headers and row data as I see fit. This could be obvious but once I load the grid I also want to make sure the sorting and filtering features will still work even though no objects will exist behind them.
Original post here:
http://news.infragistics.com/forums/t/1362.aspx
I haven't found anything but this post related to what I am looking for. So if this is a dumb question please forgive me and point me in the right direction anyway. ;-)
Chad
Hello Char,
Well, the difference is that in the sample that I provided, I am using XmlDataProvider, which is used to get the data from the xml. In your sample, you are using an XmlDocument. You cannot bind the XamDataGrid to an XmlDocument directly. You would have to use a XmlDataProvider.
Ahh I see it. Nevermind. Previous post retracted.
I have not heard anything thing for a few days. I really would like to hear a solution for my attached sample app. Is this problem still in the queue? Please advise.
Alex,
Thanks for your persistence and patience. I followed what is suggested and I am still not having success. So I figured I would make a sample app to demonstrate my issue. The way it is set up now is how I got this working. The commented line is what was suggested. Switching the 2 you will see the difference in behavior. Please advise on what is the difference.
I am not sure whether this can be bound directly using the syntax you provided. The following exception is thrown in the output:
System.Windows.Data Error: 43 : BindingExpression with XPath cannot bind to non-XML object.;
However, there is another way to do it, here is how:
Assuming that the Windon's DataContext is a class, that exposes the XML property, which provides this xml data :
<igDP:XamDataGrid Margin="10" Height="300" Name="xamDataGrid1" DataContext="{Binding XML}" DataSource="{Binding XPath=CompareProperties}"/>