Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding on Grid : CellEditEnded & RowEditEnd when building XAML dynamically

6 views
Skip to first unread message

Mr. X.

unread,
Apr 27, 2011, 6:24:05 PM4/27/11
to
Hello.
I was trying with success building a grid on SL4 by XAML (on datagrid
control)
like this :
DataGridColumn gt;
DataTemplate dt;
StringBuilder CellTemp = new StringBuilder();
CellTemp.Append("<DataTemplate ");
CellTemp.Append("xmlns='http://schemas.microsoft.com/winfx/");
CellTemp.Append("2006/xaml/presentation' ");
CellTemp.Append("xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
");
CellTemp.Append("<TextBox ");
CellTemp.Append("Text='{Binding myElement,
Mode=TwoWay}'></TextBox> ");
CellTemp.Append("</DataTemplate>");

gt = new DataGridTemplateColumn();
dt =
(DataTemplate)XamlReader.Load(CellTemp.ToString());
((DataGridTemplateColumn)(gt)).CellTemplate
= dt;

Also adding events for KeyDown like on the forum :
http://forums.silverlight.net/forums/p/191624/442641.aspx

But I cannot capture, for some reason CellEditEnded & RowEditEnded events
(the cells are auto - editing).
I think not doing the cells auto-edit, but doing this on some other trick,
like : CurrentCellChanged on the grid.
But, finally - how can I capture the CellEditEnded & RowEditEnded events?

Thanks :)

0 new messages