Dashboard InitializeLayout

The InitializeLayout does not work, even though I get no errors:

easier to read the code now......


Public Class Script
Dim WithEvents myGrid as EpiUltraGrid
' ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
' Begin Wizard Added Module Level Variables **
' End Wizard Added Module Level Variables **
' Add Custom Module Level Variables Here **
Public Sub InitializeCustomCode()
' ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
' Begin Wizard Added Variable Initialization

' End Wizard Added Variable Initialization
' Begin Wizard Added Custom Method Calls

' End Wizard Added Custom Method Calls

' Begin Custom Code
myGrid = CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9ac"),EpiUltraGrid)
AddHandler myGrid.InitializeLayout , AddressOf myGrid_InitializeLayout
' End Custom Code
End Sub
Public Sub DestroyCustomCode()
' ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
' Begin Wizard Added Object Disposal
'RemoveHandler Me.V_UFPT_QuotePipeHasDocs_1View_Row.EpiRowChanged, AddressOf Me.V_UFPT_QuotePipeHasDocs_1View_AfterRowChange
' End Wizard Added Object Disposal
' Begin Custom Code Disposal
' AddHandler myGrid.InitializeLayout , AddressOf myGrid_InitializeLayout
' End Custom Code Disposal
End Sub

Private Sub MainController_Load(ByVal sender As Object, ByVal args As EventArgs)
' Add Event Handler Code
MessageBox.Show("load")
'myGrid = CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9ac"),EpiUltraGrid)
'Dim myGrid as EpiUltraGrid = CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9ac"),EpiUltraGrid)
myGrid.DisplayLayout.Bands(0).Columns.Add("test","test")

Dim dsNewmyGrid as system.data.dataview = myGrid.DataSource
Dim dr as datarow
Dim tURL as String
For Each dr in dsNewmyGrid.Table.Rows
tURL = dr.Item("QuoteHed.ShortChar10")
'MessageBox.Show(tURL)
Next
MessageBox.Show("after load")
End Sub
Private Sub myGrid_InitializeLayout(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles myGrid.InitializeLayout
MessageBox.Show("initialize layout")
e.Layout.Bands(0).Columns(0).CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor = Color.Blue
e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline = Infragistics.Win.DefaultableBoolean.True
e.Layout.Bands(0).Columns(0).CellAppearance.Cursor = Cursors.Hand
End Sub


--- In vantage@yahoogroups.com, "tomdomurat" <tomdomurat@...> wrote:
>
> The declarations seems to work now, thanks.
> However, the InitializeLayout event does not work(??) I don't get any
> errors, but it doesn't work either.
> Here is the complete code:
> Public Class ScriptDim WithEvents myGrid as EpiUltraGrid ' ** Wizard
> Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level
> Variables' Comments! ** ' Begin Wizard Added Module Level Variables ** '
> End Wizard Added Module Level Variables ** ' Add Custom Module Level
> Variables Here ** Public Sub InitializeCustomCode() ' ** Wizard Insert
> Location - Do not delete 'Begin/End Wizard Added Variable
> Initialization' lines ** ' Begin Wizard Added Variable Initialization
> ' End Wizard Added Variable Initialization ' Begin Wizard Added Custom
> Method Calls ' End Wizard Added Custom Method Calls ' Begin Custom
> Code myGrid =
> CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> c"),EpiUltraGrid) AddHandler myGrid.InitializeLayout , AddressOf
> myGrid_InitializeLayout ' End Custom Code End Sub Public Sub
> DestroyCustomCode() ' ** Wizard Insert Location - Do not delete
> 'Begin/End Wizard Added Object Disposal' lines ** ' Begin Wizard Added
> Object Disposal 'RemoveHandler
> Me.V_UFPT_QuotePipeHasDocs_1View_Row.EpiRowChanged, AddressOf
> Me.V_UFPT_QuotePipeHasDocs_1View_AfterRowChange ' End Wizard Added
> Object Disposal ' Begin Custom Code Disposal ' AddHandler
> myGrid.InitializeLayout , AddressOf myGrid_InitializeLayout ' End
> Custom Code Disposal End Sub
> Private Sub MainController_Load(ByVal sender As Object, ByVal args As
> EventArgs) ' Add Event Handler Code MessageBox.Show("load") 'myGrid =
> CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> c"),EpiUltraGrid) 'Dim myGrid as EpiUltraGrid =
> CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> c"),EpiUltraGrid)
> myGrid.DisplayLayout.Bands(0).Columns.Add("test","test") Dim
> dsNewmyGrid as system.data.dataview = myGrid.DataSource Dim dr as
> datarow Dim tURL as String For Each dr in dsNewmyGrid.Table.Rows tURL =
> dr.Item("QuoteHed.ShortChar10") 'MessageBox.Show(tURL) Next
> MessageBox.Show("after load") End SubPrivate Sub
> myGrid_InitializeLayout(ByVal sender As System.Object, ByVal e As
> Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles
> myGrid.InitializeLayout MessageBox.Show("initialize layout")
> e.Layout.Bands(0).Columns(0).CellActivation =
> Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
> e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor = Color.Blue
> e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
> Infragistics.Win.DefaultableBoolean.True
> e.Layout.Bands(0).Columns(0).CellAppearance.Cursor = Cursors.HandEnd Sub
>
> In vantage@yahoogroups.com, "Anon" <epicor-team@> wrote:>
> > I think you have to declare it like this:
> >
> > Dim WithEvents myGrid as EpiUltraGrid
> >
> > At the very very top just below the class identifier. Then in the
> InitializeCustomCode() you would want to do:
> >
> > myGrid =
> CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> c"),EpiUltraGrid)
> >
> > And then of course make sure to dispose of it in the Destroy.
> >
> >
> >
> >
> > --- In vantage@yahoogroups.com, "tomdomurat" tomdomurat@ wrote:
> > >
> > > I tried that and get the following error. BTW, this is on the Load
> event of a customized Dashboard.
> > > I also tried declaring "myGrid" outside the Sub, everything compiles
> but then the dashboard throws invocation error when loading.
> > >
> > > Private Sub MainController_Load(ByVal sender As Object, ByVal args
> As EventArgs)
> > > ' Add Event Handler Code
> > > MessageBox.Show("load")
> > >
> > > Dim WithEvents myGrid as EpiUltraGrid =
> CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> c"),EpiUltraGrid)
> > >
> > > ......
> > >
> > > Compiling Custom Code ...
> > > ----------errors------------
> > > Error: BC30247 - line 66 (142) - 'WithEvents' is not valid on a
> local variable declaration.
> > >
> > >
> > > --- In vantage@yahoogroups.com, John Driggers <waffqle@> wrote:
> > > >
> > > > When you instantiate the grid you need to declare it 'WithEvents'.
> > > >
> > > >
> > > > *John Driggers*
> > > > **
> > > > *Chief Data Wrangler*
> > > > *
> > > > *
> > > > *I have an Epicor blog <http://usdoingstuff.com/>. How useful is
> that?*
> > > > *
> > > > *:: 904.404.9233
> > > > :: waffqle@
> > > > :: http://www.usdoingstuff.com <http://www.usdoingstuff.com/>
> > > >
> > > > *
> > > >
> > > > *
> > > >
> > > >
> > > >
> > > > On Thu, Oct 11, 2012 at 12:00 PM, tomdomurat <tomdomurat@> wrote:
> > > >
> > > > > **
> > > > >
> > > > >
> > > > > Trying to change the appearance of the Dashboard using the
> > > > > InitializeLayout. See the code and error below:
> > > > >
> > > > > Imports Infragistics.Win
> > > > > Imports Infragistics.Win.UltraWinGrid
> > > > >
> > > > > Private Sub MainController_Load(ByVal sender As Object, ByVal
> args As
> > > > > EventArgs)
> > > > > ' Add Event Handler Code
> > > > > MessageBox.Show("load")
> > > > > Dim myGrid as EpiUltraGrid =
> > > > >
> CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> \
> > > > > c"),EpiUltraGrid)
> > > > >
> > > > > myGrid.DisplayLayout.Bands(0).Columns.Add("test","test")
> > > > >
> > > > > Dim dsNewmyGrid as system.data.dataview = myGrid.DataSource
> > > > > Dim dr as datarow
> > > > > Dim tURL as String
> > > > > For Each dr in dsNewmyGrid.Table.Rows
> > > > > tURL = dr.Item("QuoteHed.ShortChar10")
> > > > > 'MessageBox.Show(tURL)
> > > > > Next
> > > > > MessageBox.Show("after load")
> > > > > End Sub
> > > > >
> > > > > -- line 78 --
> > > > >
> > > > > Private Sub myGrid_InitializeLayout(ByVal sender As
> System.Object, ByVal
> > > > > e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs)
> Handles
> > > > > myGrid.InitializeLayout
> > > > > e.Layout.Bands(0).Columns(0).CellActivation =
> > > > > Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
> > > > > e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor =
> Color.Blue
> > > > > e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
> > > > > Infragistics.Win.DefaultableBoolean.True
> > > > > e.Layout.Bands(0).Columns(0).CellAppearance.Cursor =
> Cursors.Hand
> > > > > End Sub
> > > > >
> > > > > Compiling Custom Code ...
> > > > >
> > > > > ----------errors------------
> > > > >
> > > > > Error: BC30506 - line 78 (154) - Handles clause requires a
> WithEvents
> > > > > variable defined in the containing type or one of its base
> types.
> > > > >
> > > > > ** Compile Failed. **
> > > > >
> > > > > [Non-text portions of this message have been removed]
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> >
>
>
>
> [Non-text portions of this message have been removed]
>
Trying to change the appearance of the Dashboard using the
InitializeLayout. See the code and error below:

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid


Private Sub MainController_Load(ByVal sender As Object, ByVal args As
EventArgs)
' Add Event Handler Code
MessageBox.Show("load")
Dim myGrid as EpiUltraGrid =
CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
c"),EpiUltraGrid)

myGrid.DisplayLayout.Bands(0).Columns.Add("test","test")

Dim dsNewmyGrid as system.data.dataview = myGrid.DataSource
Dim dr as datarow
Dim tURL as String
For Each dr in dsNewmyGrid.Table.Rows
tURL = dr.Item("QuoteHed.ShortChar10")
'MessageBox.Show(tURL)
Next
MessageBox.Show("after load")
End Sub



-- line 78 --

Private Sub myGrid_InitializeLayout(ByVal sender As System.Object, ByVal
e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles
myGrid.InitializeLayout
e.Layout.Bands(0).Columns(0).CellActivation =
Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor = Color.Blue
e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
Infragistics.Win.DefaultableBoolean.True
e.Layout.Bands(0).Columns(0).CellAppearance.Cursor = Cursors.Hand
End Sub


Compiling Custom Code ...

----------errors------------

Error: BC30506 - line 78 (154) - Handles clause requires a WithEvents
variable defined in the containing type or one of its base types.

** Compile Failed. **



[Non-text portions of this message have been removed]
I can't say I fully understand how it works yet (somewhat of a self proclaimed novice) but it looks like the variable instantiation requires the WithEvents keyword and not just the defined Handle.

I don't usually define the handle "Private Sub myGrid_InitializeLayout(ByVal sender As System.Object, ByVal
e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles
myGrid.InitializeLayout" as such but instead at the class level define it as "Private WithEvents myGrid_InitializeLayout Handles myGrid.InitializeLayout"

Not sure if that's correct 100% but it might take care of the issue for you.

--- In vantage@yahoogroups.com, "tomdomurat" <tomdomurat@...> wrote:
>
> Trying to change the appearance of the Dashboard using the
> InitializeLayout. See the code and error below:
>
> Imports Infragistics.Win
> Imports Infragistics.Win.UltraWinGrid
>
>
> Private Sub MainController_Load(ByVal sender As Object, ByVal args As
> EventArgs)
> ' Add Event Handler Code
> MessageBox.Show("load")
> Dim myGrid as EpiUltraGrid =
> CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> c"),EpiUltraGrid)
>
> myGrid.DisplayLayout.Bands(0).Columns.Add("test","test")
>
> Dim dsNewmyGrid as system.data.dataview = myGrid.DataSource
> Dim dr as datarow
> Dim tURL as String
> For Each dr in dsNewmyGrid.Table.Rows
> tURL = dr.Item("QuoteHed.ShortChar10")
> 'MessageBox.Show(tURL)
> Next
> MessageBox.Show("after load")
> End Sub
>
>
>
> -- line 78 --
>
> Private Sub myGrid_InitializeLayout(ByVal sender As System.Object, ByVal
> e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles
> myGrid.InitializeLayout
> e.Layout.Bands(0).Columns(0).CellActivation =
> Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
> e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor = Color.Blue
> e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
> Infragistics.Win.DefaultableBoolean.True
> e.Layout.Bands(0).Columns(0).CellAppearance.Cursor = Cursors.Hand
> End Sub
>
>
> Compiling Custom Code ...
>
> ----------errors------------
>
> Error: BC30506 - line 78 (154) - Handles clause requires a WithEvents
> variable defined in the containing type or one of its base types.
>
> ** Compile Failed. **
>
>
>
> [Non-text portions of this message have been removed]
>
When you instantiate the grid you need to declare it 'WithEvents'.


*John Driggers*
**
*Chief Data Wrangler*
*
*
*I have an Epicor blog <http://usdoingstuff.com/>. How useful is that?*
*
*:: 904.404.9233
:: waffqle@...
:: http://www.usdoingstuff.com <http://www.usdoingstuff.com/>

*

*



On Thu, Oct 11, 2012 at 12:00 PM, tomdomurat <tomdomurat@...> wrote:

> **
>
>
> Trying to change the appearance of the Dashboard using the
> InitializeLayout. See the code and error below:
>
> Imports Infragistics.Win
> Imports Infragistics.Win.UltraWinGrid
>
> Private Sub MainController_Load(ByVal sender As Object, ByVal args As
> EventArgs)
> ' Add Event Handler Code
> MessageBox.Show("load")
> Dim myGrid as EpiUltraGrid =
> CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> c"),EpiUltraGrid)
>
> myGrid.DisplayLayout.Bands(0).Columns.Add("test","test")
>
> Dim dsNewmyGrid as system.data.dataview = myGrid.DataSource
> Dim dr as datarow
> Dim tURL as String
> For Each dr in dsNewmyGrid.Table.Rows
> tURL = dr.Item("QuoteHed.ShortChar10")
> 'MessageBox.Show(tURL)
> Next
> MessageBox.Show("after load")
> End Sub
>
> -- line 78 --
>
> Private Sub myGrid_InitializeLayout(ByVal sender As System.Object, ByVal
> e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles
> myGrid.InitializeLayout
> e.Layout.Bands(0).Columns(0).CellActivation =
> Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
> e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor = Color.Blue
> e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
> Infragistics.Win.DefaultableBoolean.True
> e.Layout.Bands(0).Columns(0).CellAppearance.Cursor = Cursors.Hand
> End Sub
>
> Compiling Custom Code ...
>
> ----------errors------------
>
> Error: BC30506 - line 78 (154) - Handles clause requires a WithEvents
> variable defined in the containing type or one of its base types.
>
> ** Compile Failed. **
>
> [Non-text portions of this message have been removed]
>
>
>


[Non-text portions of this message have been removed]
I tried that and get the following error. BTW, this is on the Load event of a customized Dashboard.
I also tried declaring "myGrid" outside the Sub, everything compiles but then the dashboard throws invocation error when loading.

Private Sub MainController_Load(ByVal sender As Object, ByVal args As EventArgs)
' Add Event Handler Code
MessageBox.Show("load")

Dim WithEvents myGrid as EpiUltraGrid = CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9ac"),EpiUltraGrid)

......

Compiling Custom Code ...
----------errors------------
Error: BC30247 - line 66 (142) - 'WithEvents' is not valid on a local variable declaration.


--- In vantage@yahoogroups.com, John Driggers <waffqle@...> wrote:
>
> When you instantiate the grid you need to declare it 'WithEvents'.
>
>
> *John Driggers*
> **
> *Chief Data Wrangler*
> *
> *
> *I have an Epicor blog <http://usdoingstuff.com/>. How useful is that?*
> *
> *:: 904.404.9233
> :: waffqle@...
> :: http://www.usdoingstuff.com <http://www.usdoingstuff.com/>
>
> *
>
> *
>
>
>
> On Thu, Oct 11, 2012 at 12:00 PM, tomdomurat <tomdomurat@...> wrote:
>
> > **
> >
> >
> > Trying to change the appearance of the Dashboard using the
> > InitializeLayout. See the code and error below:
> >
> > Imports Infragistics.Win
> > Imports Infragistics.Win.UltraWinGrid
> >
> > Private Sub MainController_Load(ByVal sender As Object, ByVal args As
> > EventArgs)
> > ' Add Event Handler Code
> > MessageBox.Show("load")
> > Dim myGrid as EpiUltraGrid =
> > CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> > c"),EpiUltraGrid)
> >
> > myGrid.DisplayLayout.Bands(0).Columns.Add("test","test")
> >
> > Dim dsNewmyGrid as system.data.dataview = myGrid.DataSource
> > Dim dr as datarow
> > Dim tURL as String
> > For Each dr in dsNewmyGrid.Table.Rows
> > tURL = dr.Item("QuoteHed.ShortChar10")
> > 'MessageBox.Show(tURL)
> > Next
> > MessageBox.Show("after load")
> > End Sub
> >
> > -- line 78 --
> >
> > Private Sub myGrid_InitializeLayout(ByVal sender As System.Object, ByVal
> > e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles
> > myGrid.InitializeLayout
> > e.Layout.Bands(0).Columns(0).CellActivation =
> > Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
> > e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor = Color.Blue
> > e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
> > Infragistics.Win.DefaultableBoolean.True
> > e.Layout.Bands(0).Columns(0).CellAppearance.Cursor = Cursors.Hand
> > End Sub
> >
> > Compiling Custom Code ...
> >
> > ----------errors------------
> >
> > Error: BC30506 - line 78 (154) - Handles clause requires a WithEvents
> > variable defined in the containing type or one of its base types.
> >
> > ** Compile Failed. **
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
I think you have to declare it like this:

Dim WithEvents myGrid as EpiUltraGrid

At the very very top just below the class identifier. Then in the InitializeCustomCode() you would want to do:

myGrid = CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9ac"),EpiUltraGrid)

And then of course make sure to dispose of it in the Destroy.




--- In vantage@yahoogroups.com, "tomdomurat" <tomdomurat@...> wrote:
>
> I tried that and get the following error. BTW, this is on the Load event of a customized Dashboard.
> I also tried declaring "myGrid" outside the Sub, everything compiles but then the dashboard throws invocation error when loading.
>
> Private Sub MainController_Load(ByVal sender As Object, ByVal args As EventArgs)
> ' Add Event Handler Code
> MessageBox.Show("load")
>
> Dim WithEvents myGrid as EpiUltraGrid = CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9ac"),EpiUltraGrid)
>
> ......
>
> Compiling Custom Code ...
> ----------errors------------
> Error: BC30247 - line 66 (142) - 'WithEvents' is not valid on a local variable declaration.
>
>
> --- In vantage@yahoogroups.com, John Driggers <waffqle@> wrote:
> >
> > When you instantiate the grid you need to declare it 'WithEvents'.
> >
> >
> > *John Driggers*
> > **
> > *Chief Data Wrangler*
> > *
> > *
> > *I have an Epicor blog <http://usdoingstuff.com/>. How useful is that?*
> > *
> > *:: 904.404.9233
> > :: waffqle@
> > :: http://www.usdoingstuff.com <http://www.usdoingstuff.com/>
> >
> > *
> >
> > *
> >
> >
> >
> > On Thu, Oct 11, 2012 at 12:00 PM, tomdomurat <tomdomurat@> wrote:
> >
> > > **
> > >
> > >
> > > Trying to change the appearance of the Dashboard using the
> > > InitializeLayout. See the code and error below:
> > >
> > > Imports Infragistics.Win
> > > Imports Infragistics.Win.UltraWinGrid
> > >
> > > Private Sub MainController_Load(ByVal sender As Object, ByVal args As
> > > EventArgs)
> > > ' Add Event Handler Code
> > > MessageBox.Show("load")
> > > Dim myGrid as EpiUltraGrid =
> > > CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
> > > c"),EpiUltraGrid)
> > >
> > > myGrid.DisplayLayout.Bands(0).Columns.Add("test","test")
> > >
> > > Dim dsNewmyGrid as system.data.dataview = myGrid.DataSource
> > > Dim dr as datarow
> > > Dim tURL as String
> > > For Each dr in dsNewmyGrid.Table.Rows
> > > tURL = dr.Item("QuoteHed.ShortChar10")
> > > 'MessageBox.Show(tURL)
> > > Next
> > > MessageBox.Show("after load")
> > > End Sub
> > >
> > > -- line 78 --
> > >
> > > Private Sub myGrid_InitializeLayout(ByVal sender As System.Object, ByVal
> > > e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles
> > > myGrid.InitializeLayout
> > > e.Layout.Bands(0).Columns(0).CellActivation =
> > > Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
> > > e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor = Color.Blue
> > > e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
> > > Infragistics.Win.DefaultableBoolean.True
> > > e.Layout.Bands(0).Columns(0).CellAppearance.Cursor = Cursors.Hand
> > > End Sub
> > >
> > > Compiling Custom Code ...
> > >
> > > ----------errors------------
> > >
> > > Error: BC30506 - line 78 (154) - Handles clause requires a WithEvents
> > > variable defined in the containing type or one of its base types.
> > >
> > > ** Compile Failed. **
> > >
> > > [Non-text portions of this message have been removed]
> > >
> > >
> > >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
The declarations seems to work now, thanks.
However, the InitializeLayout event does not work(??) I don't get any
errors, but it doesn't work either.
Here is the complete code:
Public Class ScriptDim WithEvents myGrid as EpiUltraGrid ' ** Wizard
Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level
Variables' Comments! ** ' Begin Wizard Added Module Level Variables ** '
End Wizard Added Module Level Variables ** ' Add Custom Module Level
Variables Here ** Public Sub InitializeCustomCode() ' ** Wizard Insert
Location - Do not delete 'Begin/End Wizard Added Variable
Initialization' lines ** ' Begin Wizard Added Variable Initialization
' End Wizard Added Variable Initialization ' Begin Wizard Added Custom
Method Calls ' End Wizard Added Custom Method Calls ' Begin Custom
Code myGrid =
CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
c"),EpiUltraGrid) AddHandler myGrid.InitializeLayout , AddressOf
myGrid_InitializeLayout ' End Custom Code End Sub Public Sub
DestroyCustomCode() ' ** Wizard Insert Location - Do not delete
'Begin/End Wizard Added Object Disposal' lines ** ' Begin Wizard Added
Object Disposal 'RemoveHandler
Me.V_UFPT_QuotePipeHasDocs_1View_Row.EpiRowChanged, AddressOf
Me.V_UFPT_QuotePipeHasDocs_1View_AfterRowChange ' End Wizard Added
Object Disposal ' Begin Custom Code Disposal ' AddHandler
myGrid.InitializeLayout , AddressOf myGrid_InitializeLayout ' End
Custom Code Disposal End Sub
Private Sub MainController_Load(ByVal sender As Object, ByVal args As
EventArgs) ' Add Event Handler Code MessageBox.Show("load") 'myGrid =
CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
c"),EpiUltraGrid) 'Dim myGrid as EpiUltraGrid =
CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
c"),EpiUltraGrid)
myGrid.DisplayLayout.Bands(0).Columns.Add("test","test") Dim
dsNewmyGrid as system.data.dataview = myGrid.DataSource Dim dr as
datarow Dim tURL as String For Each dr in dsNewmyGrid.Table.Rows tURL =
dr.Item("QuoteHed.ShortChar10") 'MessageBox.Show(tURL) Next
MessageBox.Show("after load") End SubPrivate Sub
myGrid_InitializeLayout(ByVal sender As System.Object, ByVal e As
Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles
myGrid.InitializeLayout MessageBox.Show("initialize layout")
e.Layout.Bands(0).Columns(0).CellActivation =
Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor = Color.Blue
e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
Infragistics.Win.DefaultableBoolean.True
e.Layout.Bands(0).Columns(0).CellAppearance.Cursor = Cursors.HandEnd Sub

In vantage@yahoogroups.com, "Anon" <epicor-team@...> wrote:>
> I think you have to declare it like this:
>
> Dim WithEvents myGrid as EpiUltraGrid
>
> At the very very top just below the class identifier. Then in the
InitializeCustomCode() you would want to do:
>
> myGrid =
CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
c"),EpiUltraGrid)
>
> And then of course make sure to dispose of it in the Destroy.
>
>
>
>
> --- In vantage@yahoogroups.com, "tomdomurat" tomdomurat@ wrote:
> >
> > I tried that and get the following error. BTW, this is on the Load
event of a customized Dashboard.
> > I also tried declaring "myGrid" outside the Sub, everything compiles
but then the dashboard throws invocation error when loading.
> >
> > Private Sub MainController_Load(ByVal sender As Object, ByVal args
As EventArgs)
> > ' Add Event Handler Code
> > MessageBox.Show("load")
> >
> > Dim WithEvents myGrid as EpiUltraGrid =
CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
c"),EpiUltraGrid)
> >
> > ......
> >
> > Compiling Custom Code ...
> > ----------errors------------
> > Error: BC30247 - line 66 (142) - 'WithEvents' is not valid on a
local variable declaration.
> >
> >
> > --- In vantage@yahoogroups.com, John Driggers <waffqle@> wrote:
> > >
> > > When you instantiate the grid you need to declare it 'WithEvents'.
> > >
> > >
> > > *John Driggers*
> > > **
> > > *Chief Data Wrangler*
> > > *
> > > *
> > > *I have an Epicor blog <http://usdoingstuff.com/>. How useful is
that?*
> > > *
> > > *:: 904.404.9233
> > > :: waffqle@
> > > :: http://www.usdoingstuff.com <http://www.usdoingstuff.com/>
> > >
> > > *
> > >
> > > *
> > >
> > >
> > >
> > > On Thu, Oct 11, 2012 at 12:00 PM, tomdomurat <tomdomurat@> wrote:
> > >
> > > > **
> > > >
> > > >
> > > > Trying to change the appearance of the Dashboard using the
> > > > InitializeLayout. See the code and error below:
> > > >
> > > > Imports Infragistics.Win
> > > > Imports Infragistics.Win.UltraWinGrid
> > > >
> > > > Private Sub MainController_Load(ByVal sender As Object, ByVal
args As
> > > > EventArgs)
> > > > ' Add Event Handler Code
> > > > MessageBox.Show("load")
> > > > Dim myGrid as EpiUltraGrid =
> > > >
CType(csm.GetNativeControlReference("f78f6a5b-6ea2-4a8c-a72b-b50aa59be9a\
\
> > > > c"),EpiUltraGrid)
> > > >
> > > > myGrid.DisplayLayout.Bands(0).Columns.Add("test","test")
> > > >
> > > > Dim dsNewmyGrid as system.data.dataview = myGrid.DataSource
> > > > Dim dr as datarow
> > > > Dim tURL as String
> > > > For Each dr in dsNewmyGrid.Table.Rows
> > > > tURL = dr.Item("QuoteHed.ShortChar10")
> > > > 'MessageBox.Show(tURL)
> > > > Next
> > > > MessageBox.Show("after load")
> > > > End Sub
> > > >
> > > > -- line 78 --
> > > >
> > > > Private Sub myGrid_InitializeLayout(ByVal sender As
System.Object, ByVal
> > > > e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs)
Handles
> > > > myGrid.InitializeLayout
> > > > e.Layout.Bands(0).Columns(0).CellActivation =
> > > > Infragistics.Win.UltraWinGrid.Activation.ActivateOnly
> > > > e.Layout.Bands(0).Columns(0).CellAppearance.ForeColor =
Color.Blue
> > > > e.Layout.Bands(0).Columns(0).CellAppearance.FontData.Underline =
> > > > Infragistics.Win.DefaultableBoolean.True
> > > > e.Layout.Bands(0).Columns(0).CellAppearance.Cursor =
Cursors.Hand
> > > > End Sub
> > > >
> > > > Compiling Custom Code ...
> > > >
> > > > ----------errors------------
> > > >
> > > > Error: BC30506 - line 78 (154) - Handles clause requires a
WithEvents
> > > > variable defined in the containing type or one of its base
types.
> > > >
> > > > ** Compile Failed. **
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > > >
> > > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>



[Non-text portions of this message have been removed]