Datagrid programmatically unselect a cell

本小妞迷上赌 提交于 2019-12-11 03:55:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!