Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 To: Koen Piller
  Where is Koen Piller?
 Santpoort-Zuid
 Netherlands
 Koen Piller
 Tags
Subject: RE: "SetAll" for Click on a Grid's component
Thread ID: 365611 Message ID: 365622 # Views: 44 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Grids
Date: Friday, December 28, 2012 6:34:36 PM         
   


> > Colleagues,
> >
> > I need to have a Grid.Column(m.I).Header1.Click event programmed. Therefore, SetAll method won't do coz it sets property value, not event. That Header1.Click() event code shall set the order to the corresponding field's index tag.
> >
> > The problem is - I dunno how many columns this grid will have on run time, neither the Columns' fields' names: I set the Grid.RecordSource dynamically, after the User selects the table in the File/Open dialog.
> >
> > All I know is that the table will have an index tag named the same as the field's name.
> >
> > I could've solved this problem by creating this grid at design time with assuredly excessive number of columns with Column.Header1.Click() pre-programmed.
> >
> > Then, after the User have the table selected, bind the latter, field-by-field, to the columns sequentially, and delete the un-used columns.
> >
> > I did it in the past, but that was quite a tedious and (frankly!) messy job, let alone time-consuming. (Making a custom Column object by sub-classing the basic Column ain't appealing either: it still requires a lot of coding for the run-time dynamic table-to-grid column-by-column binding. :-( )
> >
> > Is there any other solution, more elegant and less time-consuming?
> >
> > TIA!
> >
> > Regards,
> >
> > Ilya
>
>
> Ilya,
> what do want to happen when user click's on the grid header?
> In case you would like to make a sorting order or something like that, you could do with either Marcia's Grid sorting class or Graig Boyd's even more elaborate grid class. In both cases I dont think there is much work / coding to be done to get them run.
> And surely you dont have to go the way you describe: with deleting un-used columns.
> Google for either class and you will find the answer, if not please dont hesitate to ask again.
>
> Regards,
>
> Koen
> Regards,
> Koen

Yes, Koen, subclassing the entire grid is one of the possible solutions, I agree.

However, I was hoping to find something 100% pure basic/generic one. There's BINEVENT()function in FP, but, with what I have, I'm not sure what I am to put in as the 1st parameter...

Regards,

Ilya

ENTIRE THREAD

"SetAll" for Click on a Grid's component Posted by Ilya Rabyy @ 12/28/2012 4:52:02 PM
RE: "SetAll" for Click on a Grid's component Posted by Koen Piller @ 12/28/2012 6:24:59 PM
RE: "SetAll" for Click on a Grid's component Posted by Ilya Rabyy @ 12/28/2012 6:34:36 PM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/28/2012 7:29:23 PM
RE: "SetAll" for Click on a Grid's component Posted by Ilya Rabyy @ 12/28/2012 7:37:06 PM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/28/2012 7:51:06 PM
RE: "SetAll" for Click on a Grid's component Posted by Ilya Rabyy @ 12/28/2012 8:18:54 PM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/28/2012 8:27:51 PM
RE: "SetAll" for Click on a Grid's component Posted by Ilya Rabyy @ 12/28/2012 8:46:01 PM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/30/2012 2:15:11 AM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/28/2012 8:00:31 PM
RE: "SetAll" for Click on a Grid's component Posted by Rick Hodgin @ 12/28/2012 10:08:56 PM
RE: "SetAll" for Click on a Grid's component Posted by Ilya Rabyy @ 12/28/2012 10:39:58 PM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/28/2012 11:21:00 PM
RE: "SetAll" for Click on a Grid's component Posted by Rick Hodgin @ 12/29/2012 12:15:55 AM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/29/2012 4:30:20 AM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/29/2012 4:41:23 AM
RE: "SetAll" for Click on a Grid's component Posted by Rick Hodgin @ 12/29/2012 5:18:36 AM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/30/2012 2:21:33 AM
RE: "SetAll" for Click on a Grid's component Posted by Rick Hodgin @ 12/30/2012 2:40:52 AM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/30/2012 3:00:46 AM
RE: "SetAll" for Click on a Grid's component Posted by Rick Hodgin @ 12/30/2012 3:09:49 AM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/30/2012 3:19:19 AM
RE: "SetAll" for Click on a Grid's component Posted by Rick Hodgin @ 12/30/2012 4:52:53 AM
RE: "SetAll" for Click on a Grid's component Posted by Samir H. @ 12/30/2012 7:09:16 AM
RE: "SetAll" for Click on a Grid's component Posted by Rick Hodgin @ 12/30/2012 2:33:42 PM
RE: "SetAll" for Click on a Grid's component Posted by Rick Hodgin @ 12/28/2012 6:53:02 PM
RE: "SetAll" for Click on a Grid's component Posted by Samir H. @ 12/29/2012 7:51:58 AM
RE: "SetAll" for Click on a Grid's component Posted by David Mustakim @ 12/29/2012 11:27:36 AM
RE: "SetAll" for Click on a Grid's component Posted by Anders Altberg @ 12/30/2012 3:08:19 PM