如题
解决方案 »
- 跳槽问题
- 关于TListview的线程传递安全问题,急啊
- 关于数据集过滤后的locate疑问!!!!
- 如何做activex控件?
- 请问超市里的收款机打印单子是机子自带的功能吗?
- 网友,你们知道文件扩展名为fpg(*.fpg)的文件,是用哪种工具编写,我怎样找到它或怎样打开此种文件
- 为何我们学delphi不能用QQ聊天?
- 新手请教 下列语句运行时为何不报错(intraweb)
- 在网络断开再恢复连接后,怎样能保持继续对数据库的正常操作?
- 怎样在ToolBar上动态添加按钮?并且添加的按钮要在已经存在的按钮的右边?(内空)急!!!!!
- delphi如何将邮件信息发送到手机上?
- 简单的链表初始化未果问题?运行后没有结果
字段的Title中的TitleButton设置为True
记得好像要引用相应的单元 根据ADO、BDE不同吧
上面的方法我都试了,点完Title之后,Title上会出现一个正三角或倒三角符号,但是实际上没有排序
{ Private declarations }
sort: string;
procedure TForm1.DBGridEh2TitleClick(Column: TColumnEh);
begin
if SORT = 'DESC' then
begin
Sort := 'ASC';
Column.Title.SortMarker := smUpEh;
end
else
begin
sort := 'DESC';
Column.Title.SortMarker := smDownEh;
end;
ADOTable1.Sort := Column.FieldName + ' ' + sort;
end;
if DataModule1.ds_sql.Active then
begin
if column.Title.SortMarker=smdowneh then
DataModule1.ds_sql.Sort :=column.FieldName
else
DataModule1.ds_sql.Sort :=column.FieldName +' DESC';
end;
if DataModule1.ds_sql.Active then
begin
if column.Title.SortMarker=smdowneh then
DataModule1.ds_sql.Sort :=column.FieldName
else
DataModule1.ds_sql.Sort :=column.FieldName +' DESC';
end;
{ Add this unit to 'uses' clause of any unit of your }
{ project to allow TDBGridEh to sort data in }
{ TADOQuery automatically after sorting ers }
{ will be changed. }
{ TSQLDatasetFeaturesEh will try to find line in }
{ TADOQuery.SQL string that begin from 'ORDER BY' phrase}
{ and replace line by 'ORDER BY FieldNo1 [DESC],....' }
{ using SortMarkedColumns. }
{*******************************************************}