LnValLen = MIN(FSIZE(m.lcField),m.lnLimitation) LcTag = THIS.GetTagName (m.lcCursor, m.lcField) LOCAL lcType, lnValLen, llIsField, lcTag, lcField, lcCursor * make basic checking for control source type * but it generates "Invalid Key Length" error, so we decrease it to 200 *- CHANGE - WGB - Novem10:13:17 - the original length was 240, LOCAL lc_SortExpr, lnLimitation, llError, llNonStructural, lnSelect, lcOrder, loException AS EXCEPTION * assuming alias for sorting is in the current workarea *) The code is taken from Vlad Grynchyshyn (with NN's minor modifications) *) Description: Creates index for the passed header's column's controlsource on the fly Iif(this.lAscending, "UpArrow.bmp","DownArrow.bmp")) ToHeader.picture = iif(not empty(m.tcPicture), m.tcPicture, ToHeader.caption = padr(alltrim(m.toHeader.caption),200) & we want to show picture at the right *- This method sets picture for the Header object which is passed by reference *- This method removes pictures from all the headers *his.mousepointer = 0 & Attempt to restore Mouse Pointer ** Clear the picture of the previously sorted column If not order(m.lcRecSource)= m.lcOrder or m.llDirection this.lAscending This.SetOrder(m., m.loCalledBy.CurrentTag, m.loCalledBy) LcOrder = order(m.lcRecSource) & Saves current tag If vartype(m.loCalledBy)= "O" and not empty(m.) LoCalledBy = aCurEvent & should be a Header object *- This method is invoked when any grid's column header is clicked *- If this property is set to true, then grid's properties are saved *- If this property is set, use DynamicBackColor to set highlight *- XML Metadata for customizable properties *- If this property is set to false, then the Initialize code is not called *- Holds grid's column controlsources and sizes *- If this property is set to true (default), then the indexes are created for every column in the grid *- This property saves the header of the last sorted column *- This property tells wheither we need to update toolbar buttons or not *- This property tells, if the grid's recordsource should be at the top after sorting *- This property tells, if we want to add visual representation of the sorting Attached also is the library containing this class and two bmp files for displaying Up and Down arrows. Although there are several workarounds for this deficiency available (such as ), here is my solution using my grdSorting class which allows automatic sorting by clicking on the column headers. Unlike the ASP.NET GridView Class, the Visual Foxpro native grid class does not provide a means for automatic sorting by clicking on the column header.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |