Hi
I want some kind of plugin mechanism for the fieldlayout of my grids.
are there any methods in infragistics to set the fieldlayout from string?
forexample when I have a string like this
<igDataPresenter:FieldLayout > <igDataPresenter:Field Name="MyField" Label="Name"/> </igDataPresenter:FieldLayout>
is there a way to set this as current fieldlayout ?
Any hints / advice?
Hi Haggy,
You can create a FieldLayout from that string in code-behind but there's no way to use that string directly with the XamDataGrid to tell it to use that layout. You can use the XamlReader class to convert that string into an actual FieldLayout object and then add it to the grid. An example on how to use XamlReader can be seen here.
StringReader sr = new StringReader(@"<igDP:FieldLayout xmlns:igDP='http://infragistics.com/DataPresenter'> <igDP:Field Name='MyField' Label='Name'/> </igDP:FieldLayout>"); XmlReader reader = XmlReader.Create(sr); FieldLayout dynamicFieldLayout = (FieldLayout)XamlReader.Load(reader);
Let me know if you have any questions on this.
Let me know if you have any further questions on this matter.