Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Flex Grid 2

Status
Not open for further replies.

dmando84

Programmer
Dec 28, 2005
68
US
Hello,

I have a Microsoft Flex Grid that I populated using data from SQL Server. I also have 3 option buttons that I am using to sort the flex grid... FName,LName,CoName. I have the grid sorting, but the problem I am having is that I am repopulating the grid everytime the user needs to sort the grid. Does anyone know how to sort data within the MS Flex grid instead of me making trip after trip back to the database and slowing down the server?
Any help would be appreciated...

Thanks,

David





 
Look into the .Sort property. I am not sure of the syntax required.

zemp
 
Put this code in DblClick event of the flex grid.
Here the grid is called grdGrid:

Code:
Private Sub grdGrid_DblClick()
Static blnSort As Boolean

With grdGrid
    If .MouseRow = 0 Then
        .Col = .MouseCol
        .ColSel = .MouseCol
        .RowSel = .Row
        If blnSort = True Then
            .Sort = flexSortStringNoCaseAscending
            blnSort = False
        Else
            .Sort = flexSortStringNoCaseDescending
            blnSort = True
        End If
    End If
End With

End Sub

HTH

---- Andy
 
Thank you for your response, but I have 1 question...

What is 'flexSortStringNoCaseAscending'? Is this a variable or a VB keyword...

Dave
 
There are actually more then the two sort directions.
flexSortStringNoCaseAscending and flexSortStringNoCaseDecending are for strings. There are two others used for integers so you need to obtain the columns values depending on which one you want to sort by.
you can apply the .Sort to each column from the flexgrids click event.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top