Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Albert itkin
  Where is Albert itkin?
 brooklyn
 New York - United States
 Albert itkin
 To: Barbara Peisch
  Where is Barbara Peisch?
 Oceanside
 California - United States
 Barbara Peisch
 Tags
Subject: RE: Dynamic GRID Problem
Thread ID: 78320 Message ID: 78513 # Views: 2 # Ratings: 0
Version: Visual FoxPro 8 Category: Grids
Date: Tuesday, October 4, 2005 6:19:40 PM         
   


> > I'm Setting UP Dynamic grid at run time, based on selected table.
> > How can I assign method to every column's header Click Event?
> > When I write:
> > Thisform.TableGrid.Columns[i].Click="HeaderClick(this.Parent.ControlSource)"
> >
> > I got error Message 'Property Click Read only'

>
> You cannot add code to a method at runtime, but you can use BINDEVENT() to run the code of your choice.
>
> First decide where you want to put the code that's to be run. If you are using a custom grid class, you can create a new method in the grid with your code.
>
> Next you need to bind all the header click methods to this code. You would do this after you've defined the number of columns for the grid. Here's something like what you need:
>
> for each oColumn in This.Columns   && assuming you're in a grid method
>    BINDEVENT(oColumn.Header1,'Click',This,'HeaderClick')  && assuming you're using a HeaderClick method is in the grid
> endfor
> 

>
> -BP
> www.peisch.com



Thank you. It's working

ENTIRE THREAD

Dynamic GRID Problem Posted by Albert itkin @ 9/30/2005 6:48:46 PM
RE: Dynamic GRID Problem Posted by Barbara Peisch @ 9/30/2005 10:26:57 PM
RE: Dynamic GRID Problem Posted by Albert itkin @ 10/4/2005 6:19:40 PM