Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid behaviors change after RowSource changes
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00719978
Message ID:
00720021
Views:
16
Faq #8019 Grid reconstruction and how to avoid it explains this grid behavior. The simplest fix is to set Recordsource of the grid to the empty string before retrieving a new data and restore it back to the table/cursor name after that.
Thisform.grid1.Recordsource = SPACE(0)
* recreate table/cursor here
...
* Restore recordsource
Thisform.grid1.Recordsource = "mytable"
>I will attempt to explain what is happening as best as I can.
>
>I am using a Combo Box to allow the user to select a table by the same name from either of two paths. I am using a Grid as a partial aid to search for a contact's name. I have a textbox the user can search on and a combo box that allows the user to change the index order for the search.
>
>As you may already know, a Grid goes blank when you close a table. The effect is that you have removed its RowSource property. So, I add the RowSource property back in within the ComboBox's LostFocus Event. And further, as you can also imagine, the ColumnCount property is lost also when the table is closed, so you have to restore that and all other properties as they once were. So, I do all of that as shown in the below code.
>
>Now, the problem I have is that the grid's behavior, which is coded into the Grid, is that the user can see a highlight of light blue (Aqua?) on the current row. Unfortunately, none of this behavior seems to work after the table is closed (PATH CHANGES by user selection from combobox) and then a table of the same name but different path is opened. As I previously wrote above, all of the Grid's properties are restored, but its methods do not seem to catch on and this is where the power is for the highlighting behavior.
>
>How do I get the behavior to remain the same after closing a table and opening another in a different path, once the user has selected a different path from the ComboBox?
>
>I hope that this isn't a really easy fix or too obvious. I would just like to make it work properly anyway. Cecil Champenois.
>
< snip >
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform