jeudi 19 mars 2020

DataGridCheckBoxColumn click event

Requirement is to trigger event when DataGridCheckBoxColumn checkbox is clicked and save its state to app.config i'm at stage when correct event must be triggered.

There what I got:

<DataGridCheckBoxColumn Header="ACTIVE" Binding="{Binding ACTIVE}">
  <DataGridCheckBoxColumn.CellStyle>
   <Style>
    <EventSetter Event="CheckBox.Checked" Handler="OnChecked"/>
   </Style>
 </DataGridCheckBoxColumn.CellStyle>
</DataGridCheckBoxColumn>

Therefore when application loaded the event triggered by self because I'm loading settings.

Another issue is that when I'm pressing on checkbox from different row which is not selected the checkbox is change status but event wont trigger.

Also event triggers for each checkbox active row when sorting it.

I tried use Event="CheckBox.Click" but then pressing on checkbox just focused ro and first time changing of checkbox state not triggering event. when it checked once everything working correct. But I want Just press checkbox and its state must change and then state must be saved to further application usage after it restart

Maybe someone can lead me correct way how obtain method when checkbox of data grid column is clicked?




Aucun commentaire:

Enregistrer un commentaire