Zaznaczenie określonej kolumny DBGrid

0

Jak zrobić aby np po kliknieciu na button w dbgrid została zaznaczona wybrana z góry kolumna?

0

tak ciężko nacisnąć kropkę i przeszukać listę właściwości???

Specifies the index of the currently selected column in the Columns array.

Delphi syntax:

property SelectedIndex: Integer;

C++ syntax:

__property int SelectedIndex = {read=GetSelectedIndex, write=SetSelectedIndex, nodefault};

Description

Set SelectedIndex to move focus to a column in the grid that is identified by position. Read SelectedIndex to determine which column in the grid has focus. A value of 0 indicates the first data column, 1 is the second data column, and so on. SelectedIndex is -1 if there is no currently selected column.

If the Options property includes dgIndicator, the index of the data column given by SelectedIndex will differ from the index of the physical column in the grid.

To access the field component for the selected column, use the SelectedField property.

0

Korzystałem z tego ale nie działało. Dopiero taki sposób wyjaśnił problem.

DBGrid1.SetFocus;
DBGrid1.SelectedIndex:=2;

Dziękuję za odpowiedź

0

działało tylko jak kontrolka nie miała focusa to go nie wyświetlała

1 użytkowników online, w tym zalogowanych: 0, gości: 1