This is a migrated thread and some comments may be shown as answers.

[Solved] Grid with drop-down box in edit mode

1 Answer 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
scrut
Top achievements
Rank 1
scrut asked on 22 May 2008, 05:53 PM
I have three tables similar to these ones:

DISTRIBUTION:
id
le_id
amount

LE:
id
nlro_id

NLRO:
id
le

DISTRIBUTION.le_id  has foreign key relationship to LE.id
LE.nlro_id has foreign key relationship to NLRO.id

What I want to do with this is have a Grid display the NLRO.le and the DISTRIBUTION.amount. That's really all I need to display.

So I guess a statement such as this one would do the job:

SELECT NLRO.le, DISTRIBUTION.amount
FROM DISTRIBUTION
INNER JOIN LE
ON DISTRIBUTION.le_id = LE.id
INNER JOIN NLRO
ON LE.nlro_id = NLRO.id

This Grid should have some Edit button. If I use the built-in edit mode, it would show me "le" and "amount" as editable text fields.

But I want "le" to be a drop-down-list showing all "NLRO.le" items (their key is LE.id):
SELECT LE.id, NLRO.le
FROM LE
INNER JOIN NLRO
WHERE LE.nlro_id = NLRO.id

How do I do that? I found no way to define the way the edit pane looks like. And even if I can define that: how do I make sure that clicking the "save/update"-buttons will save the right stuff in DISTRIBUTION? (like the le_id instead of the nlro.le which is the text of the drop-down list?)

Thanks

s.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 May 2008, 10:50 AM
Hi Scrut,

Try using a GridDropDown Column. Bind the field "le" to the DropDownColumn. Go through the following links.

Customize/Configure GridDropDownColumn
Column types

Shinu.
Tags
Grid
Asked by
scrut
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or