473,767 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Treeview Refresh - Strange Behavior

Hello all,

I am populating my treeview with only 1 level of items. Upon opening my
screen, I call the RefreshTreeview routine which populates the treeview just
fine, and I am able to click on nodes in the treeview and populate the
appropriate data accordingly. However, once I add a new record via this
screen and call the same RefreshTreeview routine (which successfully
populates the treeview with the appropriate items including the new one just
added) - the treeview gives me an error upon clicking any node: "Object
reference not set to an instance of an object.", when I am attempting to grab
the tvwROS.Selected Node.Text (just as I did before upon opening of the screen
which did not error)...

This is stumping me... please help!!! :)
-Valerie

Routine is below:
Private Sub RefreshTreeview ()

Dim sSQL As String
Dim rsRecordset As ADODB.Recordset
Dim iIndex As Integer
Dim sROSSystem As String
Dim lROSID As Long

'Clear Treeview
tvwROS.Nodes.Cl ear()
iIndex = -1

sSQL = "SELECT ROSID, ROSSystemDS FROM vwROS WHERE VisitID = " &
glVisitID
rsRecordset = gdcDataConnecti on.Execute(sSQL )

With rsRecordset
If Not (.BOF And .EOF) Then
While Not .EOF
iIndex = iIndex + 1
sROSSystem = rsRecordset("RO SSystemDS").Val ue
lROSID = rsRecordset("RO SID").Value
tvwROS.Nodes.Ad d(sROSSystem)
tvwROS.Nodes.It em(iIndex).Tag = lROSID
.MoveNext()
End While
.Close()
End If
End With

mbIsDirty = False
btnSave.Enabled = False

End Sub
Nov 21 '05 #1
0 3133

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

Similar topics

0
1124
by: Dan | last post by:
Hi, We are currently experiencing a pretty strange behavior with TreeView control that comes with IE webcontrols. Actually when used on OS other than XP, everything works fine but when it is use on XP, the line that links a child node to his parent is not drawing and after that happens, the whole web application seems to be "freezed". Also, this problem does not happen on all XP machine. So there must be a fix or something that...
6
20067
by: Brian Smith | last post by:
Is there a way to avoid the default action of TreeNode expansion/contraction caused by double click? I can add an event handler to pop up my properties dialog on double click, but it has the unintended side-effect of toggling the expansion of that subtree. Thanks in advance, Brian
8
4409
by: Hrvoje Voda | last post by:
What is wrong in this code? private void tree_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if (e.KeyCode == Keys.Enter ) {
4
1871
by: solex | last post by:
Hello, I am in the process of converting a project from VB6 to DotNet and have noticed that some strange behavior with the TreeView Control (1) when setting the NodeFont property to Bold I cannot see the complete text. (2) when selecting a child node that has a different icon from its parent, it takes on the parents' icon.
1
2446
by: Larax | last post by:
Alright, so here's the problem. I define a global variable in my script and then add methods/properties to it. Everything works great, no error in Javascript Console. But when I refresh site, several errors "variable is not defined" are displayed. What is more strange, the script is still working ! After each another refresh these errors are keep showing, only after I close site and open it again, these errors disappear, but only to next...
0
1485
by: Christof Nordiek | last post by:
Hi, Below is a simple program that demonstrates my poblem. i fill a treeview with nine nodes. Then the treeview is shown with a scrollbar. But I can't scroll to the last item. scrolling to the bottom the last item remains almost nvisable. What is the matter? using System; using System.Collections.Generic;
0
3415
by: drop | last post by:
Hi, I am using a Treeview and I'd like to know what is the best way to refresh the children of a specific node in the treeview. I already do that using full postback, but this sends back the entire tree and it's very slow. Basically, I'd like to be able to redo a client side callback PopulateOnDemand that would reload the childrens of a node. That way, I would reduce the overhead since I would refresh only the part of the tree I need...
2
2913
by: =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post by:
Hi I have a web page that has a TreeView on it. If I DONT'T expand the TreeView nodes, the auto refresh works nicely: my page gets refreshed every minute. As soon as I expand a node on the TreeView, the page stops auto-refreshing. Any ideas why this is happening? I have acheived auto refresh using the following:
5
2038
by: Peter Duniho | last post by:
On Sat, 27 Sep 2008 12:02:04 -0700, <timor.super@gmail.comwrote: You don't, not when you don't know that one event is necessarily going to follow another. If the events can appear alone, then you can't make them depend on each other. You don't describe what this "thing" you are doing is. But it's bad design to have some "thing" you do in response to user input like this be something that can't be done repeatedly. For example, any...
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10009
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9838
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8835
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.