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!
|
|
Open datagrid when button is clicked
Posted: 23 Jul 08 2:53 PM
|
Another question...how do I open a datagrid I created when I click a button.
I would like to have it open in the middle of the account detail view, I would like to be able to move it around the account detail, have it "float" over the account detail view.
Of course also have the ability to X out of it. |
|
|
|
Re: Open datagrid when button is clicked
Posted: 23 Jul 08 3:07 PM
|
Why not just open it in a window?
Otherwise you just add the grid on the Account Detail and toggle it's Visible property. As far as moving it, you just play with the Left and Top properties. I'm not sure you'll have much luck with dragging it around and runtime, but that would be something to play with. |
|
|
| |
|
Re: Open datagrid when button is clicked
Posted: 23 Jul 08 3:15 PM
|
Create a new form, add a datagrid to it. Then when the button is clicked open the form (using DoInvoke if it's a manage form, or ShowViewForRecord if it is a data form based on a table). |
|
|
|
Re: Open datagrid when button is clicked
Posted: 23 Jul 08 3:25 PM
|
Ok. I already created the form (Account Form) and added the datagrid (myDatagrid), I added the button to the account detail form.
Now, I create a function:
Sub btnOpenMyDataGrid (Sender)
myDatagrid.ShowViewForRecord
End Sub
I get an error: Object required 'myDatagrid'
What am I doing wrong? |
|
|
|
Re: Open datagrid when button is clicked
Posted: 23 Jul 08 3:28 PM
|
The fact that the window has a datagrid on it makes no difference. Just the same as opening a blank form in SLX. ShowViewForRecord is part of Application.BasicFunctions, not part of the DataGrid.
Start with just opening a blank window. Then add your datagrid on that window. |
|
|
| |
|