Subject: Wiring Event with SDK?
Prev Next
You are not authorized to post a reply.

Author Messages
Chris BUser is Offline

Posts:36

07/23/2008 5:32 AM  
Hi,

How can I wire an event on the SDK for example, i've got:

            Dim grdItemProfit_Control As DevExpress.XtraGrid.GridControl = Nothing

            ' Attempt to drill to object inside a try/catch block
            Try
                grdItemProfit_Control = TryCast(Me.FindForm().Controls("PanelBody").Controls("SalesOrderControl").Controls("PluginContainerBody").Controls("TabBody").Controls("TabPageProfit").Controls("PluginContainerBoxProfit").Controls("ProfitControl").Controls("LayoutControlProfit").Controls("grdItemProfit"), DevExpress.XtraGrid.GridControl)
            Catch generatedExceptionName As System.Exception
            End Try

I'd like to have the event MarginChanged wired so I can call my own custom functions that shows itself when you put DS Form Info Tool on it.

The other bit of code im struggling with is when the form loads by default its in Inventory Item tab, but my custom section plugin is on top left.  But until they click the profit the control isnt obstanced, how can i obstance this manually using the Load Event on my Section Plugin?

Thanks,
Chris
Chris BUser is Offline

Posts:36

07/23/2008 7:51 AM  
Managed to get around issue by putting a timer on the page that runs every 500 milleseconds, as I couldnt get the AddHandler event on MarginChanged to fire.

Anybody got any ideas how I can run the TabPageProfit_Control Click event that interprise have wrote from my code, as if i dont do this in my page_load of my section it will get a null reference to the object.

Im using:
TabPageProfit_Control = TryCast(Me.FindForm().Controls("PanelBody").Controls("SalesOrderControl").Controls("PluginContainerBody").Controls("TabBody").Controls("TabPageProfit"), DevExpress.XtraTab.XtraTabPage)

But you cant use RaiseEvent TabPageProfit_Control.Click as nothing appears..........................

Help!!! Soo far now but soo close to finishing this first module.
Ramil DUser is Offline

Posts:200

07/28/2008 10:29 PM  
Since you are using SP4 HF2 this is a known limitation of the SDK/Platform. We are working on something that will solve this problem. I have asked my developer to take a look at your situation and look for a work around on the existing version so you can move forward.
Chris BUser is Offline

Posts:36

07/29/2008 3:31 AM  
Thanks. Do I take it if i wanted to hook onto the Save & Close button of the quote form this is going to be same sort of problem?
Chris BUser is Offline

Posts:36

08/11/2008 2:01 AM  
Any news on this?

Thanks
Ramil DUser is Offline

Posts:200

08/17/2008 3:15 AM  
Sorry for the late reply. I recommend that you send an email to support@interprisesolutions.com and they'll be glad to extend more help regarding this matter. Thanks!
Raymond DUser is Offline

Posts:5

08/20/2008 12:09 AM  
Posted By Chris B on 07/23/2008 7:51 AM
Managed to get around issue by putting a timer on the page that runs every 500 milleseconds, as I couldnt get the AddHandler event on MarginChanged to fire.

Anybody got any ideas how I can run the TabPageProfit_Control Click event that interprise have wrote from my code, as if i dont do this in my page_load of my section it will get a null reference to the object.

Im using:
TabPageProfit_Control = TryCast(Me.FindForm().Controls("PanelBody").Controls("SalesOrderControl").Controls("PluginContainerBody").Controls("TabBody").Controls("TabPageProfit"), DevExpress.XtraTab.XtraTabPage)

But you cant use RaiseEvent TabPageProfit_Control.Click as nothing appears..........................

Help!!! Soo far now but soo close to finishing this first module.

Hi Chris,

If you were able to get the instance of the tab control (not the tabPage control), use this code to trap the event each time the "TabPageProfit" is selected.

Addhandler myTabControl.SelectedPageChanged, AddressOf mySelectedPageChanged

Private Sub mySelectedPageChanged(ByVal sender As Object, _
                                                   ByVal e As
DevExpress.XtraTab.TabPageChangedEventArgs) _
                                                   Handles
TabCustomer.SelectedPageChanged
   Select Case e.Page.Name
      Case "TabPageProfit"
            'Put your codes here
   End Select
End Sub


Hope this helps.


Note that in current SDK 2007 SP4HF1 release, controls are not yet exposed publicly. In our 2009 versions, we'll have the "Plugin Communicator" which will provide plugin developers a bridge to communicate to existing controls.


Regards,

Raymond Dazo
Interprise Solutions Team

Chris BUser is Offline

Posts:36

08/20/2008 2:03 AM  
Thanks for that wasnt exactly what im after but its all helping. I need to the code to effectively run the onclick event of the Profit tab control on my control load event as otherwise I cannot get the values from it (we can't rely on the user clicking it). Im unable to get this working however, we don't have the source code license so can only use the SDK methods.

The code im using in the Page_Load event looks like from your example above:

Dim TabBody_Control As Interprise.Presentation.Base.ExtendedXtraTabContol.TabControl = Nothing
Try
TabBody_Control = TryCast(Me.FindForm().Controls("PanelBody").Controls("SalesOrderControl").Controls("PluginContainerBody").Controls("TabBody"), Interprise.Presentation.Base.ExtendedXtraTabContol.TabControl)
Catch generatedExceptionName As System.Exception
End Try

If TabBody_Control IsNot Nothing Then
AddHandler TabBody_Control.SelectedPageChanged, AddressOf mySelectedPageChanged
End If


Private Sub mySelectedPageChanged(ByVal sender As Object, ByVal e As DevExpress.XtraTab.TagPageChangedEventArgs) Handles TabBody_Control.SelectedPageChanged


End Sub


However, as TabBody_Control doesnt exist it doesnt like it. Would using global varables get round this?

Do you have an ETA when the 2009 versions will be out and will they work with SP4 HF1?

Thanks,
Chris
Raymond DUser is Offline

Posts:5

08/26/2008 1:33 AM  
Hi,

Apologies for the later response, again.

Fortunately the TabBody in SalesOrder control is publicly exposed in both SP4HF1 and SP5, as well as the SalesOrderControl in SalesOrderForm.

You could try this:

DirectCast(DirectCast(Me.FindForm, Interprise.Presentation.Customer.SalesOrder.SalesOrderForm).SalesOrderControl, _
Interprise.Presentation.Customer.SalesOrder.SalesOrderControl).TabBody

Use TryCast for you convenience.


Hope this helps.


Raymond Dazo
Interprise Solutions Team
You are not authorized to post a reply.
Forums > Connected Business Platform > General > Wiring Event with SDK?



ActiveForums 3.7
Privacy Statement  |  Terms Of Use
Interprise Software Systems International Inc.