Improving code and UI Performance
- by Kobojunkie
I am dealing with a situation that I need some help with here. I need to improve performance on functionality that records and updates UI with user selection info. What my code current does is
'This is called to update the Database each time the user makes a new selection on the UI
Private Sub OnFilterChanged(String newReviewValueToAdd)
AddRecentViewToDB(newReviewValueToAdd)
UpdateRecentViewsUI()
PageReviewGrid.Rebind()'Call Grid Rebind
End Sub
'This is the code that handles updating the UI with the Updated selection
Private Sub UpdateRecentViewsUI()
Dim rlNode As RadTreeNode = radTree.FindNodeByValue("myreviewnode")
Dim Obj As Setting
Dim treenode As RadTreeNode
For i As Integer = 0 To Count - 1
Obj = Setting.Review.Item(i)
treenode = New RadTreeNode(datetime.now.ToString,i.ToString())
treenode.ToolTip = obj.GetFilter
radNode1.Nodes.Add(treenode)
Next
End Sub
Private Sub UpdateRecentViewsUI()
Dim pnlNav As RadPanelItem = rpbMyLoans.FindItemByValue("rpiMLNavTree")
Dim radTree As RadTreeView = CType(pnlNav.FindControl("rtMyLoansNav"), RadTreeView)
Dim rlNode As RadTreeNode = radTree.FindNodeByValue("MLRS")
rlNode.Nodes.Clear()
Dim objRS As SharedCode.WATSUserSettings.MyLoansView
Dim objRTN As RadTreeNode
For intItem As Integer = 0 To GetUserSettings.MyLoansRecentViews.Count - 1
objRS = GetUserSettings.MyLoansRecentViews.Item(intItem)
objRTN = New RadTreeNode(objRS.LastUpdate.ToString, intItem.ToString)
objRTN.ToolTip = objRS.getFilterString
rlNode.Nodes.Add(objRTN)
Next
End Sub