| |

VerySource

 Forgot password?
 Register
Search
View: 812|Reply: 5

How to get multiple selected records of TcxGridDBTableView and delete all of them? (MultiSelect = True)

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-8 18:00:01
| Show all posts |Read mode
I have set TcxGridDBTableView.OptionSelection.MultiSelect = True,
How do I know which records have been selected?
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-4-2 20:00:01
| Show all posts
// Show the value of the 3rd field of all selected records
  for i: = 0 to cxGrid1DBTableView1.Controller.SelectedRecordCount-1 do
    ShowMessage (cxGrid1DBTableView1.Controller.SelectedRecords [i] .Values ​​[2]);
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-4-4 11:00:01
| Show all posts
To add, it ’s better to delete backwards when deleting
for i: = cxGrid1DBTableView1.Controller.SelectedRecordCount-1 downto 0 do
  //delete
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-4-5 02:15:01
| Show all posts
for i: = cxGrid1DBTableView1.Controller.SelectedRecordCount-1 downto 0 do
  //cxGrid1DBTableView1.Controller.SelectedRecords[i] ......
Reply

Use magic Report

0

Threads

9

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-4-5 12:15:01
| Show all posts
var
  i, n: Integer;
begin
  n: = cxGrid1DBTableView1.IndexOfItem (cxGrid1DBTableView1.FindItemByName ('Id'));
  for i: = cxGrid1DBTableView1.Controller.SelectedRecordCount-1 downto 0 do
    ShowMessage (cxGrid1DBTableView1.Controller.SelectedRecords [i] .Values ​​[n]);
end;
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-5 23:30:01
| Show all posts
Not bad. Very good post
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list