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!
|
|
DataGrid.OnAddedRow doesn't fire.
Posted: 04 Jun 07 9:53 AM
|
After adding a record to the underlying table, I simply want the datagrid to refresh and show the newly added record (something it should probably do on its own). The OnAddedRow event never fires. The OnDeletedRow does.
An F5 refreshes everything and shows my newly added record(s)...
v6.2.6 - I only have Add and Delete enabled in the Edit Options (Edit serves no funtion in my grid)
|
|
|
|
Re: DataGrid.OnAddedRow doesn't fire.
Posted: 04 Jun 07 12:31 PM
|
Are you launching your "add" view via code or it that happening automatically from the EditView form selected for the grid? |
|
|
|
Re: DataGrid.OnAddedRow doesn't fire.
Posted: 04 Jun 07 12:38 PM
|
The Add is being lauched by the grid - calling the 'EditView' plugin defined.
I submitted this to Sage - I talked to someone else who experienced this probem and I'm convinced it's a bug with the datagrid control.
I've found a way around it - it's ugly, but it works... On the FormClose for my Editview plugin, I call a refresh there like this:
Dim frmAccountDetail Dim i
For i = 0 to Application.MainViews.Count - 1 If Application.MainViews.Item(i).Name = "System:Account Details" Then Set frmAccountDetail = Application.MainViews.Item(i) If Not (frmAccountDetail.TabsView Is Nothing) Then If frmAccountDetail.TabsView.Name = "frmMarketingEvents" Then frmAccountDetail.TabsView.dgEvents.Refresh End If End If End If Next
Set frmAccountDetail = Nothing |
|
|
| |
|
Re: DataGrid.OnAddedRow doesn't fire.
Posted: 15 Jun 07 9:11 AM
|
1. use an OnGridName_CHANGE_Event (this will become Add change in 7.01, different call).
2. Call it from both the onAdded and onEdited (even though you don't use it).
3. Include a grd.REFRESH in the call.
I don't have any trouble with this one, use it all of the time for calculations.....
4. Make sure that the Grid.SORTABLE = TRUE (load's the entire record set into the grid/memory, including the newly added row).
|
|
|
|
Re: DataGrid.OnAddedRow doesn't fire.
Posted: 17 Oct 07 3:22 PM
|
Shawn,
I just ran into the same issue (I was getting an IDispatch.Invoke() error)with a datagrid upgraded from v6.2. In that case the problem was that the old event created a sub "myDGaddedrow(sender)". the 7.2 stub for that event is "myDGaddedrow(sender, key)". Once I made that change to my code, the event triigered without error.
I hope this helps someone. |
|
|
| |
| |
|