Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 12th, 2005, 3:45 PM   #1
mono
Newbie
 
Join Date: Apr 2005
Posts: 3
Rep Power: 0 mono is on a distinguished road
Trouble to select many rows on a MSFlexGrid

I need urgent help I need to select many entire rows not cells of my MSFlexGrid pressing CTL just like Excel does.


Thanks for helping me.
best regards
mono is offline   Reply With Quote
Old Apr 12th, 2005, 5:37 PM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
The current position (cursor) of the grid is given by (row, col). Thus the selection is defined in terms of another point (rowsel, colsel) that defines the selection vector. Note that the latter does not necessarily need to be to the bottom right of the cursor.

Here's a neat function that'll select a row:
Public Sub SelectARow(ByRef FG As MSFlexGrid, ByVal Index As Long)
With FG
    .Row = Index ' Top of selection
    .RowSel = Index ' Bottom of selection
    .Col = 0 ' Left of selection (left-most column)
    .ColSel = .Cols - 1 ' Right of selection (right-most column)
    ' N.B. Index here begins at 0 not 1
End With
End Sub

So for example:

Private Sub Form_Click()
SelectARow MSFlexGrid1, 4
End Sub

Hope you find this helpful.
Rory is offline   Reply With Quote
Old Apr 12th, 2005, 7:25 PM   #3
mono
Newbie
 
Join Date: Apr 2005
Posts: 3
Rep Power: 0 mono is on a distinguished road
Thanks but what i want is....

If you open Excel one click on the fixed col where the row numbers are, then press Ctrl on another consecutive or non-consecutive row see what happens, now i selected two rows if i select another row without pressing Ctrl the new row gets selected and every other row that i had select before is not selected anymore
that is want to do in my msflexgrid

Thanks 4 your time
I hope u can help me again
mono is offline   Reply With Quote
Old Apr 13th, 2005, 12:52 PM   #4
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Sorry: selections in the FlexiGrid have to be continuous (i.e. a rectangle shape) so you can't have a selection made up of separate areas, or polygonal selections. This would bloat and complicate a control that is designed to simply represent a collection of data as efficiently as possible.

If you want to allow polygonal selections, focus bands, dual and meta data (e.g. for formulas) then you're writing a spreadsheet not a grid.

There may be some obscure activeX control that does it, but certainly not one from Microsoft. I would suggest either using a spreadsheet OLE object provided by OpenOffice or Microsoft Office (Components -> Insertable Objects) or writing your own control from scratch.
Rory is offline   Reply With Quote
Old Apr 14th, 2005, 9:48 PM   #5
mono
Newbie
 
Join Date: Apr 2005
Posts: 3
Rep Power: 0 mono is on a distinguished road
Thanks

Thanku Rory i apreciate it so much

BYE
mono is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC