Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A generic grid
Message
 
To
31/05/1997 18:40:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00034323
Message ID:
00034390
Views:
39
> > >> > >> In my application I need a generic grid class with recordsourcetype = > >> SQLstatement. There are a lot of tables and a series of results need to > be > >> retrieved and displayed in grid (nomodify). All SQL statements are based > on > >> a date value. SQL series are complex to accomplish in view designer, > most > >> of them need a series of SQL. Setting recordsource to last SQLstatement > >> does populate the grid. At this point how could I set the column widths > and > >> inputmasks, formats based on original table properties. I have code to > do > >> this for a table (dbgetprop(), cursorgetprop() are used) but after a > series > >> of concurrent SQL select how could I reach the original tables' > properties > >> on the fly ? > >> For example if "select ... from anothercursor into cursor Gridcursor" > is > >> passed as a parameter and 'anothercursor' is a cursor, how could I know > the > >> original table(s) used in this query. > > > >Have you thought of 'AField'ing the last cursor and based on this > >information, set the width and formats of the grid, to which you would > >submit the last cursor? > > > >HTH, > > > >Marc > Thanks for your help Marc, > But it doesn't help me. For example I have lot of integer type fileds, and > they are limited to different sizes in input screens through DBC properties > of inputmask. I need to reach these original properties. That is a table > has a backlink to DBC but cursors don't. If I could use views as freely as > a series of SQL, that wouldsolve the problem. Now I have my own solution in > another way. I have built a dummy form with one grid and a command button. > I setup my cursor, set grid object recsourcetype to SQl, and recsource to > last SQL and when grid shows up I align the widths with mouse then I click > the "build" button. It prompts me for tablenames and then fieldnames of > each column and writes the code something like : > .controlsource = cursorfname > .width = currentwidth > .header = table.fname.caption (dbgetprop()) If it's not an exp, otherwise > new caption. > .format = table.fname.format > .inputmask = table.fname.inputmask and so on. This is not harder than > using form designer. > All that is left to me is cut&paste for the moment . In advance I'm > planning to eliminate this cut&paste, and collect all the code in one prg. > Cetin ... this is known as a builder I think ... Anyway, glad you found your solution. Marc

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Previous
Reply
Map
View

Click here to load this message in the networking platform