0

Helo all:

I have two dataGridViews on a form and id like to be able to extend the multiSelect property across both if them.

i.e. Id like to be able to hold down the ctrl key and click in dgv A AND dgv B and for them to hold those selections.

At the moment if I ctrl click in dgv A and then ctrl click in dgv B - all the elements selected in dgv A are cleared.

Am I being a little ambitious here or is this possible?

Thnx

Tino

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by TinoMclaren
0

I'm not sure if theres a built in way of doing it...but you could simulate it; Use the RowSelected event to change the background of the row to maintain the selected colour when the datagridview loses focus. Then each time a row is clicked use a List to store a record of the index of rows which were selected in each grid.
You'll need to catch the KeyDown event to trap whether teh CTRL key is down when rows are clicked.

If you need a hand with code i'll see what i can knock out later, tied up with work stuff at the mo. Have a go and shout if you get stuck.

0

I'm not sure if theres a built in way of doing it...but you could simulate it; Use the RowSelected event to change the background of the row to maintain the selected colour when the datagridview loses focus. Then each time a row is clicked use a List to store a record of the index of rows which were selected in each grid.
You'll need to catch the KeyDown event to trap whether teh CTRL key is down when rows are clicked.

If you need a hand with code i'll see what i can knock out later, tied up with work stuff at the mo. Have a go and shout if you get stuck.

Hi Ryshad

Thanks will give it a try tomorrow.

Thanks for the help

Tino

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.