Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
DataItem exposed on ExpansionIndicatorCellControl?
posted

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?

Parents
  • 40030
    Offline posted

    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

Reply Children