How do I write 20 if I want to sort IDs from largest to smallest in dbgrid?

Updated on culture 2024-04-14
11 answers
  1. Anonymous users2024-02-07

    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)"

  2. Anonymous users2024-02-06

    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.

  3. Anonymous users2024-02-05

    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';

  4. Anonymous users2024-02-04

    It is recommended to use adoconnection, adoquery, dbgrid, you said this way has not been used.

  5. Anonymous users2024-02-03

    Why write it yourself, you can use ehlib, dbgrideh in it has a lot of good features.

  6. Anonymous users2024-02-02

    The connection to the database then shows up?

  7. Anonymous users2024-02-01

    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;

  8. Anonymous users2024-01-31

    Sort these things up to the controls.

    Such as dbgrideh

  9. Anonymous users2024-01-30

    1. Establish an external index table for the moment;

    2. Use the month in the intercepted date as the filter condition;

  10. Anonymous users2024-01-29

    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

  11. Anonymous users2024-01-28

    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.

Related questions
3 answers2024-04-14

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

13 answers2024-04-14

The size of your community, the grade of the permanent residents, and the existing stores, you can do whatever you lack. >>>More

8 answers2024-04-14

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

8 answers2024-04-14

The answer is to choose b to fill the handle, and the verification method is as follows: >>>More

26 answers2024-04-14

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