Page 1 of 1

crdbgrid1.columns.delete(i) doesn't working

Posted: Fri 25 Jul 2008 09:03
by mariusz
I’ve code (like below). On standard dbgrid this procedure working, but here not. Procedure finding expedient column, but doesn’t delete this.

for i := 0 to crdbgrid1.Columns.Count -1 do
if lowercase(crdbgrid1.Columns.Items.Field.FullName) = 'highlight' then begin
showmessage('jest');
crdbgrid1.Columns.Delete(i);
end;

have anyone any idea what to do?

Posted: Fri 25 Jul 2008 12:42
by Plash
Deleting a column has an effect only if columns were created in the Columns Editor. Open the Columns Editor and press the Add All Fields button.

Posted: Fri 25 Jul 2008 14:04
by mariusz
Plash wrote:Deleting a column has an effect only if columns were created in the Columns Editor.
Ok. Thx.
I'll solve my problem by Unpluging crdbgrid, then add required columns to grid and then connect grid to query!