On the sorting problem of Cxgrid

Source: Internet
Author: User

1, first need to open views of the optionscustomize.columnsorting

2, and then set the sorting of each column

3, if you need to sort the design period, it is necessary to set this

SortOrder Properties, note that if you set soring to Sonone properties with your code, you need to refer to the Dxcore unit

Of course if you need to enable multi-column sequencing during the design, you need to set the order of SortIndex

OK, so your program, during the run can support click Cxgrid Table Header Sort, press the Ctrl click will cancel the sorting status of the sequence, press the shift will support multi-column sorting, is not very useful, exclamation dev too powerful.

Of course, add a perfect plan, sometimes the customer will be disorderly, disorderly, but we will give the customer a default sorting scheme, so I was to get the data before the current sorting state:

 //  remove all sort    tvdetail.datacontroller.getitembyfieldname (' ItemID '). SortOrder: = Sonone;  for  iI: = 0   To  gridtableview.columncount-1  do  begin  // sonone defines Uses dxcore  gridtableview.columns[ii] in Dxcore. SortOrder: =sonone;  end ; 
//Then the code that you re-acquired the data

If Readdataset (strSQL, Cds) Then
Begin
Gridtableview.columns[0]. Applybestfit ();
Edtxh.onchange (EDTXH);
End Else
Begin
Dm_PowerWy.UDBA.GetLastError (Errid, errmsg);
Showmsg_west (' Error ', ' unable to read data! ', ' ERROR hint: ' +LBR + errmsg+lbr+ ' related SQL statement: ' +strsql ';

End

All right, that's it!

On the sorting problem of Cxgrid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.