Performence issue

DevExpress

Page 1 of 1

0 Replies - 954 Views - Last Post: 18 January 2009 - 05:55 PM Rate Topic: -----

#1 amitkrjsr   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-January 09

Performence issue

Post icon  Posted 18 January 2009 - 05:55 PM

Hello All this is amit,

Presently I m using Devexpress treelist control. Every thing is working fine. But the problem is when I m assinging the dataTable to tree it taking lot of time. Presently my datatable containing 567 rows. Below I m giving my bolck of code.
Private Sub ProtocolTreeFormation(ByVal tree As DevExpress.XtraTreeList.TreeList)Dim treeRow As NewProtocolEditorDS.OrganAndProtocolTreeRow
		For Each OrganProtocolRow As NewProtocolEditorDS.oOrganProtocolRelationRow In ProtocolDS.oOrganProtocolRelation
			For Each newOrganProtocolRow As NewProtocolEditorDS.oOrganProtocolRelationRow In ProtocolDS.oOrganProtocolRelation.Select("OrganSystemCode = '" & OrganProtocolRow.OrganSystemCode & "'")

				For Each rowOrganSys As NewProtocolEditorDS.oKdbOrganSystemRow In ProtocolDS.oKdbOrganSystem.Select("OrganSystemCode = '" & newOrganProtocolRow.OrganSystemCode & "'")
					If ProtocolDS.OrganAndProtocolTree.Select("TreeTitle = '" & rowOrganSys.OrganSystemDesc & "'").Length = 0 Then
						treeRow = ProtocolDS.OrganAndProtocolTree.NewOrganAndProtocolTreeRow
						With treeRow
							.TreeChildId = 0
							.TreeTitle = rowOrganSys.OrganSystemDesc
							.Treeid = rowOrganSys.OrganSystemCode
						End With
						ProtocolDS.OrganAndProtocolTree.AddOrganAndProtocolTreeRow(treeRow)
						organid = CInt(ProtocolDS.OrganAndProtocolTree(ProtocolDS.OrganAndProtocolTree.Count - 1).TreeParentID)
					End If
				Next
				For Each rowDetails As NewProtocolEditorDS.oProtocolDetailsRow In ProtocolDS.oProtocolDetails.Select("ProtocolHeaderID = " & newOrganProtocolRow.ProtocolHeaderID)
					treeRow = ProtocolDS.OrganAndProtocolTree.NewOrganAndProtocolTreeRow
					With treeRow
						.TreeChildId = organid
						.TreeTitle = rowDetails.ProtocolName
						.Treeid = rowDetails.ProtocolDetailsID
					End With
					ProtocolDS.OrganAndProtocolTree.AddOrganAndProtocolTreeRow(treeRow)
					pid = CInt(ProtocolDS.OrganAndProtocolTree(ProtocolDS.OrganAndProtocolTree.Count - 1).TreeParentID)

					For Each rowDrug As NewProtocolEditorDS.oProtocolDrugRow In ProtocolDS.oProtocolDrug.Select("ProtocolDetailsId = " & rowDetails.ProtocolDetailsID)
						treeRow = ProtocolDS.OrganAndProtocolTree.NewOrganAndProtocolTreeRow
						With treeRow
							.TreeChildId = pid
							.TreeTitle = rowDrug.DrugName
							.Treeid = rowDetails.ProtocolDetailsID
						End With
						ProtocolDS.OrganAndProtocolTree.AddOrganAndProtocolTreeRow(treeRow)
					Next
				Next
			Next
		Next
		ProtocolDS.OrganAndProtocolTree.AcceptChanges()
		tree.DataSource = ProtocolDS.OrganAndProtocolTree
		tree.KeyFieldName = "TreeParentID"
		tree.ParentFieldName = "TreeChildId"
		tree.Columns("Treeid").VisibleIndex = -1
		tree.ExpandAll()
		FormatTree(tree)
End Sub


This Procedure taking a treelist as in input and inseting rocord into datatable and then assigning that table to treelist. Following property basicaly taking time.

tree.DataSource = ProtocolDS.OrganAndProtocolTree
tree.KeyFieldName = "TreeParentID"

When I m trying to do this with thread it giving me the exception that object is already in use.

Please help me.

If you have any sugession then please mail me. My id is [email protected]

Thanking You,
Amit kumar

Is This A Good Question/Topic? 0
  • +

Page 1 of 1