Clay...
The solution you suggested for tabbing out of a grid does not work when used in conjunction with the solution you provided me to highlight the entire row. When i handle the CurrentCellActivating event and set the colindex to 0 it doesnt even fire the WrapCellNextControlInForm.
As for the other solution i think you misunderstood me. What i want to do is disable the default behavior of the control key and the arrow keys (this has nothing to do with selection). Basically what i want to do is be able to hold down the control key and have it scroll 1 row at a time vs 1 page at a time.
Thanks again for your replys.
-Josh-
> 1) If you want to tab out of the grid into the next control on the form, try setting this property:
>
>
> Me.CustomGridControl1.Model.Options.WrapCellBehavior = GridWrapCellBehavior.NextControlInForm
>
>
> Now if your grid is directly on a form, this is all you have to do. If your grid is on a panel, or groupbox or tabpage or some other container, then you will also have to handle the WrapCellNextControlInForm event and actually move the focus to where you want it in your container.
Here is a sample that might help. The sample has 2 grids, the one on the left is parented to the form, and the one of the right is on a panel. Out of the box, just setting the NextControlInForm value, makes the grid on the left behave as expected, allowing you to tab from button1 to the grid to button2. But the grid on the panel does not behave as expected. There you tab from button3 to the grid to button 1, passing over button 4 which is the next button on the panel.
>
> The way to handle this problem is to catch the WrapCellNextControlInForm event, and set the focus the way you want it done depending upon the parent container being used. In the sample, there is commented code in the handler that will move the focus on the panel (the way you might expect). The reason the grid architect opted to expose an event to handle this is that he did not want to try to add code to handle arbitary containers. Instead, the default behavior should handle a form as a parent, but if you have something else, then you will have to use the event.
>
> 2) In the AllowSelection property, there is a KeyBoard flag you can turn off. I am not sure this what you want though.
>
> You can cancel any selection change by handling the grid.Model.SelectionChanging event. In it, you can test to see if the control key is pressed, cancel the action.
>
>
> private void gridControl1_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
> {
> if((Control.ModifierKeys & Keys.Control) != 0)
> {
> e.Cancel = true;
> return;
> }
> }
>
>