|
-
Jan 15th, 2008, 07:07 AM
#1
Thread Starter
Frenzied Member
-
Jan 16th, 2008, 02:02 PM
#2
Thread Starter
Frenzied Member
-
Jan 16th, 2008, 02:56 PM
#3
Re: Populate TreeView Again Without Reloading
First of all, please don't bump your threads.
I'm a little confused. You say you have a button that hides/unhides the treeview. Why does the unique key requirement have anything to do with that?
-
Jan 16th, 2008, 05:39 PM
#4
Thread Starter
Frenzied Member
-
Jan 16th, 2008, 07:23 PM
#5
Re: Populate TreeView Again Without Reloading
 Originally Posted by arpan_de
...A user clicks the button; the history TreeView becomes visible & the TreeView is populated with the URLs. He again clicks the button which hides the TreeView. Again he clicks the button to make the TreeView visible. Here I populate the TreeView again with the dates as the parent node & the URLs as the child nodes....
How about this instead.
...A user clicks the button; the history TreeView becomes visible & if the bFirstTime boolean is True then the TreeView is populated with the URLs and the bFirstTime boolean is set to False. He again clicks the button which hides the TreeView. Again he clicks the button to make the TreeView visible. Here I populate the TreeView again with the dates as the parent node & the URLs as the child nodes only if the bFirstTime boolean is True....
-
Jan 16th, 2008, 10:48 PM
#6
Thread Starter
Frenzied Member
-
Jan 16th, 2008, 10:50 PM
#7
Re: Populate TreeView Again Without Reloading
Usually a bad idea since it can hide errors that you want to know about. What's wrong with a simple boolean?
-
Jan 16th, 2008, 11:04 PM
#8
Thread Starter
Frenzied Member
Re: Populate TreeView Again Without Reloading
OK....this is what I finally did:
Code:
Dim blnFirstTime As Boolean
Private Sub cmdHistory_Click()
If (blnFirstTime = False) Then
blnFirstTime = True
Else
blnFirstTime = False
End If
If (TreeView1.Visible = False) Then
TreeView1.Visible = True
'populate the TreeView
Else
TreeView1.Visible = False
blnFirstTime = True
End If
End Sub
ARPAN
IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!
NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!
PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?
-
Jan 17th, 2008, 12:51 PM
#9
Re: Populate TreeView Again Without Reloading
If that's the way you actually implemented my suggestion and assuming that you actually have code where you now just show the "populate the TreeView" comment, I don't see how it helps you since every time the treeview becomes visible you (re)populate the treeview. Don't your really want to do this instead?
Code:
Option Explicit
Dim blnFirstTime As Boolean
Private Sub Form_Load()
blnFirstTime = True
End Sub
Private Sub cmdHistory_Click()
TreeView1.Visible = Not TreeView1.Visible
If blnFirstTime Then
'populate the TreeView
blnFirstTime = False
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|