Data Access Worldwide Knowledge Base
Article ID 2333 Article Title EXAMPLE: Add sort order indicators to grid headers Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2333 KBase Category VDF (GENERAL) Date Created 06/22/2007 Last Edit Date 07/12/2007
Article Text
QUESTION:
Windows grid controls support showing an arrow to indicate the sort direction. Is this possible in Visual DataFlex?
ANSWER:
The attached workspace is a VDF 11.1 workspace that shows you how to add this functionality to a grid.
The subclass cHeaderControlGrid handles the painting and remembers the sort order. All you have to do is to augment Header_Mouse_Click. The example view GridHeaderControl.vw also shows how to quickly sort a grid.
The same techniques also work in Visual DataFlex 12.0. It is even possible to use it unchanged with a DbGrid instead of Grid as parent class, although you do need to configure the Data Dictionaries correctly to avoid functional conflicts with selection lists etc.
Contributed By:
Igor van Houttum
Company: Data Access Europe
email: igor.van.houttum@dataaccess.eu
Web Site: http://www.dataaccess.eu
Web Links Related to this Article
File HeaderControlGrid.zip
URL=http://www.dataaccess.com/KBasePublic/Files/2333.HeaderControlGrid.zip
Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.
The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.