error using Treeview bindingcontext with a dataview

  • Thread starter Thread starter csadlier
  • Start date Start date
C

csadlier

Hi All,
I am trying to use the treeview binding sample for C# and every time
the program hits the line :
this.m_currencyManager = (CurrencyManager) this.BindingContext[value];

this.m_currencyManager is undefined.
this.BindingContext is undefined
value=a dataview sent from a windows form application to a
webservice.
this = a treeview inherited usercontrol.

It blows up with this error:
A first chance exception of type 'System.NullReferenceException'
occurred in webservice.dll

Additional information: Object reference not set to an instance of
an object.


Has anyone had this problem? I'm beginning to think Binding context is
not too useful, especially with treeview controls, from the listings I
have seen.
Thanks,
Carl
 
There's no m_currencyManager in TreeView control. If you added it, it's up
to you to handle it.
You can not pass DataView via WS, it only works if you have DataTable with
data in it.
'webservice.dll' is not a part of CF. If it throws, you should debug it to
figure out what's going on.

Also, it's not clear to me how you could use indexer on BindingContext if
"this.BindingContext is undefined"?
Please elaborate and/or post some code.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: (e-mail address removed)
Newsgroups: microsoft.public.dotnet.framework.compactframework
Subject: error using Treeview bindingcontext with a dataview
Date: 24 Mar 2005 05:01:10 -0800
Organization: http://groups.google.com
Lines: 25
Message-ID: <[email protected]>
NNTP-Posting-Host: 216.141.161.228
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1111669274 18147 127.0.0.1 (24 Mar 2005 13:01:14 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Thu, 24 Mar 2005 13:01:14 +0000 (UTC)
User-Agent: G2/0.2
Complaints-To: (e-mail address removed)
Injection-Info: l41g2000cwc.googlegroups.com; posting-host=216.141.161.228;
posting-account=EgBi2Q0AAAAy5IsHP9E1837Wmu9U8sd3
Path:
TK2MSFTNGXA03.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!l4
1g2000cwc.googlegroups.com!not-for-mail
Xref: TK2MSFTNGXA03.phx.gbl microsoft.public.dotnet.framework.compactframework:73926
X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework

Hi All,
I am trying to use the treeview binding sample for C# and every time
the program hits the line :
this.m_currencyManager = (CurrencyManager) this.BindingContext[value];

this.m_currencyManager is undefined.
this.BindingContext is undefined
value=a dataview sent from a windows form application to a
webservice.
this = a treeview inherited usercontrol.

It blows up with this error:
A first chance exception of type 'System.NullReferenceException'
occurred in webservice.dll

Additional information: Object reference not set to an instance of
an object.


Has anyone had this problem? I'm beginning to think Binding context is
not too useful, especially with treeview controls, from the listings I
have seen.
Thanks,
Carl
 
Back
Top