Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi All,

 

Okay I've been banging my head against a wall for a day now trying to come up with a what appears to be a simple solution to the following question: How do you allow multi-selection of rows while clicking on the cells?

 

In a normal DataGrid you can select multiple rows by holding down Ctrl or Shift and clicking in the Left side Column bar.

 

There is code available that allows you to select the entire row when you click on an individual cell, but this doesn't replicate the functionality of clicking inside the RowHeaders (ie the usual Ctrl-Click to select) - it always selects only a single row and then de-selects everything else.

 

What I would like to do is the following:

- Allow the user to click in any cell (the entire dataGrid is read-only), and then it selects the whole row

- Hold down Ctrl- or Shift- and click on another cell and it acts like a multi-select and selects, well, multiple rows.

 

Anybody got any advice becuase I'm rapidly losing hair over this ;)

 

Regards

Delphy

Posted
I think you would need to use the code that works to select a single row and add it to an array. Then every time the Click() event fires, add the single row you detected to the array.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...