Results 1 to 40 of 40

Thread: S Grid Help

Hybrid View

  1. #1

    Thread Starter
    Addicted Member epod69's Avatar
    Join Date
    Feb 2005
    Location
    Cambridge, WI - USA
    Posts
    239

    Re: S Grid Help

    Ok, sorry for that late reply, I got the columns to sort!! I cant be too excited though because for some reason its not sorting how its suppose to..

    Here is my code:

    VB Code:
    1. '##############################################
    2.     '############## ACTIVATE ######################
    3.     '##############################################
    4.    
    5.     ' align morning grid
    6.  
    7.     With MorningGrid
    8.    
    9.         If .Rows > 0 Then
    10.                
    11.             With MorningGrid.SortObject
    12.            
    13.                 .Clear
    14.                 .SortColumn(1) = 2
    15.                 .SortColumn(2) = 3
    16.                 .SortColumn(3) = 1
    17.                 .SortOrder(1) = CCLOrderAscending
    18.                 .SortOrder(2) = CCLOrderAscending
    19.                 .SortOrder(3) = CCLOrderAscending
    20.                 .SortType(1) = CCLSortNumeric
    21.                 .SortType(2) = CCLSortString
    22.                 .SortType(3) = CCLSortDateMinuteAccuracy
    23.            
    24.             End With
    25.            
    26.             .Sort
    27.            
    28.             '// Debugging Purposes //
    29.            
    30.             For i = 1 To .Rows
    31.            
    32.                 For ii = 1 To 3
    33.                
    34.                     .SelectedRow = i
    35.                     .SelectedCol = ii
    36.                    
    37.                     Debug.Print .CellText(i, ii)
    38.                    
    39.                 Next ii
    40.            
    41.             Next i
    42.            
    43.             '// End of Debugging //
    44.            
    45.         End If
    46.        
    47.     End With
    48.  
    49.     ' align afternoon grid
    50.    
    51.     With AfternoonGrid
    52.    
    53.         If .Rows > 0 Then
    54.            
    55.             With MorningGrid.SortObject
    56.                
    57.                 .Clear
    58.                 .SortColumn(1) = 2
    59.                 .SortColumn(2) = 3
    60.                 .SortColumn(3) = 1
    61.                 .SortOrder(1) = CCLOrderAscending
    62.                 .SortOrder(2) = CCLOrderAscending
    63.                 .SortOrder(3) = CCLOrderAscending
    64.                 .SortType(1) = CCLSortNumeric
    65.                 .SortType(2) = CCLSortString
    66.                 .SortType(3) = CCLSortDateMinuteAccuracy
    67.            
    68.             End With
    69.            
    70.             .Sort
    71.            
    72.             '// Debugging Purposes //
    73.            
    74.             For i = 1 To .Rows
    75.            
    76.                 For ii = 1 To 3
    77.                
    78.                     .SelectedRow = i
    79.                     .SelectedCol = ii
    80.                    
    81.                     Debug.Print .CellText(i, ii)
    82.                    
    83.                 Next ii
    84.            
    85.             Next i
    86.            
    87.             '// End of Debugging //
    88.            
    89.         End If
    90.        
    91.     End With

    Here is my what comes up on the debug:

    This is for the Morning Grid
    09:00 AM Showing / 09.00 / Showing
    09:15 AM Appointment / 09.15 / Appointment
    10:50 AM Appointment / 10.50 / Appointment

    This is for the Afternoon Grid
    12:00 PM Appointment / 12.00 / Appointment
    04:00 PM Showing / 16.00 / Showing
    06:00 PM Open House / 18.00 / OpenHouse
    01:30 PM Appointment / 13.30?? / Appointment
    06:20 PM To-Do / 18.20 / ToDo

    So as you can see, something isnt right when sorting the afternoon grid. I am using the same code for the other grid and the other one works just fine. So I am stuck AGain!!
    Any Suggestions??

    Btw, thanx for helping me out so far!

  2. #2
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    Re: S Grid Help

    Hi,

    Are you using
    With MorningGrid.SortObject
    with the Afternoon grid, instead of
    With AfternoonGrid.SortObject

    I cannot tell which data is in which columns from the example data you are showing.

    If the above does not fix your problem, you can prepare a subset of your pgm, and send it to me (and illustrate what you expect the data to look like after sorting)

    Rob
    Rob C

  3. #3

    Thread Starter
    Addicted Member epod69's Avatar
    Join Date
    Feb 2005
    Location
    Cambridge, WI - USA
    Posts
    239

    Re: S Grid Help

    Quote Originally Posted by RobCrombie
    Hi,

    Are you using
    With MorningGrid.SortObject
    with the Afternoon grid, instead of
    With AfternoonGrid.SortObject

    I cannot tell which data is in which columns from the example data you are showing.

    If the above does not fix your problem, you can prepare a subset of your pgm, and send it to me (and illustrate what you expect the data to look like after sorting)

    Rob
    Umm...lol, im an idiot ^-^!! Thanx soo much for noticeing.
    Now the only other thing I have to work on is getting two cells to merge, or make it seem as they are merged. I think I am going to have to use the group method... so if you have any other suggestions, that would be great!! Thanx!

  4. #4
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    Re: S Grid Help

    Hi,
    Regarding Merging Cells

    You could switch off the vertical grid lines, and align text in two adjoing cells as Right and Left.
    However I raise the question 'is it a clean solution' to be merging columns ?
    The SGrid can be used for a variety of needs, and no doubt some of them may find merging useful.
    But with structured data, surely not ?
    If you are displaying data that is like a visible multi-dimensional array
    (typical use of a grid with columns and Rows), why would you want to merge some of that ?

    Rob
    Rob C

  5. #5
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    Re: S Grid Help

    PS,

    If it is a desire to show more data than is visible in the cell, you can solve that by having a ToolTip for each cell.
    I have ToolTips om many of my cells, and in one particular column, all the cells have a multi-line ToolTip, that shows 4 dates connected with the Job
    (Creation Date, Date it became a Firm Job. Date it was completed, optional Date it was cancelled, etc)


    Rob
    Rob C

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: S Grid Help

    Hmmmm. I was actually going to post that, but wasn't sure about your methods.
    When you merge cells in a flexgrid, it just prevents the replication of adjacent cells that have duplicate information. They are grouped, and the first cell print whille the cellls below or to the right are blank. Not sure if that is what you wanted or not.

  7. #7
    Fanatic Member
    Join Date
    Mar 2002
    Location
    AUSTRALIA
    Posts
    603

    Re: S Grid Help

    Thanks for that.
    Reading your post reminds me of what I studied, long ago, and never used.
    So instead my mind invented it's own definition of merging.

    Before i prattle on further, perhaps epod69 could clarify what he needs.
    (In his post he says 'well kinda')

    If it is as you describe, then I suppose he could switch off grid lines, and his code could detect when the data in the cell below is the same, and blank the text in that cell. It could be done, but I wouldn't recommend adding complexity for cosmetic reasons.

    Rob
    Rob C

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