Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Bong Bungalan
  Where is Bong Bungalan?
 gensan
 Philippines
 Bong Bungalan
 Tags
Subject: RE: Adding Header.Click() event at runtime
Thread ID: 268547 Message ID: 268613 # Views: 25 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Tuesday, July 13, 2010 3:29:19 PM         
   


> Hi all,
>
> I have a followup question: I forgot to cite that the source of the grid i am working with is a created view
>
> then set
> Add Object grdTest As Grid With ;
> RecordSource = 'vSearch'
>
> with this, I got an error "Table has no Order set" when I set the "Set order to..." instruction at the custom procedure SOrtHeader(). My Question, In which part should I set the Indexing instruction?
>

Since Vfp Views cannot have persistent index tags, you'd need to Index On at run time.
Assumed you are opening your view in yourForm.Load(), you can for example index it right afterwards:

Local lnSelect
lnSelect = Select(0)
&& ....

Select 0
Use myView
Index On x Tag x Collate 'machine'
Index On y Tag y Collate 'machine'
&& ....

Select (m.lnSelect)



form.Load() is a very early event, and you can do the indexing later too (it just needs to happen before your code would try to use any of the index tags).
However, if you are doing it later, and if the current Buffer Mode of your View's alias is not default mode 3 anymore, you'd need to reset it temporarily for the Index On commands via CursorSetProp()



hth
-Stefan

ENTIRE THREAD

Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 8:15:49 AM
RE: Adding Header.Click() event at runtime Posted by Bhushan Sahni @ 7/13/2010 8:20:56 AM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 8:33:49 AM
RE: Adding Header.Click() event at runtime Posted by Bhushan Sahni @ 7/13/2010 8:35:09 AM
RE: Adding Header.Click() event at runtime Posted by Stefan Wuebbe @ 7/13/2010 8:37:29 AM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 9:12:34 AM
RE: Adding Header.Click() event at runtime Posted by Stefan Wuebbe @ 7/13/2010 10:00:19 AM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 2:18:31 PM
RE: Adding Header.Click() event at runtime Posted by Stefan Wuebbe @ 7/13/2010 3:29:19 PM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 3:52:15 PM
RE: Adding Header.Click() event at runtime Posted by Stefan Wuebbe @ 7/13/2010 4:17:35 PM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 4:31:10 PM
RE: Adding Header.Click() event at runtime Posted by tushar @ 7/13/2010 4:23:10 PM
RE: Adding Header.Click() event at runtime Posted by Bong Bungalan @ 7/13/2010 4:37:24 PM
RE: Adding Header.Click() event at runtime Posted by tushar @ 7/13/2010 4:43:17 PM
RE: Adding Header.Click() event at runtime Posted by tushar @ 7/13/2010 8:46:25 AM