Subject Re: grid column index
From Charlie <tm@tc.com>
Date Sat, 15 May 2021 15:47:04 -0400
Newsgroups dbase.getting-started

This is great works well and easy to change the color to blue!

Ken Mayer Wrote:

> On 5/14/2021 3:08 PM, Charlie wrote:
> > Curious to know what others do in regard to a column index in a grid.  Is there a way of making each header active so if you click on it, the grid indexes on that column/field?
> >
> > I have a form set up with an 'index' button above each header that you push in order to index on that column/field.
> >
> > I've coded in php where you can have the column header itself be the index button.  Just curious if this is possible in dbase grids or if there is a better way to do it.
> >
> > Thanks for any comments.
>
> The dBASE grid allows this, but it takes a bit of work ... first, does
> the column have an index? If not, are you using an "order by" clause for
> the sql select?
>
> Unfortunately, help isn't all that helpful on this.
>
> The headingControl doesn't have an onClick event handler, but you can
> assign code to the headingControl's onLeftMouseUp event. From there you
> can, if you have an index tag for the field displayed, change the
> rowset's index:
>
>     // reference to form.rowset:
>     oRowSet = form.Grid1.dataLink
>
>     oRowset.indexName := "Title"
>
> But you have to have an index named "Title" and all that.
>
> Hope this gets you started. There's code in a the dUFLP in the file
> GridColumnIndexChange.cc that you may want to look at.
>
>
> Ken
>
> --
> *Ken Mayer*
> Ken's dBASE Page: http://www.goldenstag.net/dbase
> The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
> dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
> dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
> dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm