The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Lookup in a Datagrid?
Posted: 16 Jun 11 11:15 AM
|
fiogf49gjkf0d Is it possible to place a lookup in a datagrid? It doesn't appear that it is an option.
My work around would be to create another form behind the datagrid, but I'd like to avoid this if possible. |
|
|
|
Re: Lookup in a Datagrid?
Posted: 16 Jun 11 1:27 PM
|
fiogf49gjkf0d The question here is what do you need a Lookup for.
You could have a hidden lookup on the Same Form as the Grid and invoke it programatically.
|
|
|
|
Re: Lookup in a Datagrid?
Posted: 16 Jun 11 1:43 PM
|
fiogf49gjkf0d This approach may work.
The idea is this:
I have a distinct record in a table (lets call it PARENT) that I need to associate with multiple records from another table(OTHER). My only thought on how to do this without limiting the number of rows associated between the two would be to have a CHILD table that would have the unique PARENTID. So the user could use the CHILD datagrid on the PARENT form to associate with the OTHER table. The lookup would be used to grab the OTHERID of the record that the user wants to associate with the CHILD.
With this method, from one form, the user could associate 1 PARENTID to multiple OTHERID's by doing a 1 to 1 association with the CHILDID's.
Hope that makes sense!
My first thought on how to do this would be to place a button on the datagrid to invoke the lookup. Let me know what you think! |
|
|
|
Re: Lookup in a Datagrid?
Posted: 16 Jun 11 1:55 PM
|
fiogf49gjkf0d The easiest way is use a hyperlink colum type. Set to single click, and when clicked, launches the lookup. It's what I do, works well. |
|
|
|
Re: Lookup in a Datagrid?
Posted: 16 Jun 11 1:56 PM
|
fiogf49gjkf0d Been there and done that.
And yes, using a hidden lookup is probalby the way to go.
You have several options to invoke it: a button, a Custom Menu entry, using one the OnBeforeAdd kind of event for the Grid.
You would clear the Lookup from previous results, popup the Lookup open via code, retreive the results and then pass it to the Add View of the Grid or just writing it directly to the DB. Again, many ways to handle it. |
|
|
|
Re: Lookup in a Datagrid?
Posted: 16 Jun 11 2:23 PM
|
fiogf49gjkf0d
Thanks for the help guys.
One more question, how do I reference a hyperlink or button in the datagrid. In other words, how do I tell it to invoke on click?
Perhaps something like...
MyDatagrid.MyButton.??? |
|
|
| |
| |
|