Click on the field name in DBGRID to sort (reproduced) according to the fields of this column (reproduced)

xiaoxiao2021-03-06  25

Void __fastcall tfrace :: Gridtitleclick (TCOLUMN * Column) {tcustomadodataset * DS = DYNAMIC_CAST (Column-> grid-> datasource-> dataset); if (! ds) return;

STATIC ANSISTRING FSORTDIR; IF (fsortdir == "desc") fsortdir = "ASC"; else fsortdir = "dec"; ds-> sort = column-> fieldname fsortdir;}

FSortdir is a member variable (global variable) this method only suitable for ADO controls

转载请注明原文地址:https://www.9cbs.com/read-40065.html

New Post(0)