Solved

Another Flexgrid Question

Posted on 1998-12-12
5
514 Views
Last Modified: 2012-06-21
How would I trap a click or mousedown event to the Header of a flex grid??? An example would be if I user clicks the Name header of the grid. I want the rows to be sorted in order of Name. Any ideas?? Code would be helpful
0
Comment
Question by:gcw
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
traygreen earned 50 total points
ID: 1449702
The click event is the way to go...
0
 
LVL 3

Expert Comment

by:traygreen
ID: 1449703
code as follows or set up however you want....


Private Sub grdTest_Click()
   Static SortOrder As SortSettings

   If grdTest.Row = 0 And grdTest.Col <> 0 Then
      If SortOrder = flexSortNone Or SortOrder = flexSortGenericDescending Then
         grdTest.Sort = flexSortGenericAscending
      Else
         grdTest.Sort = flexSortGenericDescending
   End If
End Sub
0
 

Author Comment

by:gcw
ID: 1449704
I suppose there is a problem with the flexgrid settings. Everytime I click anywhere on the header, it always wants to select the first item in the list.  So flex1.row will always = 1. What are your default settings when you try your code. It doesn't seem to work on my end.. thanks!

GCW
0
 
LVL 3

Expert Comment

by:traygreen
ID: 1449705
I have fixedrows set to 1...
Short of that nothing.  We use it all of the time.

other than that....

   Begin vsFlexLib.vsFlexArray grdQuery
      Height          =   1452
      Left            =   180
      TabIndex        =   16
      Top             =   1080
      Width           =   7092
      _Version        =   196608
      _ExtentX        =   12509
      _ExtentY        =   2561
      _StockProps     =   228
      Appearance      =   1
      ConvInfo        =   1418783674
      FormatString    =   $"OrderQ.frx":08CA
      Rows            =   2
      Cols            =   7
      FixedCols       =   0
      ScrollBars      =   2
      SelectionMode   =   1
      AllowBigSelection=   0   'False
      AllowSelection  =   0   'False
   End

This instance is using the vsflexgrid, but the code and parameter settings are the same for MSFlex.  If you still are having problems, email me the form @ traygreen@hotmail.com and I'll see what I can do.

0
 

Author Comment

by:gcw
ID: 1449706
I mentioned this problem on a newsgroup.  I was told not to use the click event but the mousedown event and do a select case on .mousecol, which does what I want. I appreciate your help anyway. One of the settings you used (AllowSelection  =   0) does not show up as a valid property or method for the msflexgrid.. so there may be diferences.  Is the vsflexgrid control shareware?? I may want to try it to compare the two.

GCW
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question