Preventing multi-row selection in MSHFlexGrid? 
Author Message
 Preventing multi-row selection in MSHFlexGrid?

Greetings,

Is there a way to prevent multi-row selection in an MSHFlexGrid? Didn't see
it as a property, but I might be overlooking it. I presume that you may have
to use some type of code triggered by LeaveCell() or EnterCell() that might
control this? Any ideas would be appreciated. I do have ForceRowSelection
turned on.

Thanks,

Casey



Fri, 26 Sep 2003 22:17:19 GMT  
 Preventing multi-row selection in MSHFlexGrid?
Private Sub MSFlexGrid1_MouseMove(Button As Integer, _
    Shift As Integer, X As Single, Y As Single)

    With MSFlexGrid1
        If .RowSel <> .Row Then
            .Row = .RowSel
            .Col = 0
            .ColSel = .Cols - 1
        End If
    End With

End Sub

This will force the selected row to move along with the mouse when the user
attempts to drag a selection.

Hope this helps,

Rocky Clark (Kath-Rock Software)


Quote:
> Greetings,

> Is there a way to prevent multi-row selection in an MSHFlexGrid? Didn't
see
> it as a property, but I might be overlooking it. I presume that you may
have
> to use some type of code triggered by LeaveCell() or EnterCell() that
might
> control this? Any ideas would be appreciated. I do have ForceRowSelection
> turned on.

> Thanks,

> Casey



Sat, 27 Sep 2003 03:01:16 GMT  
 Preventing multi-row selection in MSHFlexGrid?
Whoot! Awesome. 8)

Casey



Sat, 27 Sep 2003 03:08:41 GMT  
 Preventing multi-row selection in MSHFlexGrid?
Okay, I got this to work for mouse dragging, but it's still possible to
select multiple rows by holding down the shift key and an up or down arrow
at the same time. Any thoughts on this?

I tried slapping the same code into RowColChange() and LeaveCell(), neither
worked.

Casey


Quote:
> Private Sub MSFlexGrid1_MouseMove(Button As Integer, _
>     Shift As Integer, X As Single, Y As Single)

>     With MSFlexGrid1
>         If .RowSel <> .Row Then
>             .Row = .RowSel
>             .Col = 0
>             .ColSel = .Cols - 1
>         End If
>     End With

> End Sub

> This will force the selected row to move along with the mouse when the
user
> attempts to drag a selection.

> Hope this helps,

> Rocky Clark (Kath-Rock Software)



> > Greetings,

> > Is there a way to prevent multi-row selection in an MSHFlexGrid? Didn't
> see
> > it as a property, but I might be overlooking it. I presume that you may
> have
> > to use some type of code triggered by LeaveCell() or EnterCell() that
> might
> > control this? Any ideas would be appreciated. I do have
ForceRowSelection
> > turned on.

> > Thanks,

> > Casey



Sat, 27 Sep 2003 04:55:32 GMT  
 Preventing multi-row selection in MSHFlexGrid?
Try the SelChange event of the FlexGrid.


Quote:
> Okay, I got this to work for mouse dragging, but it's still possible to
> select multiple rows by holding down the shift key and an up or down arrow
> at the same time. Any thoughts on this?

> I tried slapping the same code into RowColChange() and LeaveCell(),
neither
> worked.

> Casey



> > Private Sub MSFlexGrid1_MouseMove(Button As Integer, _
> >     Shift As Integer, X As Single, Y As Single)

> >     With MSFlexGrid1
> >         If .RowSel <> .Row Then
> >             .Row = .RowSel
> >             .Col = 0
> >             .ColSel = .Cols - 1
> >         End If
> >     End With

> > End Sub

> > This will force the selected row to move along with the mouse when the
> user
> > attempts to drag a selection.

> > Hope this helps,

> > Rocky Clark (Kath-Rock Software)



> > > Greetings,

> > > Is there a way to prevent multi-row selection in an MSHFlexGrid?
Didn't
> > see
> > > it as a property, but I might be overlooking it. I presume that you
may
> > have
> > > to use some type of code triggered by LeaveCell() or EnterCell() that
> > might
> > > control this? Any ideas would be appreciated. I do have
> ForceRowSelection
> > > turned on.

> > > Thanks,

> > > Casey



Sat, 27 Sep 2003 05:24:14 GMT  
 Preventing multi-row selection in MSHFlexGrid?
Is there any way that you have found to select non adjacent rows?  I want
the users to be able to use the ctrl key to select multiple rows with the
mouse by click on them and keep the rest of them selected.  Shift works to
do a group but only if they are adjacent.


Quote:
> Greetings,

> Is there a way to prevent multi-row selection in an MSHFlexGrid? Didn't
see
> it as a property, but I might be overlooking it. I presume that you may
have
> to use some type of code triggered by LeaveCell() or EnterCell() that
might
> control this? Any ideas would be appreciated. I do have ForceRowSelection
> turned on.

> Thanks,

> Casey



Sun, 14 Dec 2003 14:58:08 GMT  
 Preventing multi-row selection in MSHFlexGrid?
The mshflexhgrid does not support multiple non-contiguous row selection. The
nearest you can come to it is set the highlight property to 'never' and then
on the appropriate event, change the cellbackcolor and cellforecolor
properties to give the appearance of selection.

Private Sub MSHFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As
Single, y As Single)
Dim lngCurrentRow As Long
With MSHFlexGrid1
    .FillStyle = flexFillRepeat
    .SelectionMode = flexSelectionByRow
    If Shift And vbCtrlMask = vbCtrlMask Then
        If .CellBackColor = .BackColor Then
            .CellBackColor = vbHighlight
            .CellForeColor = vbHighlightText
        Else
            .CellBackColor = .BackColor
            .CellForeColor = .ForeColor
        End If
    Else
        lngCurrentRow = .Row
        .Row = .FixedRows
        .Col = .FixedCols
        .RowSel = .Rows - 1
        .ColSel = .Cols - 1

        .CellBackColor = .BackColor
        .CellForeColor = .ForeColor
        .Row = lngCurrentRow
        .Col = .FixedCols
        .ColSel = .Cols - 1

        .CellBackColor = vbHighlight
        .CellForeColor = vbHighlightText
    End If

    End With
End Sub


Quote:
> Is there any way that you have found to select non adjacent rows?  I want
> the users to be able to use the ctrl key to select multiple rows with the
> mouse by click on them and keep the rest of them selected.  Shift works to
> do a group but only if they are adjacent.



> > Greetings,

> > Is there a way to prevent multi-row selection in an MSHFlexGrid? Didn't
> see
> > it as a property, but I might be overlooking it. I presume that you may
> have
> > to use some type of code triggered by LeaveCell() or EnterCell() that
> might
> > control this? Any ideas would be appreciated. I do have
ForceRowSelection
> > turned on.

> > Thanks,

> > Casey



Mon, 15 Dec 2003 02:20:55 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. prevent MSHFLexGrid moving to other row

2. Selection of multiple non-consecutive rows with MSVB's MSHFlexGrid Control

3. single row selection MSHFlexGrid

4. what is the best way to remove a large selection of rows from an Mshflexgrid

5. Selection Rows in MSHFLEXGRID ( Help me )

6. Full row selection in MSHflexgrid does not select first column

7. print a selection of rows on a MSHFLExgrid

8. print a selection of rows on MSHFLexgrid

9. Disable multi-row select in MSHFlexGrid

10. Multi rows selection in MSFLEXGRID

11. Multi rows selection in MSFLEXGRID

12. How can I remove a multi selection of rows from a mshflexgrid?

 

 
Powered by phpBB® Forum Software