After read this article, I am trying to adapt the instructions to my xamGrid in Silverlight.
I have no problems on Code Behind, and my model has the IsChecked boolean exposed properly.
But, retemplating my xamGrid (the igPrim:ExpansionIndicatorCellControl) I added a checkbox, which will allow the user to select multiple rows.
The stage of my retemplate reached this point:
And the CheckBox has this code:
<CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" IsChecked="{Binding Path=DataItem.IsChecked}" />
But checking the CheckBox do not affect the DataItem, and even the data coming from the model with Ischecked = true also do not have effect.
Does the DataItem is visible inside the ExpansionIndicatorCellControl context?
Hi,
That article was actually for the WPF XamDataGrid, not the silverlight XamGrid.
Anyways, you should be able to use a RelativeSource binding, and access the Cell.Row.Data property, assuming you're in the ControlTemplate of the ExpansionIndicatorCellControl.
IsChecked={Binding RelativeSource={RelativeSource TemplatedParent}, Path=Cell.Row.Data.IsChecked}}
Hope this helps,
-SteveZ
Yes, I know that article is focused on WPF, but it was helpful to know the path.
I changed the Binding to relative source, but unfortunately without success.
The CheckBox is inside the <ControlTemplate>, so this should not be the problem. I attached the XAML fragment with the complete template of this particular cell, maybe it helps.
Just to be sure, I set my grid to auto generate columns and the IsChecked column appeared and displaying the right information.
So I'm not sure where the problem is beginning.