问题
I am using a PDA in which I have a DataGrid that has a list of itemNames, barcode, and scanStatus. The user scans a barcode and I search in my DataGrid for a match and I select the row for the item that is associated with the barcode. I set the scanStatus to true.
I was having a problem with the user touching the screen and the DataGrid's rows all got unselected.
So I tried to handle the DataGrid's Click, DoubleClick, and the MouseUp events. I loop through my grid where scanStatus is true and call grid.Select(iteratorIndex) else I call grid.UnSelect(iteratorIndex).
This re-selects the scanned item's rows. But the last cell that the user clicked also stays selected. How do I unselect that cell? I did search before posting and the only thing remotely matching my situation was this thread, I tried the advice there but it but that did not answer my question.
来源:https://stackoverflow.com/questions/13491612/datagrid-programmatically-unselect-a-cell