|
-
Mar 3rd, 2005, 10:53 AM
#1
Thread Starter
Addicted Member
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:
'##############################################
'############## ACTIVATE ######################
'##############################################
' align morning grid
With MorningGrid
If .Rows > 0 Then
With MorningGrid.SortObject
.Clear
.SortColumn(1) = 2
.SortColumn(2) = 3
.SortColumn(3) = 1
.SortOrder(1) = CCLOrderAscending
.SortOrder(2) = CCLOrderAscending
.SortOrder(3) = CCLOrderAscending
.SortType(1) = CCLSortNumeric
.SortType(2) = CCLSortString
.SortType(3) = CCLSortDateMinuteAccuracy
End With
.Sort
'// Debugging Purposes //
For i = 1 To .Rows
For ii = 1 To 3
.SelectedRow = i
.SelectedCol = ii
Debug.Print .CellText(i, ii)
Next ii
Next i
'// End of Debugging //
End If
End With
' align afternoon grid
With AfternoonGrid
If .Rows > 0 Then
With MorningGrid.SortObject
.Clear
.SortColumn(1) = 2
.SortColumn(2) = 3
.SortColumn(3) = 1
.SortOrder(1) = CCLOrderAscending
.SortOrder(2) = CCLOrderAscending
.SortOrder(3) = CCLOrderAscending
.SortType(1) = CCLSortNumeric
.SortType(2) = CCLSortString
.SortType(3) = CCLSortDateMinuteAccuracy
End With
.Sort
'// Debugging Purposes //
For i = 1 To .Rows
For ii = 1 To 3
.SelectedRow = i
.SelectedCol = ii
Debug.Print .CellText(i, ii)
Next ii
Next i
'// End of Debugging //
End If
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!
-
Mar 3rd, 2005, 06:57 PM
#2
Fanatic Member
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
-
Mar 3rd, 2005, 10:49 PM
#3
Thread Starter
Addicted Member
Re: S Grid Help
 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!
-
Mar 5th, 2005, 01:45 AM
#4
Fanatic Member
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
-
Mar 5th, 2005, 01:50 AM
#5
Fanatic Member
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
-
Mar 5th, 2005, 02:04 AM
#6
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.
-
Mar 5th, 2005, 02:38 AM
#7
Fanatic Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|