Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Another Flexgrid Question

Posted on 1998-12-12
5
Medium Priority
?
529 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 150 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

886 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