Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid refreshing
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00233538
Message ID:
00233807
Views:
32
>>I'm currently running VFP5.0 with a Windows 95 OS. Computer is a Dell PII 233 w/ 64Meg.
>>Here's the issue:
>>Within a "As Top Level" Form, I have a grid that is bound to an alias. Clicking on any of the command buttons will bring up another form with all the information on the selected employee. When closing that form and returning to the Top level form the 1st time all is well, but if I change the selection in the grid, go to one of the command button options and return, The Grid in the Top level form will not repaint itself.
>>Things I've tried:
>>Ensuring my current work area contains the alias the grid is bound to, it is. Ensuring the form is calling the grid refresh event, it does. Ensuring the record number is correct and not at BOF or EOF, it is.
>
>Not quite sure what's going on in your code (perhaps the alias is going out-of-scope, or some code in the TL Activate is running), but often re-setting the grid recordsource will solve it:
>
>In TL Activate, you can try
>
>gridname.recordsource = 'aliasname'
>
>then refresh it, see if that helps...




Moreover, I need to mention one thing, once you assign the new recordsource to a grid, all the grid object including columns, headers, text1 controls are reset...

That means if you have ANY coding on them will NOT work any more and you need to make a class and Replace all objects correspondingly!!

furthermore, if there are different aliasname you assign to grid...
the column Width will use the Min(previous ALIASNAME COLUMN, current COLUMN WIDTH..)

I donno why like this.. >-<'

To make it beauty... do following code:
* Grid.Init()
With This
   .RecordsourceType = 0
   .Recordsource = ""
   .ColumnCount = -1 && Remove All objects first!!
   .RecordsourceType = 1
   .Recordsource = "myalias"
   For ix = 1 to .ColumnCount
      .Columns[ix].RemoveObj("text1")
      .Columns[ix].AddObject("Text1", "myTxt")
      .Columns[ix].Text1.Visible = .T.
   EndFor
EndWith
Then, all objects will be at right width! ~_^
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform