x11 Posted May 9, 2020 Share Posted May 9, 2020 Не могу понять, что я делаю не так. Сделал привязку. А в столбце отображается Id района вместо его названия. Как сделать, чтобы отображалось название района? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 9, 2020 Share Posted May 9, 2020 1 hour ago, x11 said: Не могу понять, что я делаю не так. Сделал привязку. А в столбце отображается Id района вместо его названия. Как сделать, чтобы отображалось название района? Здравствуйте, Вы проанализировали этот демо пример?: \FMSoft\Framework\uniGUI\Demos\Desktop\GridWithDBLookupCombo Quote Link to comment Share on other sites More sharing options...
x11 Posted May 9, 2020 Author Share Posted May 9, 2020 Да, проанализировал. Но, в том примере та же самая проблема. В столбце ShipToCountry отображается значение КЛЮЧЕВОГО поля (key field). А нужно отображать значение поля list field. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 9, 2020 Share Posted May 9, 2020 35 minutes ago, x11 said: А нужно отображать значение поля list field. UniDBLookupComboBox1.GridMode = lgmPostListValue? Quote Link to comment Share on other sites More sharing options...
x11 Posted May 9, 2020 Author Share Posted May 9, 2020 Нет. У меня lgmPostKeyValue. Quote Link to comment Share on other sites More sharing options...
x11 Posted May 9, 2020 Author Share Posted May 9, 2020 По правилам таблиц-справочников в основной таблице храниться значение ключевого поля, поэтому в основную таблицу нужно записать значение ключевого поля из таблицы-справочника. Основная таблица и таблица-справочник связаны между собой внешним ключом - foreign key. Quote Link to comment Share on other sites More sharing options...
x11 Posted May 9, 2020 Author Share Posted May 9, 2020 Пользователь должен видеть в столбце значение поля regions.name, а в таблице храниться значение regions.id Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 9, 2020 Share Posted May 9, 2020 Используйте LookupField тогда, если я правильно понимаю Вас: \FMSoft\Framework\uniGUI\Demos\Desktop\DBLookupComboBox 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted May 9, 2020 Author Share Posted May 9, 2020 Ну да, добавил еще одно lookup-поле в DatsSet, теперь получилось. Спасибо. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.