Hi,
I am new at WPF, nonetheless i am trying to make my own little WPF-application.
You probably already noticed that english is not my native language.
In this application there are two tables in a Database, parent/child-related.
In the parent table there is a key-column that contains article-numbers. Matching to this the child-table has an article-number foreign-key column. Not every article has the same number of child-rows in the child-table.
I have bound the article-number column of the parent table to a combobox.(was quite easy)
But now i would like to display all of the matching child rows in a stackpanel. It would be easy for
me to display them in a GridView.(automatically displays all of the child-rows).
The problem is that the number of child-rows is not the same for every article. This number has to be determined for every article of the parent table.
So once the number of childrows is known, the application should generate the right number of "elements" (maybe labels)
to display the data contained in the child-table on a stackpanel.
So i hope you understand my problem and i'm looking forward to your answers.
Tank you,
GigaBite
Loading
DiegoPosted Jan 21, 2011, 6:14 AM
Sorry for only now answer you!
I see that your problem is solved.
Im happy to help you.
JeissPosted Jan 20, 2011, 4:24 PM
indeed, like Diego already mentioned it, TreeView was the key word. And I did find a nice example in the Internet. Once I had changed the table names to my tables i really was impressed by the result of a databound TreeView.
And now that the binding problem is solved i am already trying to change the "look" of the treeview to my wishes.
So, thank you both for your help,
Jeiss
Sam HobbsPosted Jan 18, 2011, 4:14 PM
JeissPosted Jan 18, 2011, 11:21 AM
I do already use a dataset with a relationship between the two tables. The dataset-desigrer cerated one when i added the Database to my project. My problem is that i don't know what (which control or "Windowelement") and how to bind it to my tables in the dataset.
So you suggest me to use a tree structure. OK, why not! But i must admit that i have never used such a tree structure until now. As far as i know the folders in the windows-explorer are displayed in as tree structure. Is that right? If that's right, i could imagine that in xaml you can create nodes with labels or textblocks (or both of them) instead of nodes with folders. Is that what you mean?
And with the right binding the tree structure would always "know" how many matching (related) rows in the child table need to be displayed, even when the number of child-rows is not the same for every parent-row.
So, please tell me if that's what you meant in your answer. It would certainly be very helpfull if you could add a link with an example to your answer. ;-)
thank you,
Jeiss
DiegoPosted Jan 17, 2011, 6:35 PM
If you want to manage its like a tree structure you should see
how to work with xml.
Or maybe using dataset with relationship should help.