Cxgrid Selection of filtered data (inverse selection)

Source: Internet
Author: User

//The following is mainly for the query out of the data, filtered to get the data to be reversed, and then modify the selected data (select All or part of the selection can also be modified according to some code)Screen.cursor: =crhourglass; cxGrid2DBTableView1.DataController.GotoFirst; forI: =0  toCxgrid2DBTableView1.DataController.FilteredRecordCount-1  Do begin   ifCxGrid2DBTableView1.DataController.GetItemByFieldName ('IsChecked'). EditValue = True Then   beginCxGrid2DBTableView1.DataController.GetItemByFieldName ('IsChecked'). EditValue: =False; End   Else ifCxGrid2DBTableView1.DataController.GetItemByFieldName ('IsChecked'). EditValue = False Then   beginCxGrid2DBTableView1.DataController.GetItemByFieldName ('IsChecked'). EditValue: =True; End; CxGrid2DBTableView1.DataController.GotoNext; End; Screen.cursor:=Crdefault;//Cxgrid2DBTableView1.DataController.FilteredRecordCount This is the number of data rows to be filtered//cxGrid2DBTableView1.DataController.GetItemByFieldName (' IsChecked '). EditValue This is the value of the field to be modifiedThe selection button has three options: Select All, reverse Select, Cancel all the general is this: first query, then filter (the query out of the data some inappropriate to filter), and then select the column tick (if the data more than one tick is too troublesome), you can modify the state of the data, the above code can be filtered out of the Data for the inverse selection operation. (Full or full cancellation is also very simple, referring to the code above), previously written code to filter out the useless data is also in the anti-select or select all operations, this is no problem



Using Filter:

 procedure   Tform2.button3click (Sender: TObject);  var   I:integer;   begin  for  I: = 0  to  CxGrid1DBTableView1.DataController.FilteredRecordCount-1  do  begin   CxGrid1DBTableView1.DataController.FocusedRecordIndex:  =    Cxgrid1dbtableview1.datacontroller.filteredrecordindex[i]; CxGrid1DBTableView1.DataController.SetEditValue (Cxgrid1dbtableview1reviewed.index, True, evsvalue)  end  ;  end ; 

 

Cxgrid Selection of filtered data (inverse selection)

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.