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
1770
undo checkbox value in cell
posted

Hello. I'm having a strange problem where I can't seem to undo the value in a check box field. The field is of type boolean. I'm not sure if this is a xamDataGrid thing or something else. I'm using MVVM and this is what I have:

<xamdatagrid DataSource="{Binding Data, Mode=TwoWay}">

<i:Interaction.Triggers>

<i:EventTrigger EventName="CellChanged">
<command:EventToCommand Command="{Binding OnCellChangedCommand}" PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>

</xamdatagrid>

private void OnCellChanged(CellChangedEventArgs e)
{

    var createEvent = (bool)e.Editor.Value;

    if(createEvent){//if the new value is true

       if(some logic){ e.Cell.Value = false }

   }

}

So looking at the first if statement. If the user checks an unchecked checkbox in a cell, I check whether he can in fact check that check box. If not, I want the checkbox to return to an unchecked state.

The statement  "e.Cell.Value = false" does not seem to be doing anything. Any ideas?