Topic: Выпадающий список и Таблица
Нужно сделать, что бы при выборе пользователем из списка ComboBox
ComboBox := AddCat.ComboBox1.ItemIndex;
Обновлялись данные в таблице TableGrid с помощью SQL запроса
SELECT
catalog.name,
catalog.sort_order
FROM catalog
WHERE catalog.id_keycat LIKE {ComboBox1} AND catalog.status LIKE "ДА"
ORDER BY catalog.sort_order ASC
procedure SelectCat_ComboBox1_OnChange (Sender: string);
var
ComboBox: Integer;
Value: string;
begin
ComboBox := SelectCat.ComboBox1.ItemIndex;
// Далее как заполнить таблицу SelectCat.TableGrid1 SQL запросом + первая строка (Наименование, Сортировка) ?
Value := SQLExecute ('SELECT name, sort_order FROM catalog WHERE id_keycat LIKE '+ComboBox+' ORDER BY catalog.sort_order ASC');
end;
Как заполнить таблицу SelectCat.TableGrid1 SQL запросом + первая строка (Наименование, Сортировка) ?