473,388 Members | 1,277 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Parent Child TreelistView help

40
I currently have a treelistview that is populating correctly, but my problem is I need to get this nested, with another table.
I'm importing the SynapticEffect.Forms - which I got from a great example posted on codeproject -
this import is allowing me to create a treelistview object in vb.net

When I run this I get error specified cast is not valid - if I rem for chRow
the Order header populates successfully.
Here is my code:

Expand|Select|Wrap|Line Numbers
  1. Dim MyDataSet3 As New DataSet
  2. 'Get Order from Orders Header - create two columns
  3.  
  4. Dim command1 As New SqlCommand("Select *, Order_no as [openDays], Order_no as [lateDays] from LateOrders_Header_view", cnn1)
  5.  
  6. 'Get Line items from Order Line
  7. Dim command2 As New SqlCommand("Select * from LateOrders_Line_view", cnn1)
  8. Try
  9. cnn1.Open()
  10.  
  11. 'Debug.WriteLine(cnn1.ConnectionString)
  12. Dim DirAdapter As New SqlDataAdapter(command1)
  13. Dim DirAdapter2 As New SqlDataAdapter(command2)
  14.  
  15. Mydataset3 = New DataSet
  16.  
  17. DirAdapter.Fill(Mydataset3, "LateOrders_Header_view")
  18. DirAdapter2.Fill(Mydataset3, "LateOrders_Line_view")
  19. Dim dt As DataTable = Mydataset3.Tables("LateOrders_Header_view")
  20.  
  21. Dim prow As DataRow
  22. Dim chrow As DataRow
  23.  
  24. treeListView1.Update()
  25. treeListView1.Items.Clear()
  26. For Each prow In MyDataSet3.Tables("LateOrders_Header_view").Rows
  27. Dim item As New TreeListNode '= New TreeListNode
  28. item.SubItems.Add(prow("order_no").ToString)
  29. item.SubItems.Add(prow("name").ToString)
  30. item.SubItems.Add(prow("order_date").ToString)
  31. item.SubItems.Add(prow("requested_date").ToString)
  32. item.SubItems.Add(prow("reason").ToString)
  33. item.SubItems.Add(prow("status").ToString)
  34. item.SubItems.Add(prow("duedate").ToString)
  35. item.SubItems.Add(prow("openDays").ToString)
  36. item.SubItems.Add(prow("lateDays").ToString)
  37. ' item.SubItems.Add("")
  38. treeListView1.Nodes.Add(item)
  39. For Each chrow In MyDataSet3.Tables("LateOrders_Line_view").Rows
  40. Dim chitem As New TreeListView '= New TreeListView
  41. chitem.Nodes.Add(chrow("order_no"))
  42. chitem.Nodes.Add(chrow("name"))
  43. chitem.Nodes.Add(chrow("order_date"))
  44. chitem.Nodes.Add(chrow("requested_date"))
  45. chitem.Nodes.Add(chrow("item_id"))
  46. chitem.Nodes.Add(chrow("purchase_class"))
  47. treeListView1.Nodes.Add(item)
  48. Next
  49.  
  50. Next
  51.  
Any Suggestions...Thanks

Thank You
Oct 11 '07 #1
0 1199

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Eddie | last post by:
If FormMain = MDI parent, FormSub = Child parent, I execute FormSub from the menu like this way. FormSub^ sub = gcnew FormSub; sub->MdiParent = this; sub->Show(); This can generate child...
4
by: patrizio.trinchini | last post by:
Hi all, I'm new to XSLT and maybe my problem have a very trivial answer, but I need an expert that point me in the right direction. What I would obtain is to remove all the elements that have a...
4
by: Richard Lewis Haggard | last post by:
What is the mechanism by which a child window can notify its parent that it has been clicked on? -- Richard Lewis Haggard www.Haggard-And-Associates.com
3
by: zacks | last post by:
Forgive me if this has been already asked an answered, I did do a search both here and in VS2005 Help, but I can't find the answer to my question. I am developing an MDI application that is a...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
0
by: KA NMC | last post by:
My data is loading fine into my treelist view, but I'm having problems with the nest - as of right now it loads a row for the parent - then it puts in the all child records in for all parents. eg ...
4
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
1
by: =?Utf-8?B?Um9iZXJ0Vw==?= | last post by:
Hi, I'm developing a WPF Web Application. I'm surprised there were no WPF-specific newsgroups, so I'm posting in dotnet-general. I implemented the TreeListView available with sample code at...
4
by: Buddha | last post by:
Hello, I posted this on two forums, without too much help .. and I am kinda stuck in this. I need to refresh the parent page from the second child window which is opened by the first child and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.