-
The auto-generated IDs in dbgrid are sorted from largest to smallest
1. Add a blank column with ID in dbgrid and set it as the first column.
2. In the ondrawcolumncell event of dbgrid, write the following **:
with do
beginif datacol=0 then,,,inttostr(recordcount-recno+1));
end;Note: If the IDs in dbgrid are sorted from smallest to largest, you have to put them"inttostr(recordcount-recno+1)"Instead"inttostr(recno)"
-
DataGrid has its own sorting, and this one is pretty straightforward.
You can also write your own ** implementation, t-sql statements to sort, bind data.
-
In the dbgrid event titleclick write the following **, use memtableeh, according to your own habits, see which return value is the dataset control, no matter which should have its desired sorting method;
else= + ' asc';
-
It is recommended to use adoconnection, adoquery, dbgrid, you said this way has not been used.
-
Why write it yourself, you can use ehlib, dbgrideh in it has a lot of good features.
-
The connection to the database then shows up?
-
Date Moment Course Teacher.
February 1 Morning University Chinese Zhang Wuji.
April 3rd Afternoon Advanced Mathematics Sanfeng Zhang.
May 7th evening University Biology Andy Lau.
March 2nd Morning College Physics Aaron Kwok.
March 6 Morning University Chinese Zhang Wuji.
I'm an oracle student, and I don't know if the following statement is correct.
select b1.*,decode(b1.moment,'Morning',0,'Afternoon',1,'Evening',2,3) s from b1 order by s asc;
Only the data for March can be shown to do so:
Date: =3%'
true ;
In this way, adotable1 will have the data for March, and if you want to use all the data in adotable1 next time, you can do so:
=Date :=
=true;
end;
-
Sort these things up to the controls.
Such as dbgrideh
-
1. Establish an external index table for the moment;
2. Use the month in the intercepted date as the filter condition;
-
Write a loop, get the control of the page, determine the control type in the loop, and set the sort property to true if it is dbgrid
-
dbgrid itself can only support clicking on the title bar to respond to events, and the specific sorting algorithm has to be written by yourself**!
You can use ehlib's dbgrideh, which supports title sorting!
Alternatively, you can use DevExpress VCL which automatically supports sorting.
Summary. Hello dear, in first-tier cities, the total cost of opening a bar is about 10,000 yuan. In second-tier cities, the total cost of opening a bar is about 10,000 yuan. >>>More
The size of your community, the grade of the permanent residents, and the existing stores, you can do whatever you lack. >>>More
It depends on your value orientation. Do you belong to the more ambitious person, or the more emotional, or both? Personally, I think we should try to achieve both love and career. >>>More
The answer is to choose b to fill the handle, and the verification method is as follows: >>>More
You can create a new one directly, and you can log in directly with the previous one after the new creation is completed. This way, he will default to that login every time in the future. >>>More