Hi,
I'm new with XamDataGrid and wondering how to do this. My data source is an XElement. I use Linq to bind it with a XamDataGrid such as:
Func<string, string, object> convertFunc = (x, y) => { Type type = Type.GetType(x); object value = Convert.ChangeType(y, type); return value; };
var props = from Property in m_tradeDefinition.Elements() select new { Key = Property.Name.ToString(), Value = convertFunc(Property.Attribute("Type").Value, Property.Value) };
m_grid.DataSource = props;
Now it all works just fine. However, I can't get my grid to update. My guess is because my DataSource is actually a collection of anonymous type and thus the grid doesn't know how to update its data source.
So, does anyone know a better way of doing this? Better still, how to bind directly to XElement or XML document in general.
Thanks!
Hello,
There are good examples in the XamFeatureBrowser (which is installed with our products) for binding. You can also check the out help pages for binding - http://help.infragistics.com/Help/NetAdvantage/WPF/2008.2/CLR3.X/html/xamDataGrid_Accessing_Data.html
If you still have trouble, please attach a sample project to take a closer look
Hope this helps,
Alex.
I think that the actual problem we are facing is that we can't get the grid/cells to go into edit mode when we are bound to XElements.
Here is a simple sample app to demonstrate the grid not going into edit mode when you click on a cell.
As the site was updated, I think this is the reason, you attachment has not been attached properly or lost in the conversion of the forum so please attach it one more time
Sorry for the inconvenience.