Home > Back-end >  How to delete the DBGrid column through the code
How to delete the DBGrid column through the code

Time:09-28

Form 0 to 10, I want to delete the back of the 10 columns, keep only 0,

CodePudding user response:

Many methods,
 
With DBGrid1. Columns do
While the Count & gt; 1 do
Delete (Count - 1);

When multiple available BeginUpdate + EndUpdate
 
With DBGrid1. Columns do
The begin
BeginUpdate;
Try
While the Count & gt; 1 do
Delete (Count - 1);
The finally
EndUpdate;
end;
end;

CodePudding user response:

Before directly to set up a number of columns, there are 10 columns, in situ set to 9 columns, the last column is deleted,
  • Related