Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Current left column to right of locked columns
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01364611
Message ID:
01364787
Vues:
17
Hi Craig

Blimey, lets see if I can explain:

The form contains a grid of 54 columns. The first two are Treatment description, and the second is a price. The rest of the columns are week nos 1-52.

Since the grid has too many columns to display all 54 at once on some screen resolutions, the user requires to see the first two columns at all times, and the week numbers to scroll horizontally.

The customer wants the grid headings to also show what month each week no is in. However, the weeks are obviously not split up exactly into months.

I have added another grid on top of the main grid just to display these extra headings, and got my code to adjust the width of each month to match pretty much the fraction of the weeks they start/finish.

I want to know what is the 1st visible column of unlocked columns, so I can resize the months headings on my extra grid to match the main grid when the customer scrolls horizontally.

I didnt go into details about what I was ultimately trying to do, because I felt this just confused the issue.

When I run Cetins code,I get the third column even when I scroll and horinzontally and its not visible.

In order to lock the 1st two columns I have entered 2 into the lockcolumns property. I havent entered anything else into the grid. I'm not using a partition, and have panel link set to .f.

Have I missed a setting or two?

I've done a simpler test form and made sure the order of the columns is sequential.

If I can get the code to correctly identify the left most visible column im sure I can get the second grids heading to match the main grid. Maybe im trying to crack a nut with a teaspoon, but I pretty much am determined to get this to work. LOL

If I can't get this to work, this will honestly be the first time I have not managed to get FP/VFP to do what I want. I know grids cant have the sort of headings I need, but this way it will look like it.

Thanks for all your help so far.

Robin








>OK, now I'm confused. How does the splitter bar mess up objtoclient for you? What you're saying doesn't make sense. The split bar doesn't cause additional columns to disappear to the left of the lock in the right partition... if anything they would disappear to the right of the grid. Which partition are you locking (left or right or both)? Are both partitions synchronized or do you have them PanelLink set to .F.? (might be easier if you just provided a simple repo).
>
>In any event, I don't see how the split bar would make a difference. The only thing I can think of is that you have reordered the columns and Cetin's original code doesn't step through the columns in column order (which it should as noted in an earlier discussion in this thread). But, I might just be bloody confused about what you're trying to accomplish... As I understood it, you are locking 2 columns in the right partition and then scrolling to the right which causes columns 3 and 4 (for instance) to disappear and now column 5 is just to the right of the locked columns... and as far as I can tell (other than the column order thing) Cetin's code will give you the index of column 5 within MyGrid.Columns(indexreturned) as long as it is visible and you haven't moved the splitter all the way to the right making none of the columns visible in which case you may need to work with MyGrid.Partition which will tell you how large the user has made the partiion. If they've made it large enough that there isn't room on the right for any of your unlocked columns, well then you know that there isn't a column visible to the right of the locked columns.
>
>Another thing that would really help here is what you are trying to accomplish. I mean what is the business requirement that necessitates the need to know what the column is that is just to the right of the locked columns?
>
>>Hi Cetin
>>
>>In my test form when I scroll the second half of my split grid (2 locked columns), the code tells me that the left most column is 3, but in my test column 3 is not visible?
>>
>>The code steps from column3, and reports that the left is 951 not less than zero?
>>
>>Not sure what i'm missing here?
>>
>>Robin
>>
>>
>>
>>>Robin,
>>>Exactly that.
>>>The code would return you the first 'human' visible column's 'index' after the locked columns. All you need is to:
>>>
>>>lnIndex = GetColumnOnLeft( thisform.myGrid )
>>>oColumn = thisform.myGrid.Columns( m.lnIndex )
>>>
>>>Cetin
>>>
>>>
>>>>Hi Cetin
>>>>
>>>>I want to know what the 1st visible column is after the locked columns, even if the user has used the vertical scrollbar.
>>>>
>>>>When I say visible I dont mean the property, I mean that the user can see in the grid.
>>>>
>>>>Robin
>>>>
>>>>
>>>>>>If I have a grid with several columns locked, is it possible work out what the first visible column on the right of the split is?
>>>>>
>>>>>From http://www.foxite.com/archives/column-locking-in-a-grid-0000198556.htm
>>>>>
* GetColumnOnLeft.prg
>>>>>LPARAMETERS toGrid
>>>>>Local ix
>>>>>With toGrid
>>>>>  For ix = .LockColumns+1 To .ColumnCount
>>>>>    If Objtoclient(.Columns(m.ix),2) > 0
>>>>>      Return m.ix
>>>>>    Endif
>>>>>  Endfor
>>>>>Endwith
>>>>>return -1
>>>>>Cetin
Rob
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform