We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is it possible to have different selection on different rows?

Thread ID:

Created:

Updated:

Platform:

Replies:

70183 Nov 30,2007 10:08 AM UTC Jan 18,2008 02:30 PM UTC Windows Forms 9
loading
Tags: GridControl
ToDo
Asked On November 30, 2007 10:08 AM UTC

Hi,
I would like to know if pssoble to set different selection types on different row.
I would like to be able to have a
A) row where only cells are selected and in same table I would like to have
B) rows that are hole row is selected and also
C) Can I have cells that can not get focus and can not be selected.

Regards
ToDo


Administrator [Syncfusion]
Replied On November 30, 2007 10:30 AM UTC

You can do things like this in a GridControl and a GridDataBoundGrid. It can also be done in simple flat GridGroupingControls. But in a GridGroupingControl with nested tables where the only selection architecture supported is the Table.SelectedRecords collection, you can only have whole records selected. If you want such behavior in a arbitary GridGroupingControl, you would have to manage the whole process yourself.

Post the type of grid are you using and maybe we can post some specific code snippets if such selections are possible for your particular grid.


ToDo
Replied On November 30, 2007 11:59 AM UTC

Hi
I'm using GridControl

Regards,
ToDo


Administrator [Syncfusion]
Replied On November 30, 2007 01:25 PM UTC

You can use the SelectionChanging and SelectionChanged events in a GridControl to control selections. To avoid a cell accepting focus, you need to set gridControl1[row, col].Enbled = false;. Here is a little sample illustrating the use of these events.





WindowsApplication8.zip

ToDo
Replied On December 3, 2007 10:23 AM UTC

Hi again and thanks,
That is what I would like but
A) Clicking a cell in wholeSelectedRows does not make tha row become selected.
B) It does handle click and drag but nog shift and arrow keys although the selection becomes changed.

Regards,
ToDo


Administrator [Syncfusion]
Replied On December 3, 2007 12:16 PM UTC

Try changing the if statement to

if (e.Range != null && !e.Range.IsEmpty && (e.Reason == GridSelectionReason.MouseUp || e.Range.IsCells))


to see if that comes closer to what you need.



ToDo
Replied On December 3, 2007 12:46 PM UTC

Hi thanks,
yes It gets me closer.
But the following does not get selected correct:
1) select 1D and use shift+ down key; row 3 does not get selected
2) select tow white cells, use arrow keys to move between selected cells: the selection should be only the cell you moved to as when you step out of the selected area.

Regards,
ToDO



Administrator [Syncfusion]
Replied On December 3, 2007 01:50 PM UTC

Here is another example of how you can go about doing such things. To get the exact behavior you seek, you will have to tweak the code to get the behavior you want.




WindowsApplication8_2.zip

ToDo
Replied On January 7, 2008 01:27 PM UTC

Hi again!
I need to combine this funcionality with the possibility to select multiple lines and display a popup menu that should apply to all the selected rows. The problem is that when right clicking one the clicked row gets selected.
Could you help me out with the multiline and right click combination.

Regards,
ToDo


ToDo
Replied On January 18, 2008 02:30 PM UTC

Hi!
I really would appreciate help on this!
The myGrid_selectionChanging/Changed occurs before the myGrid_MouseDown event and the selection at right click is then lost.

How can I have this kind of selection and still get right click menu to work.

Regards,
ToDo




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;