when selecting new cell on new row in wpf datagrid, seems done through 2 sequential events take path "a" in figure below. these following events:
currentcellchanged
(for shifting selection within current row)selectedcellschanged
(for shifting selection of rows)
due background actions have going on datagrid , bound datatable, need able mimic taking path "b". can't find other events triggered when clicking next cell allow me this.
does have idea here?
i have 1 idea should work, seems hack , imagine there must better way works datagrid , not around it.
additional info
i doing sort of independent row-by-row cell selection marker, use currentcellchanged
perform action if user changes selection within row cell meets criteria. however, if selection on different column of row, action still first performed on deselected row, , again on newly selected row once selectedcellschanged
occurs.
if path "b" taken, setup work correctly.
for i'm using following method avoid problem:
- when
currentcellchanged
event causes change in markers on row, private boolean property of form set record 'true' changed event, , before & after values 1 of changes recorded. - if
selectedcellschanged
event occurs, routine checks boolean flag. if indicates change, actions incurrentcellchanged
reversed appropriate row using recorded data before action done inselectedcellschanged
. since far can tellselectedcellschanged
never occurs alone , followscurrentcellchanged
, method should reliable (famous last words).
sorry lack of code, seems me drawing , event names should suffice describing strategy need! if code samples help, can provide if indicate need see.
Comments
Post a Comment