473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

'AddressOf' operand must be the name of a method; no parentheses a

Hi All
i'm getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
'AddressOf' operand must be the name of a method; no parentheses are needed.

I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO

Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

And called ExapndAll in page load
And on my ASP.NET page called it like this:-
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>

Can u telling me what 'm doing wrong!!
Thx

Nov 18 '05 #1
15 6609

"Patrick.O.Ige" <Pa*********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hi All
i'm getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
'AddressOf' operand must be the name of a method; no parentheses are
needed.

I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO

Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub


I have no idea, except that the VB code does not match the c# code. The VB
equivilent of that snippet is:

Public Sub ExpandAll()
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

David
Nov 18 '05 #2
Hi David,
Thx for the snippet.I tried it but still giving the error!!
The exact error is :-
AddressOf' operand must be the name of a method; no parentheses are needed.
AddHandler __ctrl.Click, AddressOf Me.ExpandAll()
Any help!

"David Browne" wrote:

"Patrick.O.Ige" <Pa*********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hi All
i'm getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
'AddressOf' operand must be the name of a method; no parentheses are
needed.

I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO

Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub


I have no idea, except that the VB code does not match the c# code. The VB
equivilent of that snippet is:

Public Sub ExpandAll()
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

David

Nov 18 '05 #3
Hi Patrcik,
Modify the line of code
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>
to
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll"></asp:Button> and check.
You dont need to give a parenthesis here.
HTH
srini

"Patrick.O.Ige" wrote:
Hi All
i'm getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
'AddressOf' operand must be the name of a method; no parentheses are needed.

I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO

Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

And called ExapndAll in page load
And on my ASP.NET page called it like this:-
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>

Can u telling me what 'm doing wrong!!
Thx

Nov 18 '05 #4
Thx srini changed it but now i still get the error:-

Method 'Public Sub ExpandAll()' does not have the same signature as delegate
'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.

Code below:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
' ExpandAll()
End Sub

Public Sub ExpandAll()
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

ASP.NET
---------
<asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
ID="Button1"></asp:Button>

Anu idea what i'm doing wrong!!
Patrick
"srini" wrote:
Hi Patrcik,
Modify the line of code
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>
to
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll"></asp:Button> and check.
You dont need to give a parenthesis here.
HTH
srini

"Patrick.O.Ige" wrote:
Hi All
i'm getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
'AddressOf' operand must be the name of a method; no parentheses are needed.

I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO

Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

And called ExapndAll in page load
And on my ASP.NET page called it like this:-
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>

Can u telling me what 'm doing wrong!!
Thx

Nov 18 '05 #5
Hi Patrick,
The ExpandAll method shoulf have the same signature as a delegate so the
ExpandAll should be like
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)
HTH
srini
"Patrick.O.Ige" wrote:
Thx srini changed it but now i still get the error:-

Method 'Public Sub ExpandAll()' does not have the same signature as delegate
'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.

Code below:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
' ExpandAll()
End Sub

Public Sub ExpandAll()
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

ASP.NET
---------
<asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
ID="Button1"></asp:Button>

Anu idea what i'm doing wrong!!
Patrick
"srini" wrote:
Hi Patrcik,
Modify the line of code
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>
to
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll"></asp:Button> and check.
You dont need to give a parenthesis here.
HTH
srini

"Patrick.O.Ige" wrote:
Hi All
i'm getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
'AddressOf' operand must be the name of a method; no parentheses are needed.

I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO

Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

And called ExapndAll in page load
And on my ASP.NET page called it like this:-
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>

Can u telling me what 'm doing wrong!!
Thx

Nov 18 '05 #6
Hi Srini,
I added
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)

But in my Page_load:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll()
End Sub
The Expand() needs some argument!!(Argument not specified for parameter e)
Any ideas
VS.NET marks it as an error
"srini" wrote:
Hi Patrick,
The ExpandAll method shoulf have the same signature as a delegate so the
ExpandAll should be like
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)
HTH
srini
"Patrick.O.Ige" wrote:
Thx srini changed it but now i still get the error:-

Method 'Public Sub ExpandAll()' does not have the same signature as delegate
'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.

Code below:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
' ExpandAll()
End Sub

Public Sub ExpandAll()
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

ASP.NET
---------
<asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
ID="Button1"></asp:Button>

Anu idea what i'm doing wrong!!
Patrick
"srini" wrote:
Hi Patrcik,
Modify the line of code
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>
to
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll"></asp:Button> and check.
You dont need to give a parenthesis here.
HTH
srini

"Patrick.O.Ige" wrote:

> Hi All
> i'm getting error with my TreeView Menu(I want to have a button with
> ExpandALL and CollapseALL):-
> Error:-
> 'AddressOf' operand must be the name of a method; no parentheses are needed.
>
> I use VB.Net and i changed the C# code from:-
> private void ExpandAll()
> {
> for(int i=0; i < yourTree.Nodes.Count; i++)
> {
> yourTree.Nodes[i].Expanded = true;
> }
> }
> TO
>
> Public Sub ExpandAll()
> Dim i As Integer
> For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> tvFamilyTree.Nodes(i).Expanded = True
> Next
> End Sub
>
> And called ExapndAll in page load
> And on my ASP.NET page called it like this:-
> <asp:Button BorderColor=#009966 Runat=server
> OnClick="ExpandAll()"></asp:Button>
>
> Can u telling me what 'm doing wrong!!
> Thx
>

Nov 18 '05 #7
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way.
In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during
postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:
Hi Srini,
I added
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)

But in my Page_load:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll()
End Sub
The Expand() needs some argument!!(Argument not specified for parameter e)
Any ideas
VS.NET marks it as an error
"srini" wrote:
Hi Patrick,
The ExpandAll method shoulf have the same signature as a delegate so the
ExpandAll should be like
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)
HTH
srini
"Patrick.O.Ige" wrote:
Thx srini changed it but now i still get the error:-

Method 'Public Sub ExpandAll()' does not have the same signature as delegate
'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.

Code below:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
' ExpandAll()
End Sub

Public Sub ExpandAll()
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

ASP.NET
---------
<asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
ID="Button1"></asp:Button>

Anu idea what i'm doing wrong!!
Patrick
"srini" wrote:

> Hi Patrcik,
> Modify the line of code
> <asp:Button BorderColor=#009966 Runat=server
> OnClick="ExpandAll()"></asp:Button>
> to
> <asp:Button BorderColor=#009966 Runat=server
> OnClick="ExpandAll"></asp:Button> and check.
> You dont need to give a parenthesis here.
> HTH
> srini
>
> "Patrick.O.Ige" wrote:
>
> > Hi All
> > i'm getting error with my TreeView Menu(I want to have a button with
> > ExpandALL and CollapseALL):-
> > Error:-
> > 'AddressOf' operand must be the name of a method; no parentheses are needed.
> >
> > I use VB.Net and i changed the C# code from:-
> > private void ExpandAll()
> > {
> > for(int i=0; i < yourTree.Nodes.Count; i++)
> > {
> > yourTree.Nodes[i].Expanded = true;
> > }
> > }
> > TO
> >
> > Public Sub ExpandAll()
> > Dim i As Integer
> > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > tvFamilyTree.Nodes(i).Expanded = True
> > Next
> > End Sub
> >
> > And called ExapndAll in page load
> > And on my ASP.NET page called it like this:-
> > <asp:Button BorderColor=#009966 Runat=server
> > OnClick="ExpandAll()"></asp:Button>
> >
> > Can u telling me what 'm doing wrong!!
> > Thx
> >

Nov 18 '05 #8
Thx for the code ...But still doesn't work arg!!!!!!!!
But i forgot to tell u that i'm using the webcontrol TreeView and loading
data from XML file like this TreeNodeSrc=myxml.file".
Should that be able to work by calling ExpandALL because i don't know why it
doesn't work!

"srini" wrote:
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way.
In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during
postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:
Hi Srini,
I added
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)

But in my Page_load:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll()
End Sub
The Expand() needs some argument!!(Argument not specified for parameter e)
Any ideas
VS.NET marks it as an error
"srini" wrote:
Hi Patrick,
The ExpandAll method shoulf have the same signature as a delegate so the
ExpandAll should be like
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)
HTH
srini
"Patrick.O.Ige" wrote:

> Thx srini changed it but now i still get the error:-
>
> Method 'Public Sub ExpandAll()' does not have the same signature as delegate
> 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.
>
> Code below:-
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> ' ExpandAll()
> End Sub
>
> Public Sub ExpandAll()
> For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
> tvFamilyTree.Nodes(i).Expanded = True
> Next
> End Sub
>
> ASP.NET
> ---------
> <asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
> ID="Button1"></asp:Button>
>
> Anu idea what i'm doing wrong!!
> Patrick
>
>
> "srini" wrote:
>
> > Hi Patrcik,
> > Modify the line of code
> > <asp:Button BorderColor=#009966 Runat=server
> > OnClick="ExpandAll()"></asp:Button>
> > to
> > <asp:Button BorderColor=#009966 Runat=server
> > OnClick="ExpandAll"></asp:Button> and check.
> > You dont need to give a parenthesis here.
> > HTH
> > srini
> >
> > "Patrick.O.Ige" wrote:
> >
> > > Hi All
> > > i'm getting error with my TreeView Menu(I want to have a button with
> > > ExpandALL and CollapseALL):-
> > > Error:-
> > > 'AddressOf' operand must be the name of a method; no parentheses are needed.
> > >
> > > I use VB.Net and i changed the C# code from:-
> > > private void ExpandAll()
> > > {
> > > for(int i=0; i < yourTree.Nodes.Count; i++)
> > > {
> > > yourTree.Nodes[i].Expanded = true;
> > > }
> > > }
> > > TO
> > >
> > > Public Sub ExpandAll()
> > > Dim i As Integer
> > > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > > tvFamilyTree.Nodes(i).Expanded = True
> > > Next
> > > End Sub
> > >
> > > And called ExapndAll in page load
> > > And on my ASP.NET page called it like this:-
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll()"></asp:Button>
> > >
> > > Can u telling me what 'm doing wrong!!
> > > Thx
> > >

Nov 18 '05 #9
whats the error you are getting. did you place the code in the Page_Init
method. If there is any exception you are getting please paste it.
the best
srini

"Patrick.O.Ige" wrote:
Thx for the code ...But still doesn't work arg!!!!!!!!
But i forgot to tell u that i'm using the webcontrol TreeView and loading
data from XML file like this TreeNodeSrc=myxml.file".
Should that be able to work by calling ExpandALL because i don't know why it
doesn't work!

"srini" wrote:
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way.
In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during
postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:
Hi Srini,
I added
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)

But in my Page_load:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll()
End Sub
The Expand() needs some argument!!(Argument not specified for parameter e)
Any ideas
VS.NET marks it as an error
"srini" wrote:

> Hi Patrick,
> The ExpandAll method shoulf have the same signature as a delegate so the
> ExpandAll should be like
> Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)
> HTH
> srini
> "Patrick.O.Ige" wrote:
>
> > Thx srini changed it but now i still get the error:-
> >
> > Method 'Public Sub ExpandAll()' does not have the same signature as delegate
> > 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.
> >
> > Code below:-
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > ' ExpandAll()
> > End Sub
> >
> > Public Sub ExpandAll()
> > For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
> > tvFamilyTree.Nodes(i).Expanded = True
> > Next
> > End Sub
> >
> > ASP.NET
> > ---------
> > <asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
> > ID="Button1"></asp:Button>
> >
> > Anu idea what i'm doing wrong!!
> > Patrick
> >
> >
> > "srini" wrote:
> >
> > > Hi Patrcik,
> > > Modify the line of code
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll()"></asp:Button>
> > > to
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll"></asp:Button> and check.
> > > You dont need to give a parenthesis here.
> > > HTH
> > > srini
> > >
> > > "Patrick.O.Ige" wrote:
> > >
> > > > Hi All
> > > > i'm getting error with my TreeView Menu(I want to have a button with
> > > > ExpandALL and CollapseALL):-
> > > > Error:-
> > > > 'AddressOf' operand must be the name of a method; no parentheses are needed.
> > > >
> > > > I use VB.Net and i changed the C# code from:-
> > > > private void ExpandAll()
> > > > {
> > > > for(int i=0; i < yourTree.Nodes.Count; i++)
> > > > {
> > > > yourTree.Nodes[i].Expanded = true;
> > > > }
> > > > }
> > > > TO
> > > >
> > > > Public Sub ExpandAll()
> > > > Dim i As Integer
> > > > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > > > tvFamilyTree.Nodes(i).Expanded = True
> > > > Next
> > > > End Sub
> > > >
> > > > And called ExapndAll in page load
> > > > And on my ASP.NET page called it like this:-
> > > > <asp:Button BorderColor=#009966 Runat=server
> > > > OnClick="ExpandAll()"></asp:Button>
> > > >
> > > > Can u telling me what 'm doing wrong!!
> > > > Thx
> > > >

Nov 18 '05 #10
Hi,

Why all this overhead - attaching to the Init event, attaching another
method to the Load event? He'd better call it directly from Page_Load:

Private Sub Page_Load(sender As Object, e As EventArgs) _
Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll(Nothing, EventArgs.Empty)
End Sub

Hope this helps
Martin Dechev
ASP.NET MVP
"srini" <sr***@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way.
In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during
postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:
Hi Srini,
I added
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)
But in my Page_load:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll()
End Sub
The Expand() needs some argument!!(Argument not specified for parameter e) Any ideas
VS.NET marks it as an error
"srini" wrote:
Hi Patrick,
The ExpandAll method shoulf have the same signature as a delegate so the ExpandAll should be like
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs) HTH
srini
"Patrick.O.Ige" wrote:

> Thx srini changed it but now i still get the error:-
>
> Method 'Public Sub ExpandAll()' does not have the same signature as delegate > 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'. >
> Code below:-
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> ' ExpandAll()
> End Sub
>
> Public Sub ExpandAll()
> For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
> tvFamilyTree.Nodes(i).Expanded = True
> Next
> End Sub
>
> ASP.NET
> ---------
> <asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
> ID="Button1"></asp:Button>
>
> Anu idea what i'm doing wrong!!
> Patrick
>
>
> "srini" wrote:
>
> > Hi Patrcik,
> > Modify the line of code
> > <asp:Button BorderColor=#009966 Runat=server
> > OnClick="ExpandAll()"></asp:Button>
> > to
> > <asp:Button BorderColor=#009966 Runat=server
> > OnClick="ExpandAll"></asp:Button> and check.
> > You dont need to give a parenthesis here.
> > HTH
> > srini
> >
> > "Patrick.O.Ige" wrote:
> >
> > > Hi All
> > > i'm getting error with my TreeView Menu(I want to have a button with > > > ExpandALL and CollapseALL):-
> > > Error:-
> > > 'AddressOf' operand must be the name of a method; no parentheses are needed. > > >
> > > I use VB.Net and i changed the C# code from:-
> > > private void ExpandAll()
> > > {
> > > for(int i=0; i < yourTree.Nodes.Count; i++)
> > > {
> > > yourTree.Nodes[i].Expanded = true;
> > > }
> > > }
> > > TO
> > >
> > > Public Sub ExpandAll()
> > > Dim i As Integer
> > > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > > tvFamilyTree.Nodes(i).Expanded = True
> > > Next
> > > End Sub
> > >
> > > And called ExapndAll in page load
> > > And on my ASP.NET page called it like this:-
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll()"></asp:Button>
> > >
> > > Can u telling me what 'm doing wrong!!
> > > Thx
> > >

Nov 18 '05 #11
Hi Martin,
Thanks for the inputs.
If you see the last line of my message i asked not to call the ExpandAll in
the page load again. But its a really valid point. We can call
ExpandAll(nothing, eventargs.empty).
Thanks again
srini

"Martin Dechev" wrote:
Hi,

Why all this overhead - attaching to the Init event, attaching another
method to the Load event? He'd better call it directly from Page_Load:

Private Sub Page_Load(sender As Object, e As EventArgs) _
Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll(Nothing, EventArgs.Empty)
End Sub

Hope this helps
Martin Dechev
ASP.NET MVP
"srini" <sr***@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way.
In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during
postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:
Hi Srini,
I added
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)
But in my Page_load:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll()
End Sub
The Expand() needs some argument!!(Argument not specified for parameter e) Any ideas
VS.NET marks it as an error
"srini" wrote:

> Hi Patrick,
> The ExpandAll method shoulf have the same signature as a delegate so the > ExpandAll should be like
> Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs) > HTH
> srini
> "Patrick.O.Ige" wrote:
>
> > Thx srini changed it but now i still get the error:-
> >
> > Method 'Public Sub ExpandAll()' does not have the same signature as delegate > > 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'. > >
> > Code below:-
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > ' ExpandAll()
> > End Sub
> >
> > Public Sub ExpandAll()
> > For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
> > tvFamilyTree.Nodes(i).Expanded = True
> > Next
> > End Sub
> >
> > ASP.NET
> > ---------
> > <asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
> > ID="Button1"></asp:Button>
> >
> > Anu idea what i'm doing wrong!!
> > Patrick
> >
> >
> > "srini" wrote:
> >
> > > Hi Patrcik,
> > > Modify the line of code
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll()"></asp:Button>
> > > to
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll"></asp:Button> and check.
> > > You dont need to give a parenthesis here.
> > > HTH
> > > srini
> > >
> > > "Patrick.O.Ige" wrote:
> > >
> > > > Hi All
> > > > i'm getting error with my TreeView Menu(I want to have a button with > > > > ExpandALL and CollapseALL):-
> > > > Error:-
> > > > 'AddressOf' operand must be the name of a method; no parentheses are needed. > > > >
> > > > I use VB.Net and i changed the C# code from:-
> > > > private void ExpandAll()
> > > > {
> > > > for(int i=0; i < yourTree.Nodes.Count; i++)
> > > > {
> > > > yourTree.Nodes[i].Expanded = true;
> > > > }
> > > > }
> > > > TO
> > > >
> > > > Public Sub ExpandAll()
> > > > Dim i As Integer
> > > > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > > > tvFamilyTree.Nodes(i).Expanded = True
> > > > Next
> > > > End Sub
> > > >
> > > > And called ExapndAll in page load
> > > > And on my ASP.NET page called it like this:-
> > > > <asp:Button BorderColor=#009966 Runat=server
> > > > OnClick="ExpandAll()"></asp:Button>
> > > >
> > > > Can u telling me what 'm doing wrong!!
> > > > Thx
> > > >


Nov 18 '05 #12
Hi Martin,
Thx for the code!
I'll try that tommorow and let u know!
cheers!
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:eH**************@TK2MSFTNGP11.phx.gbl...
Hi,

Why all this overhead - attaching to the Init event, attaching another
method to the Load event? He'd better call it directly from Page_Load:

Private Sub Page_Load(sender As Object, e As EventArgs) _
Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll(Nothing, EventArgs.Empty)
End Sub

Hope this helps
Martin Dechev
ASP.NET MVP
"srini" <sr***@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way.
In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during
postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:
Hi Srini,
I added
Public Sub ExpandAll(Byval sender As Object, Byval e As
System.EventArgs)
But in my Page_load:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll()
End Sub
The Expand() needs some argument!!(Argument not specified for
parameter e) Any ideas
VS.NET marks it as an error
"srini" wrote:

> Hi Patrick,
> The ExpandAll method shoulf have the same signature as a delegate so the > ExpandAll should be like
> Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs) > HTH
> srini
> "Patrick.O.Ige" wrote:
>
> > Thx srini changed it but now i still get the error:-
> >
> > Method 'Public Sub ExpandAll()' does not have the same signature
as
delegate > > 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'. > >
> > Code below:-
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > ' ExpandAll()
> > End Sub
> >
> > Public Sub ExpandAll()
> > For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
> > tvFamilyTree.Nodes(i).Expanded = True
> > Next
> > End Sub
> >
> > ASP.NET
> > ---------
> > <asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
> > ID="Button1"></asp:Button>
> >
> > Anu idea what i'm doing wrong!!
> > Patrick
> >
> >
> > "srini" wrote:
> >
> > > Hi Patrcik,
> > > Modify the line of code
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll()"></asp:Button>
> > > to
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll"></asp:Button> and check.
> > > You dont need to give a parenthesis here.
> > > HTH
> > > srini
> > >
> > > "Patrick.O.Ige" wrote:
> > >
> > > > Hi All
> > > > i'm getting error with my TreeView Menu(I want to have a
button
with > > > > ExpandALL and CollapseALL):-
> > > > Error:-
> > > > 'AddressOf' operand must be the name of a method; no
parentheses
are needed. > > > >
> > > > I use VB.Net and i changed the C# code from:-
> > > > private void ExpandAll()
> > > > {
> > > > for(int i=0; i < yourTree.Nodes.Count; i++)
> > > > {
> > > > yourTree.Nodes[i].Expanded = true;
> > > > }
> > > > }
> > > > TO
> > > >
> > > > Public Sub ExpandAll()
> > > > Dim i As Integer
> > > > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > > > tvFamilyTree.Nodes(i).Expanded = True
> > > > Next
> > > > End Sub
> > > >
> > > > And called ExapndAll in page load
> > > > And on my ASP.NET page called it like this:-
> > > > <asp:Button BorderColor=#009966 Runat=server
> > > > OnClick="ExpandAll()"></asp:Button>
> > > >
> > > > Can u telling me what 'm doing wrong!!
> > > > Thx
> > > >


Nov 18 '05 #13
Thx srini,
I'll try Martins idea and let u guys know!
Cheers

"srini" <sr***@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
Hi Martin,
Thanks for the inputs.
If you see the last line of my message i asked not to call the ExpandAll in the page load again. But its a really valid point. We can call
ExpandAll(nothing, eventargs.empty).
Thanks again
srini

"Martin Dechev" wrote:
Hi,

Why all this overhead - attaching to the Init event, attaching another
method to the Load event? He'd better call it directly from Page_Load:

Private Sub Page_Load(sender As Object, e As EventArgs) _
Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll(Nothing, EventArgs.Empty)
End Sub

Hope this helps
Martin Dechev
ASP.NET MVP
"srini" <sr***@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way. In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:

> Hi Srini,
> I added
> Public Sub ExpandAll(Byval sender As Object, Byval e As

System.EventArgs)
>
> But in my Page_load:-
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> ExpandAll()
> End Sub
> The Expand() needs some argument!!(Argument not specified for
parameter e)
> Any ideas
> VS.NET marks it as an error
>
>
> "srini" wrote:
>
> > Hi Patrick,
> > The ExpandAll method shoulf have the same signature as a delegate
so the
> > ExpandAll should be like
> > Public Sub ExpandAll(Byval sender As Object, Byval e As

System.EventArgs)
> > HTH
> > srini
> > "Patrick.O.Ige" wrote:
> >
> > > Thx srini changed it but now i still get the error:-
> > >
> > > Method 'Public Sub ExpandAll()' does not have the same signature
as delegate
> > > 'Delegate Sub EventHandler(sender As Object, e As

System.EventArgs)'.
> > >
> > > Code below:-
> > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > > System.EventArgs) Handles MyBase.Load
> > > 'Put user code to initialize the page here
> > > ' ExpandAll()
> > > End Sub
> > >
> > > Public Sub ExpandAll()
> > > For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
> > > tvFamilyTree.Nodes(i).Expanded = True
> > > Next
> > > End Sub
> > >
> > > ASP.NET
> > > ---------
> > > <asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
> > > ID="Button1"></asp:Button>
> > >
> > > Anu idea what i'm doing wrong!!
> > > Patrick
> > >
> > >
> > > "srini" wrote:
> > >
> > > > Hi Patrcik,
> > > > Modify the line of code
> > > > <asp:Button BorderColor=#009966 Runat=server
> > > > OnClick="ExpandAll()"></asp:Button>
> > > > to
> > > > <asp:Button BorderColor=#009966 Runat=server
> > > > OnClick="ExpandAll"></asp:Button> and check.
> > > > You dont need to give a parenthesis here.
> > > > HTH
> > > > srini
> > > >
> > > > "Patrick.O.Ige" wrote:
> > > >
> > > > > Hi All
> > > > > i'm getting error with my TreeView Menu(I want to have a
button with
> > > > > ExpandALL and CollapseALL):-
> > > > > Error:-
> > > > > 'AddressOf' operand must be the name of a method; no
parentheses are needed.
> > > > >
> > > > > I use VB.Net and i changed the C# code from:-
> > > > > private void ExpandAll()
> > > > > {
> > > > > for(int i=0; i < yourTree.Nodes.Count; i++)
> > > > > {
> > > > > yourTree.Nodes[i].Expanded = true;
> > > > > }
> > > > > }
> > > > > TO
> > > > >
> > > > > Public Sub ExpandAll()
> > > > > Dim i As Integer
> > > > > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > > > > tvFamilyTree.Nodes(i).Expanded = True
> > > > > Next
> > > > > End Sub
> > > > >
> > > > > And called ExapndAll in page load
> > > > > And on my ASP.NET page called it like this:-
> > > > > <asp:Button BorderColor=#009966 Runat=server
> > > > > OnClick="ExpandAll()"></asp:Button>
> > > > >
> > > > > Can u telling me what 'm doing wrong!!
> > > > > Thx
> > > > >


Nov 18 '05 #14
Hi Martin,
After doing ExpandAll(Nothing, EventArgs.Empty)
No error but it doesn't work i mean the event doesn't fire arggg!!!
I have done everything i have included all the code to scan trough below!
Thx

My code below:-
Public Sub ExpandAll(ByVal sender As Object, ByVal e As System.EventArgs)
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll(Nothing, EventArgs.Empty)
End Sub
In ASp.NET
-------------
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll"></asp:Button>

My TreeView:-
-----------------
<IE:TREEVIEW id="tvFamilyTree" runat="server"
SystemImagesPath="/webctrl_client/1_0/images/"
SHOWLINES="true" SHOWTOOLTIP="true"
DefaultStyle="font-family:arial;font-size:11px;color:#004080;border: solid
0px #004080; margin: 0px; background: #ffffff; white-space:
nowrap;cursor:default;"
HoverStyle="font-family:arial;font-weight:bold;font-size:11px;color:red;text-decoration:underline
red; margin: 0px; background:#ffffff; white-space: nowrap;
cursor:pointer;cursor:hand;"
BorderStyle="0" Showplus="true" Indent="5" ExpandedImageUrl="smallest.gif"
SelectExpands="true">

<ie:TreeNode TreeNodeSrc="MyXmlfile.xml" Text="<font size='4'>Call
Center</font>" Expanded="True" ID="Treenode1"
NavigateUrl="default.aspx"></ie:TreeNode>

</IE:TREEVIEW>


"Martin Dechev" wrote:
Hi,

Why all this overhead - attaching to the Init event, attaching another
method to the Load event? He'd better call it directly from Page_Load:

Private Sub Page_Load(sender As Object, e As EventArgs) _
Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll(Nothing, EventArgs.Empty)
End Sub

Hope this helps
Martin Dechev
ASP.NET MVP
"srini" <sr***@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way.
In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during
postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:
Hi Srini,
I added
Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs)
But in my Page_load:-
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll()
End Sub
The Expand() needs some argument!!(Argument not specified for parameter e) Any ideas
VS.NET marks it as an error
"srini" wrote:

> Hi Patrick,
> The ExpandAll method shoulf have the same signature as a delegate so the > ExpandAll should be like
> Public Sub ExpandAll(Byval sender As Object, Byval e As System.EventArgs) > HTH
> srini
> "Patrick.O.Ige" wrote:
>
> > Thx srini changed it but now i still get the error:-
> >
> > Method 'Public Sub ExpandAll()' does not have the same signature as delegate > > 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'. > >
> > Code below:-
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> > 'Put user code to initialize the page here
> > ' ExpandAll()
> > End Sub
> >
> > Public Sub ExpandAll()
> > For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
> > tvFamilyTree.Nodes(i).Expanded = True
> > Next
> > End Sub
> >
> > ASP.NET
> > ---------
> > <asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
> > ID="Button1"></asp:Button>
> >
> > Anu idea what i'm doing wrong!!
> > Patrick
> >
> >
> > "srini" wrote:
> >
> > > Hi Patrcik,
> > > Modify the line of code
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll()"></asp:Button>
> > > to
> > > <asp:Button BorderColor=#009966 Runat=server
> > > OnClick="ExpandAll"></asp:Button> and check.
> > > You dont need to give a parenthesis here.
> > > HTH
> > > srini
> > >
> > > "Patrick.O.Ige" wrote:
> > >
> > > > Hi All
> > > > i'm getting error with my TreeView Menu(I want to have a button with > > > > ExpandALL and CollapseALL):-
> > > > Error:-
> > > > 'AddressOf' operand must be the name of a method; no parentheses are needed. > > > >
> > > > I use VB.Net and i changed the C# code from:-
> > > > private void ExpandAll()
> > > > {
> > > > for(int i=0; i < yourTree.Nodes.Count; i++)
> > > > {
> > > > yourTree.Nodes[i].Expanded = true;
> > > > }
> > > > }
> > > > TO
> > > >
> > > > Public Sub ExpandAll()
> > > > Dim i As Integer
> > > > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > > > tvFamilyTree.Nodes(i).Expanded = True
> > > > Next
> > > > End Sub
> > > >
> > > > And called ExapndAll in page load
> > > > And on my ASP.NET page called it like this:-
> > > > <asp:Button BorderColor=#009966 Runat=server
> > > > OnClick="ExpandAll()"></asp:Button>
> > > >
> > > > Can u telling me what 'm doing wrong!!
> > > > Thx
> > > >


Nov 18 '05 #15
Hi srini,
After doing ExpandAll(Nothing, EventArgs.Empty)
No error but it doesn't work i mean the event doesn't fire arggg!!!
I have done everything i have included all the code to scan trough below!
Thx

My code below:-
Public Sub ExpandAll(ByVal sender As Object, ByVal e As System.EventArgs)
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll(Nothing, EventArgs.Empty)
End Sub
In ASp.NET
-------------
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll"></asp:Button>

My TreeView:-
-----------------
<IE:TREEVIEW id="tvFamilyTree" runat="server"
SystemImagesPath="/webctrl_client/1_0/images/"
SHOWLINES="true" SHOWTOOLTIP="true"
DefaultStyle="font-family:arial;font-size:11px;color:#004080;border: solid
0px #004080; margin: 0px; background: #ffffff; white-space:
nowrap;cursor:default;"
HoverStyle="font-family:arial;font-weight:bold;font-size:11px;color:red;text-decoration:underline
red; margin: 0px; background:#ffffff; white-space: nowrap;
cursor:pointer;cursor:hand;"
BorderStyle="0" Showplus="true" Indent="5" ExpandedImageUrl="smallest.gif"
SelectExpands="true">

<ie:TreeNode TreeNodeSrc="MyXmlfile.xml" Text="<font size='4'>Call
Center</font>" Expanded="True" ID="Treenode1"
NavigateUrl="default.aspx"></ie:TreeNode>

</IE:TREEVIEW>
"srini" wrote:
Hi Martin,
Thanks for the inputs.
If you see the last line of my message i asked not to call the ExpandAll in
the page load again. But its a really valid point. We can call
ExpandAll(nothing, eventargs.empty).
Thanks again
srini

"Martin Dechev" wrote:
Hi,

Why all this overhead - attaching to the Init event, attaching another
method to the Load event? He'd better call it directly from Page_Load:

Private Sub Page_Load(sender As Object, e As EventArgs) _
Handles MyBase.Load
'Put user code to initialize the page here
ExpandAll(Nothing, EventArgs.Empty)
End Sub

Hope this helps
Martin Dechev
ASP.NET MVP
"srini" <sr***@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
Hi Patrick,
I am not sure if this is the best way to do it but you can do it this way.
In the Page_Init method keep the following code
If Not Page.IsPostBack Then ''If you dont want to call the method during
postbacks
AddHandler Me.Load, AddressOf ExpandAll
End If
Now you dont need to call the ExpandAll on the page Load.
HTH
srini

"Patrick.O.Ige" wrote:

> Hi Srini,
> I added
> Public Sub ExpandAll(Byval sender As Object, Byval e As

System.EventArgs)
>
> But in my Page_load:-
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> ExpandAll()
> End Sub
> The Expand() needs some argument!!(Argument not specified for parameter

e)
> Any ideas
> VS.NET marks it as an error
>
>
> "srini" wrote:
>
> > Hi Patrick,
> > The ExpandAll method shoulf have the same signature as a delegate so

the
> > ExpandAll should be like
> > Public Sub ExpandAll(Byval sender As Object, Byval e As

System.EventArgs)
> > HTH
> > srini
> > "Patrick.O.Ige" wrote:
> >
> > > Thx srini changed it but now i still get the error:-
> > >
> > > Method 'Public Sub ExpandAll()' does not have the same signature as

delegate
> > > 'Delegate Sub EventHandler(sender As Object, e As

System.EventArgs)'.
> > >
> > > Code below:-
> > > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > > System.EventArgs) Handles MyBase.Load
> > > 'Put user code to initialize the page here
> > > ' ExpandAll()
> > > End Sub
> > >
> > > Public Sub ExpandAll()
> > > For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
> > > tvFamilyTree.Nodes(i).Expanded = True
> > > Next
> > > End Sub
> > >
> > > ASP.NET
> > > ---------
> > > <asp:Button BorderColor=#009966 Runat=server OnClick="ExpandAll"
> > > ID="Button1"></asp:Button>
> > >
> > > Anu idea what i'm doing wrong!!
> > > Patrick
> > >
> > >
> > > "srini" wrote:
> > >
> > > > Hi Patrcik,
> > > > Modify the line of code
> > > > <asp:Button BorderColor=#009966 Runat=server
> > > > OnClick="ExpandAll()"></asp:Button>
> > > > to
> > > > <asp:Button BorderColor=#009966 Runat=server
> > > > OnClick="ExpandAll"></asp:Button> and check.
> > > > You dont need to give a parenthesis here.
> > > > HTH
> > > > srini
> > > >
> > > > "Patrick.O.Ige" wrote:
> > > >
> > > > > Hi All
> > > > > i'm getting error with my TreeView Menu(I want to have a button

with
> > > > > ExpandALL and CollapseALL):-
> > > > > Error:-
> > > > > 'AddressOf' operand must be the name of a method; no parentheses

are needed.
> > > > >
> > > > > I use VB.Net and i changed the C# code from:-
> > > > > private void ExpandAll()
> > > > > {
> > > > > for(int i=0; i < yourTree.Nodes.Count; i++)
> > > > > {
> > > > > yourTree.Nodes[i].Expanded = true;
> > > > > }
> > > > > }
> > > > > TO
> > > > >
> > > > > Public Sub ExpandAll()
> > > > > Dim i As Integer
> > > > > For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
> > > > > tvFamilyTree.Nodes(i).Expanded = True
> > > > > Next
> > > > > End Sub
> > > > >
> > > > > And called ExapndAll in page load
> > > > > And on my ASP.NET page called it like this:-
> > > > > <asp:Button BorderColor=#009966 Runat=server
> > > > > OnClick="ExpandAll()"></asp:Button>
> > > > >
> > > > > Can u telling me what 'm doing wrong!!
> > > > > Thx
> > > > >


Nov 18 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ronaldo N | last post by:
I'm trying to do some javascript form validation and I've discovered a rather difficult situation to handle with IE. Let's say there's a form with three input fields named "name", "method", or...
1
by: Vijay | last post by:
Hi, I do have the VB.NET method which has delegate as parameter. I am calling this method from VB.NET project by using the commnad "Addressof( Function name which has same signature)". How can i...
10
by: Dan Nash | last post by:
Hi peeps.. Im using the TreeView control from IE COntrols to create a directory structure, and trying to do it recursively. The code works, but my question is simply how can I make the subdirs...
10
by: Rico Rivera | last post by:
I want to call a method dynamically based on a string For example When s = "A" Then method A would get called. I don't wan't to use a bunch of "If" statements. Something like: ...
2
by: Don | last post by:
This may seem like an odd question, but is it possible to get the name of the class & function that is calling a function of another class? e.g. Public Class CallerName Public Shared Function...
2
by: Brett | last post by:
I'm creating a second thread from my main form like this: Public t As System.Threading.Thread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf _...
25
by: paytam | last post by:
hi all I want to redefine a function getchar() in header stdio.h ,but I don't know what should I do.
4
by: kaczmar2 | last post by:
I have a custom web control that is called from an aspx page. The custom control dynamically renders out buttons via a public method (AddButton). One of the attributes of the method is a...
21
by: John Henry | last post by:
Hi list, I have a need to create class methods on the fly. For example, if I do: class Dummy: def __init__(self): exec '''def method_dynamic(self):\n\treturn self.method_static("it's...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.