Hi,
i have set a cell value presenter to show a normal wpf-combo box right inside the grid. Now if i open the column filter combobox and click an item inside the drop down area of the column filter it will not select the filtered value.
Instead the combo box inside the cell area will be opened that is just behind the filter value i was intended to select. It behaves just as if the dropdown area of the filter area was not there.
Hello KarlMichael,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thank you very much! I think this will work. Ok, there's now the selected record twice in the SElectedItems but i can sort that out. Thanks again!
I have modified the sample, so now I created a Style for the DataRecordPresenter and handled its PreviewMouseDown event in which I selected the Record. This way it doesn’t matter what control is placed in the Cells. Also it is no longer needed to set the CellClikAction to SelectRecord.
Hope this helps you.
HEllo Stefan,
thank your for your proposal but i'm really sorry it is not practical because of the dependencies to the controls and the individual behaviour of each control and the likely case of data loss if a new control is added to the grid which is not handled in the code behind. [1]
We need to go a step back, because i find the initial problem was another one:
1. I comment out the mouse event handler
2. I have added code to isplay the view model state received via selecteditemschanged event (see itemscontrol below the grid)
3. I click in one of the controls
4. The row is hihglighted and the active record arrow is displayed. It just looks like if the record is selected.
5. Problem: it isn't selected in the view model because the selecteditemchanged event does not occur.[1]
6. So i ask, wether it's a bug or a feature... I think the selecteditemchangedevent shall be fired properly.
[1] (And this is where a user can lose data because if he presses the delete button now he will delete a record but not the record he thought he would delete. beccause the active record displayed does not correspond to the active record in the view model.
I have modified the sample, so now it has the functionality you want. Basically I add a check if the OriginalSource of the MouseClick is ButtonChrome and if it is this means that the click comes from the ComboBox and then use your code to selct the Record.