This is a migrated thread and some comments may be shown as answers.

[Solved] To retrieve UI controls from Xml

1 Answer 118 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Parameswari
Top achievements
Rank 2
Parameswari asked on 11 Aug 2011, 03:15 PM
Hi ,
code:
Used to convert myxaml to string:
 
XDocument doc = XDocument.Load("/Sampletwo;component/MainPage.xaml");
IEnumerable<XElement> childElements =
from el in doc.Elements()
select el;
foreach (XElement el in childElements)
store = el.LastNode.ToString();
 
Back to UIControls:
UIElement tree = (UIElement)XamlReader.Load(store);
grdLayoutRoot.Children.Add(tree);



Iam working in an Accounting software.In that we allow user to modify their form design and save it for future use. for this my client suggested serialization. The problem is we are using silverlight 4 . Xaml writer is supported by S4.Finally we decide to store xaml as xml and store in database and retrieve it by converting it into uicontrols.I have used following code and error ocuurs saying "event handler is not supported by xamlreader".Other problem is it converts only the controls in the first row of the grid.Other controls are not displayed.
Thanks,
Parameswari

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 11 Aug 2011, 03:25 PM
Hi Parameswari,

Can you please elaborate on how is this question related to Telerik controls in particular? Are you able to successfully serialize/deserialize other ItemsControl's such as the ListBox or the toolkit DataGrid using this approach?

We are looking forward to hearing from you.

All the best,
Ross
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
GridView
Asked by
Parameswari
Top achievements
Rank 2
Answers by
Rossen Hristov
Telerik team
Share this question
or