CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.internet_explorer_web_controls Tags:
Item Type: NewsGroup Date Entered: 3/19/2004 2:14:36 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 24 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
zarkikunet
Asp.Net User
Caching Treeview3/19/2004 2:14:36 PM

0

Hi,

I would like to cache a relatively complex treeview with checkboxes to reuse at will a modified configuration (or there is any other method to achive this in a simple way?). The treeview is generated from a database that for practical reasons should not be modified.
When I am trying to restore the control from the cache, it doesn't show in the page. According to the debugger, after generating the tree, the cache and the control seems identical.
I am using the following code (without DB stuff...):

Protected WithEvents tvFilters As Microsoft.Web.UI.WebControls.TreeView
....
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
....
If Cache("treeview") Is Nothing Then
GenerateTreeView()
Else
tvFilters = Cache("treeview")
End If
....
End Sub


Private Sub GenerateTreeView()

....
Dim ds As DataSet = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings("connAtum"), CommandType.StoredProcedure, "up_IRT_get_filters_4user", New SqlParameter("@userID", userID))
ds.Relations.Add("NodeRelation", ds.Tables(0).Columns("QAID"), ds.Tables(0).Columns("parentID"))

Dim dbRow As DataRow
For Each dbRow In ds.Tables(0).Rows
If dbRow.IsNull("parentID") Then
Dim node As New TreeNode
node.Text = dbRow("label").ToString
node.Expanded = True
node.ID = dbRow("QAID")
node.DefaultStyle = DefaultCss_0

tvFilters.Nodes.Add(node)
RecursivelyPopulate(dbRow, node)
End If
Next dbRow

End Sub

Private Sub RecursivelyPopulate(ByVal dbRow As DataRow, ByVal node As TreeNode)

Dim childRow As DataRow
For Each childRow In dbRow.GetChildRows("NodeRelation")
Dim childNode As New TreeNode
node.Text = dbRow("label").ToString
node.Expanded = False
node.ID = dbRow("QAID")
childNode.CheckBox = True
childNode.Checked = True
childNode.ID = childRow("QAID")
childNode.Text = childRow("label").ToString
childNode.DefaultStyle = DefaultCss_1
node.Nodes.Add(childNode)
RecursivelyPopulate(childRow, childNode)
Next childRow
End Sub 'RecursivelyPopulate


I would like to cache the treeview configuration submitted by the user:

Public Sub multiselect(ByVal sender As System.Object, ByVal e As System.EventArgs)

....

Dim i, j, k, n As Integer
Dim Val As Integer
Dim Label As String
n = 0
Dim item As ListItem

arParms(7) = New SqlParameter("@fLabel", SqlDbType.NVarChar, 50)

For i = 0 To tvFilters.Nodes.Count - 1
For j = 0 To tvFilters.Nodes(i).Nodes.Count - 1
If tvFilters.Nodes(i).Nodes.Item(j).Checked Then
Val = tvFilters.Nodes(i).Nodes.Item(j).ID
Label = tvFilters.Nodes(i).Nodes.Item(j).Text
....
' filter Input Parameter
End If
For k = 0 To tvFilters.Nodes(i).Nodes.Item(j).Nodes.Count - 1
If tvFilters.Nodes(i).Nodes.Item(j).Nodes.Item(k).Checked Then
Val = tvFilters.Nodes(i).Nodes.Item(j).Nodes.Item(k).ID
Label = tvFilters.Nodes(i).Nodes.Item(j).Nodes.Item(k).Text
....
End If
Next

Next
Next

Cache("treeview") = tvFilters

End Sub



Am I missing anything?

Regards,
Zarko
jbit
Asp.Net User
Re: Caching Treeview9/7/2004 6:16:33 PM

0

I found the same issue. I want to cache the treeview object and restore it later, but it doesn't render to the screen. I found there was a private variable _bCreated that is set to false the first time the treeview is being created and then set to _bCreated set to true once it has been created. I believe this variable is used to see if it needs to be rendered to the screen. I'm going to spend more time on this and let you know what I figure out.

Thanks,
Jeff
djordjeg
Asp.Net User
Re: Caching Treeview11/17/2004 5:28:31 PM

0

Hi jbit and zarko,

I have exactly the same problem, and I wondered if you guys found the workaround, so treeview renders on the page when you restore treeview object from cache? I tried to store xml into cache, but binding xml to treeview takes too long, so I thought that storing the entire treeview will be faster to restore from cache. BTW, I have 300 nodes in the treeview. Anybody from Microsoft monitors these forums?

Thanks,

Goran
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 Databases: Beta Preview Authors: John Kauffman, Thiru Thangarathinam, Pages: 404, Published: 2005
Essential ASP .NET 2.0 Authors: Fritz Onion, Keith Brown, Pages: 345, Published: 2007
ASP.NET AJAX Programmer's Reference with ASP.NET 2.0 Or ASP.NET 3.5: With ASP.NET 2.0 Or ASP.NET 3.5 Authors: Shahram Khosravi, Pages: 1522, Published: 2007
Windows Server 2003 Network Infrastructure: Exam 70-291 Authors: Dave Bixler, Will Schmied, Ed Tittel, Pages: 587, Published: 2003
Human-computer Interaction: INTERACT '03 ; IFIP TC13 International Conference on Human-Computer Interaction, 1st-5th September 2003, Zurich, Switzerland Authors: Matthias Rauterberg, Marino Menozzi, Janet Wesson, International Federation for Information Processing, Pages: 1126, Published: 2003
Pro .NET 2.0 Windows Forms and Custom Controls in VB 2005 Authors: Matthew MacDonald, Pages: 1036, Published: 2006
Pro ASP.NET 2.0 in C# 2005 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1255, Published: 2005
Professional ASP.NET 2.0 Databases Authors: Thiru Thangarathinam, Pages: 504, Published: 2007
Professional ASP.NET 3.5 in C and VB: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1704, Published: 2008
Mastering Visual Basic.NET Authors: Evangelos Petroutsos, Pages: 1153, Published: 2002

Web:
Asp Net Cache Treeview - ASP.NET 2.0/3.0/3.5 AJAX treeview ... Asp Net Cache Treeview - ASP.NET 2.0/3.0/3.5 AJAX treeview component Fast .NET Apps with Clustered Cache/Session.
Caching Treeview's (Expand & Collapse) Images !!! - ASP.NET Forums When loading the treeview with some thing around 30-50 nodes, the treeviews' expand/collapse images are always downloaded and this makes the ...
TreeView caching - bytes Hello Leslie, From your description, you're dynamically create a XmlDataSource and bind it to a TreeView control.
.NET ASP.NET TreeView caching TreeView caching - maso. 14-Mar-07 12:54:20. Using Visual Studio 2005 SP1 I am attempting to dynamically load a treeview control. ...
.NET 247 Oct 20, 2001 ... the treeview. e.g. what exactly should i cache? the xml file, the whole ... Subject: [aspngcache] some general advice on caching a treeview. ...
Treeview cache problem? - ng.asp-net-forum ... Treeview cache problem?, > ROOT > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.internet_explorer_web_controls, ...
TreeView Caching problem - ASP.NET Forums When I debug I can see that the treeview does not get its contents from the sitemapprovider at all so it must be cached somewhere. ...
Caching .NET Framework Elements EventArgs e) { // Create the TreeView control and cache it. TreeView m_treeView = new TreeView(); m_treeView.Name = "tvCached"; m_treeView.Dock = System. ...
OutputCache on webusercontrol with treeview - microsoft.public ... treeview showing. This works fine if I don't put caching on. If I then try to add the OutputCache directive with VaryByControl="myDDL" (in ...
Treeview, SiteMapDataSource, SiteMap and Caching - ng.asp-net ... Treeview, SiteMapDataSource, SiteMap and Caching, > ROOT > NEWSGROUP > Asp.Net Forum ...






internet explorer web controls

background color transparent

inherting from treenode

treeview first child node problem

treeview cascading check boxes

treeview treenodesrc property <%# container.dataitem blah blah blah doesn't work

tab strip control displays nothing

treeview web control events not firing

iso latin character

adding nodes to treeview programatically

treeimages problem. "that is a easy problem but i don't know solve"

problem with the treeview.nodes(index).nodes.add(treenode)

client-side treeview - can i assign data values?

urgent: making autopost back only for last node

why does my treeview not seem like a treeview??? sombody can help me?please...

access is denied: 'microsoft.web.ui.webcontrols'.

accessing controls in a multipage pageview

help...error ???

setting tabstrip tabindex??

web treeview control install problem

expand treeview node

iewebcontrols problem with windows server 2003

tab control

site crashing because of error with microsoft.web.ui.webcontrols

wrapping text of the treeview nodes

treeview always dim

how good are ie web controls ?

how can i use the treeview control in the project with strongname

ie webcontrols running correct internally, but no way externaly ?

search values within treeview

   
  Privacy | Contact Us
All Times Are GMT