Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid problem
Message
 
To
11/08/2000 11:51:10
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00403742
Message ID:
00403985
Views:
16
>>>>Hi:
>>>>I have a problem with a grid that has 10 columns and depending on a variable based on the first column, needs to have less columns (sometimes as little as 2). I think that the RemoveObject Method (help says Object.RemoveObject(cObjectName) might help but I am not sure of how to implement it in on the grid.
>>>>Any hints?
>>>>
>>>>Thank you.
>>>
>>>
DeleteColumn is the normal way for removing column objects from a grid.
>>>Cetin
>>
>>Thanks Cetin!
>> I tried - This.DeleteColumn(12) - The columns I want to remove are in the middle of the grid and the rest of the columns are wiped out as well.
>>Any suggestions?
>
>
I'm confused a liitle. You have 10 fields and you deletecolumn(12) ? AFAIK if value you pass is greater than columncount then nothing is removed. If you omit it then last column is removed. The parameter is the 'order' of column as you see in grid before removing. If you gonna do consecutive calls to deletecolumn, start with the largest ColumnOrder.
>As a sample try this :
>-Put a grid on a form, a textbox with a numeric value say 2 and a commandbutton.
>-In commandbutton click write code (assuming they have grid1 and text1 names) :
>
thisform.Grid1.deletecolumn(thisform.text1.value)
>-Run the form. Change Text1.value to different values and click button to see result. If you don't change the value each time you click, column in 2nd position would be removed till there is 1 column left.
>Cetin

Sorry, they are other columns that do not need to be removed - those 10 are in the middle of the grid.
One can acquire everything in solitude but character.
Stendhal (1783-1842)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform