Enabling "Multi select" on a datagridview
I want to force the datagridview to act as if I am holding down Control all the time. E.g; If I click a cell, it highlights, and if I click another separate cell, it highlights without the first becoming deselected.
The reason for this is I am running the app on a touch screen, and need this function without a keyboard.
I would prefer not to emulate holding down ctrl for the entire form, as this may mess with some of my other objects. But I will if no one can think of a better solution.
I have datagridview.multi开发者_开发知识库Select enabled.
While it isn't ideal, you could handle the OnMouseUp event and get a list of the currently selected rows as well as the row that was just clicked and then programatically select the required rows again.
You would need to see if the current row was already select it and then toggle the unselect it if necessary also.
I'm sure someone will have a better idea of how to do this, but if not, try this at any rate.
精彩评论