Results 1 to 3 of 3

Thread: VB datagrid

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Posts
    1

    Angry

    Hi

    I have a datagrid bound to a recordset. What I want to be able to do is sort the data when I click on any heading on any of the columns within datagird.

    I've tried and tried but no luck

    Any help would be great!

    Thanks in advance

    Manny

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Location
    US, PA
    Posts
    79
    Try this code

    Private Sub dgUserList_HeadClick(ByVal ColIndex As Integer)

    adcUserList.RecordSource = "Select * From tlkpOlarisUsers order by " & _
    dgUserList.Columns(ColIndex).DataField
    End Sub

  3. #3
    New Member
    Join Date
    Apr 2001
    Posts
    7
    Try to use MSHFlexGrid. Code example:

    Set Me.MSHFlexGrid1.DataSource = Me.adcReport

    Me.MSHFlexGrid1.Sort = 7

    Sort Property
    -----------------
    flexSortNone 0 None.
    flexSortGenericAscending 1
    flexSortGenericDescending 2
    flexSortNumericAscending 3
    flexSortNumericDescending 4 flexSortStringNoCaseAsending 5 flexSortNoCaseDescending 6
    flexSortStringAscending 7
    flexSortStringDescending 8

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width