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!
|
|
How to...Goto account based on selected row in datagrid
Posted: 23 Aug 06 5:07 PM
|
fiogf49gjkf0d When I doubleclick on a row in a datagrid in the tabspane I would like the detailsview to change to the associated account.
I tried: set application.BasicFunctions.CurrentAccountID=DataGrid1.Selection
And: set application.BasicFunctions.GetCurrentAccountID= DataGrid1.Selection
And: set frmAccountDetail.BindID= DataGrid1.Keyfield
None worked ... Mainview is called "Account Details"... the DetailsView is a form named frmAccount_Detail from a plugin called "Account Detail"... My manageform in the tabspane is called Sales_Order_Lines in a plugin called "ProSoft Order Lines"
Any Suggestions Thanks P.S. If it can be done with and without switching the active window that would be great
|
|
|
|
Re: How to...Goto account based on selected row in datagrid
Posted: 23 Aug 06 5:29 PM
|
fiogf49gjkf0d First of all, DataGrid.Selection is a collection, not a property. Using it the way you are won't get you what you're after. Also, KEYFIELD represents the field name, not the value. To get a value from the grid you can use either a value from the selection collection, or use GetCurrentField.
There are a few different ways to do what you're after. The cleanest way IMO is to use the ShowDetails method:
Application.BasicFunctions.ShowDetails "account", datagrid1.GetCurrentField("accountid")
Make sense? |
|
|
|
Re: How to...Goto account based on selected row in datagrid
Posted: 23 Aug 06 5:35 PM
|
fiogf49gjkf0d Also, from your attempts, this one would have worked (assuming you were grabbing a specific ID value from the selection collection or using GetCurrentField - and dropped the "=")
Application.BasicFunctions.CurrentAccountID datagrid1.GetCurrentField("accountid")
CurrentAccountID is a function which takes a single parameter, not a property (although it should be). However, with 6.2 the "Current" functions, such as CurrentAccountID have less meaning due to the introduction of MainViews. So use something like ShowDetails instead.
|
|
|
| |
| |
| |
|
Re:
Posted: 23 Aug 06 8:04 PM
|
fiogf49gjkf0d moved to new string |
|
|
|