Hello,
I want to create the DataTemplate in runtime using XamReader.Load method, however i am successful in creating but i have couple of queries.
DataTemplate :
();
radioColumn.Key = DisplayName;
collayout.Columns.Add(radioColumn);
+
;
radioColumn.ItemTemplate = (
.Load(str);
i want to apply styles and want to handle the Checked ,UnChecked events too for the RadioButton control , but its giving runtime error.
Could you please help out.
Thanks,
P.Tilwani
Hello Parkash,
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
I have modified the sample application that I have previously attached in order use hierarchical data and the CellControlAttached event is fired and the events of the CheckBox are handled in both parent and child layout.
Please let me know if you can reproduce the same issue with my sample application and if not, please modified my sample application to demonstrate your issue or sent me an isolated sample in which the issue appears.
Looking forward to hearing from you.
Hello Krasimir,
Thanks for replying , Yes you are correct we cannot attach the event handlers while creating the control using XamlReader.Load method.
I Just gone through your approach and implemented the same in my POC, but still the CellControlledAttached event is not getting fired.
I am adding the TemplateColumn to ColumnLayout as i am creating the Hierarchial structure.
ColumnLayout
childColumnLayout = new ColumnLayout();
childColumnLayout .Key = "DisplayName";
colLayout.Columns.Add(CreateTemplateColumn(SelectionColumnName,
true));
in the CreateTemplateColumn i am defing the template which returns the type of
TemplateColumn.
Prakash Tilwani.
Hello Tilwani,
I have been looking into your description and it seems that XamlReader.Load method does not support handling events in the XAML content string. You can read about the this method here: http://msdn.microsoft.com/en-us/library/cc189076(v=vs.95).aspx . I have created a sample application in which using the CellControAttached event of the XamGrid I have handled the Check and Unchecked events of the RadioButtons that are in the template for the column. You can also apply and styles for the elements in the DataTemplate in the event handler of the CellControlAttached.
If you need any further assistance please do not hesitate to ask.