Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHAT IS GridBase ? in Ramani's incremental search in Grid

Status
Not open for further replies.

FoxEgg

Programmer
Mar 24, 2002
749
AU
I gave up after a day of toiling on incremental search using SELECT and VIEWS and went to Ramani's FAQ on GRID Incremental Search
... and Ramani's stuff is usually fabulous...

How to make an incremental search in Grid
faq184-1214
Posted: 27 Oct 01 (Edited 16 Dec 02)

**********************************************************
** How to make an incremental search in Grid.
**********************************************************
** by Subramanian.G (ramani)
** FoxAcc Software
** ramani_g@yahoo.com

BUT It has a section of code...

Code:
ThisForm.Refresh()
ThisForm.GridBase1.SetFocus
This.SetFocus
**********************************************************
4. Add in the AfterRowColChange event of the Grid (ThisForm.GridBase1)

DODEFAULT()
ThisForm.txtSearch.SetFocus()

The above code will help in setting the focus back, in case, the user clicks the mouse in any cell of the grid.
**********************************************************

What is GRIDBASE ??

But try as I will I CANNOT find what is this GRIDBASE or GRIDBASE1 ..... no where on the net !!!

What is it ? Needless to say it causes an error when run it

J

Sydney, Australia
 
It's simply the name of the object. You can give it any name you like. Name it FoxEgg.

Bye, Olaf.
 
Thanks AGAIN Olaf

OK so are you saying that it is simply the name of the GRID ? ie grid1 in my case

Sorry... It is a bit like me and my flawed ways at work... I sometimes forget and I explain something to a patient in medical jargon, forgetting that it took 20 years to acquire the jargon... Most times patients are too polite to say anything...

I will try Grid1.focus and see how it goes...

JF

PS I do not like to be in any way critical because I benefit greatly from the wisdom of all of you guys.. solving my problems... but this is a gentle suggestion: ...make explanations EXPLICIT ... it is too easy to be technically correct ... yet lose the reader.... who often may be too embarrassed to say I don't understand.

Expand the lines and make it state 'Add a Grid Control and name it Grid1 then add the lines ...

Code:
Add in ThisForm.Refresh()
ThisForm.[B]Grid1[/b].SetFocus
This.SetFocus
**********************************************************
4. Add in the AfterRowColChange event of the 
Grid (ThisForm.Grid1) ((not Gridbase1))
DODEFAULT()
ThisForm.txtSearch.SetFocus()

Again... sorry to be critical... ask me about how to do a hip replacement sometime


Sydney, Australia
 
The usual convention would be to name the grid something like MyGrid (or, perhaps per logically, YourGrid) to sort of indicate that this is the grid in question - the one that we are talking about. The idea is that the programmer should change this to whatever name he has actually chosen for the grid.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike and acknowledged ...

Mine is a plea for being EXPLICIT... particularly for those of us who are not as experienced.


EXAMPLE

HAVE a quick review of the Ramani FAQ Line 2 which states EXPLICITLY

2. Create a text box in the search form and deploy it alongside the navigation bar or at a suitable place. Let us call this text box 'txtSearch'.

IT is EXPLICIT and an instruction, quite clear.

If we were to do the same and were explaining this to VFP pedestrians (as I am) ..Then lets make the definition of the Grid EQUALLY EXPLICIT

I would have no problem if the FAQ had said

4. Create a grid in the form and deploy it alongside the navigation bar or at a suitable place. Let us call this Grid 'Grid1'.

But the FAQ somewhere refers to it as GRIDBASE1 (or does it ?) ... So I assumed that that there must be a property, or something that is Gridbase1 ... and so I go looking for whatever is meant by what is written in the FAQ as ThisForm.GridBase1.

You, of course, would not because you are very experienced and you would of course know that know that the short external rotators about the hip are the Gemelli... and when I say to you to 'release the Gemelli'.. that instruction is totally transparent to me... and to other Total Hip surgeons...but is totally meaningless to you

and yet THAT IS MY TOTAL HIP REPLACEMENT EQUIVALENT ANSWER to this FAQ to this mention of Gridbase1 in VFP....

((By the way, the Gemelli are small and relatively insignificant muscles about the hip joint.. if you have done a couple of hundred of hip replacements the meaning would be totally clear... and would not need clarification ))

Most VFP folk are not at your and other level .

Simply stated... this is a request to pitch at a slightly lower and completely EXPLICIT level ...especially for a FAQ... if the writer has any suspicion that the knowledge base isn't in the same league.

You and Ramani and Olaf and Mike Gagnon and Tamar and and many many others are genii and in the stratosphere with VFP and other programmatic knowledge compared to us tropospherites



Sincerest best regards


JF

PS : An example: I copied and pasted the beautiful Romanian Auld Lang Syne, straight into a .prg and it worked a charm.. first time...
By comparison... 20 web searches later , I still cannot get the Ramani code to work.. and besides medicine and surgery degrees, I also have an electrical engineering degree. I would not be considered a computing illiterate ...

BUT the Romanian prg works win no grief...... the other is simply difficult.

Cheers




Sydney, Australia
 
Your criticism is right, especially as Ramani also gave the name of the search textbox. He forgot to mention about the grid, but it's essential as the whole FAQ is about adding search functionality to a grid.
Maybe this wasn't much of a thing as Ramani was active here, and used GridBase1 as name of his grids.

At least it should have occurred to you this has to mean a grid, maybe a grid class with additional base behaviour you don't have and would find in other Ramani FAQs or posts, but you can try with a base class grid and then see if it works or not.

And by the way: Of course you should never feel ashamed to ask, if an answer goes over your head. You aren't ashamed to ask in the first place. The same thing you observe on yourself about medicincal terms of course applies to us, too.

The line you also quoted should give you the hint:
Ramani said:
4. Add in the AfterRowColChange event of the Grid (ThisForm.GridBase1)
Especially the grid should mean the grid you want to search enable. And Ramani here specified his code is made for Thisform.GridBase1.

Also note, that often FAQs are genrated out of the context of a thread or two, and sometimes code including naming of objects, comes into the FAQ and should be "normalized". But a FAQ is not an article, even less a book, lectured. Only Ramani could change that FAQ now, I fear he left us, not only this forum.

Bye, Olaf.
 
Our loss if Ramani has left...

At least it should have occurred to you this has to mean a grid, maybe a grid class with additional base behaviour you don't have and would find in other Ramani FAQs or posts, but you can try with a base class grid and then see if it works or not.

It did occur to me ... so I searched the forum at the time.. Only one other reference... Only ONE.

VFP6 Browse Window compared to VFP7 Browse Window
thread184-163679

from that thread:
"Hope you set this. If you want to set this property for all of your grids.. you can do a subclassing of the Grid from the GridBase, set this property with a setall command in its init event, and use this subclass in all your applications... etc etc."

I still wouldn't call this an explicit explanation...

Ironically, or fortuitously... I stayed up all might and created my incremental search in a grid... with different colours on selection of a row (Using Ramani's excellent FAQ) ... works fine... (probably has many bad programming techniques)

I am off to now integrate this 'creation' into the grand scale of my medical practice... God I hope it works next Monday.. or it will be chaos here.

Thanks again for all the assistance.

JF



Sydney, Australia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top