请问按了DBGrid的column可以排序吗? 不用order by

tiger 2000-06-08 03:25:00
8日5点前回答我可以排序并告知步骤的可以再给300分!!!
...全文
212 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zxh1972 2000-06-09
  • 打赏
  • 举报
回复
先要给表中要排序的每个字段建立一个索引,

procedure TForm1.DBGrid1TitleClick(Column: TColumn);
begin
Table1.IndexFieldNames:=Column.FieldName;//单个索引的情况
end;
saipm 2000-06-08
  • 打赏
  • 举报
回复
最直接的方法就改用TDBGridEH, 这个构件有属性可以直接设置, TDBGridEH可以从网上下载.
lance 2000-06-08
  • 打赏
  • 举报
回复
1. SQl
2.深度历险上有专门控件。
shylsz 2000-06-08
  • 打赏
  • 举报
回复
先要给表中要排序的每个字段建立一个索引,然后再根据所选的列来判断使用哪个索引
Un1 2000-06-08
  • 打赏
  • 举报
回复
在HeadClick中设置recordset.sort="xxxx",别忘了refresh
Ehlib 是著名的数据库连接控制,版本为5.2.84,DBgrid增强VCL控件;支持多表头,多固定列,按表头排序,支持合计列,并支持直接打印。可以和PB的ataWindow媲美。 本版本含完整源代码,支持以下 IDE: Delphi 5,6,7,2005 C++Builder 5,6 BDS 2006 (Delphi 2006, C++Builder 2006) Delphi 2007 RAD Studio 2009 (Delphi 2009, C++Builder 2009) Embarcadero RAD Studio 2010 (Delphi 2010, C++Builder 2010) 本人已在Delphi XE中运行通过,在本人编制的进销存软件中应用完全正常。 注:Delphi 2010、XE里面安装不要修改bpl文件的输出路径,采用默认值,否则安装难以成功。 Version 5.2 + Added feature to group data in the DBGridEh. It is allowed to make grouping at run-time and design-time. Grouping works only when the grid is connected to TMemTableEh dataset. Use next subproperties of Grid.DataGrouping property to adjust grouping Active: Boolean - Set this propery true to active grouping. DefaultStateExpanded: Boolean - defines initial expapnding/collapsing state of new created elements of the grouping tree. GroupLevels: TGridDataGroupLevelsEh - Collection of group levels. Use this property to create template of the grouping. GroupPanelVisible: Boolean - Set this property to True to show special panel at the top part of the grid. Then the panel is thisible it is allowed to form group levels by mouse. Drag title of the requaried column to the group panel and drop it onto panel. Font: TFont - Controls the attributes of the default font of group records in the grid. Color: Tcolor - Default background color of the group records. See demonstration project of grouping in Demos\DataGrouping directory. Version 5.1 * The type of RowPanel property was changed. Instead of Boolean type, now it is an object property with subproperies: Active: Boolean - Defines if it is possible to place cells under each over and if every propetry can have personal hight. + NavKeysNavigationType: TGridRowPanelNavKeysNavigationTypeEh - defines the order of navigation over cells in the grid when keys Up, Down, Left, Right are pressed. rpntRowT

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧