I have a listview. By default, all items have itemInvoke and single-selection enabled. But now, I would like to disable selection and itemInvoke (both event and animation) for one particular item with id “disableMe”. Is there a way to do it? Or is it possible to disable the event for the whole group (not the whole listview).?
I have a listview. By default, all items have itemInvoke and single-selection enabled. But
Share
Answering my own question because I happened to figure it out today. Please advice if you have better solution for this issue.
In Metro Style Application, selection in ListView control can usually be triggered by
Right-Clickwith mouse or by a small ‘drag’/’swipe’ with touch. To disable touch selection, you need to overwrite theMSPointerDownevent handler for that particular item. To disable ‘Right-Click’ selection, you need to overwrite theoncontextmenuevent for that particular item.If you are creating
itemTemplateinJavascript: