TreeView Data binding
-
Dear friends, i am new to wpf and i got some doubt , i have class like these
public class FileSystem
{
Drive[] m_Drive;
public Drive[] Drives
{
get { return m_Drive; }
}
}
public class Drive
{
public string DriveName { get; set; }Directory\[\] m\_Directory; public Directory\[\] Directories { get { return m\_Directory; } } } public class Directory { public string DirectoryName { get; set; } File\[\] m\_Files; public File\[\] Files { get { return m\_Files; } } } public class File { public string FileName { get; set; } }
now i want to represent these in treeview control, how to do that? can some one give me the XAML with (binding and explanation) Thank you Joe
-
Dear friends, i am new to wpf and i got some doubt , i have class like these
public class FileSystem
{
Drive[] m_Drive;
public Drive[] Drives
{
get { return m_Drive; }
}
}
public class Drive
{
public string DriveName { get; set; }Directory\[\] m\_Directory; public Directory\[\] Directories { get { return m\_Directory; } } } public class Directory { public string DirectoryName { get; set; } File\[\] m\_Files; public File\[\] Files { get { return m\_Files; } } } public class File { public string FileName { get; set; } }
now i want to represent these in treeview control, how to do that? can some one give me the XAML with (binding and explanation) Thank you Joe
-
Thank for the reply, i saw that sample , It was in MVVM patten .. i do not want anyting like that ... if i want to bind in simple way how to do that?
-
Thank for the reply, i saw that sample , It was in MVVM patten .. i do not want anyting like that ... if i want to bind in simple way how to do that?
That is the simple way. Don't try and complicate things for yourself.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Dear friends, i am new to wpf and i got some doubt , i have class like these
public class FileSystem
{
Drive[] m_Drive;
public Drive[] Drives
{
get { return m_Drive; }
}
}
public class Drive
{
public string DriveName { get; set; }Directory\[\] m\_Directory; public Directory\[\] Directories { get { return m\_Directory; } } } public class Directory { public string DirectoryName { get; set; } File\[\] m\_Files; public File\[\] Files { get { return m\_Files; } } } public class File { public string FileName { get; set; } }
now i want to represent these in treeview control, how to do that? can some one give me the XAML with (binding and explanation) Thank you Joe
So you want a simple way, try this one : http://karlshifflett.wordpress.com/2007/11/10/over-reaction-to-a-simple-wpf-explorer-tree/[^] I am sure it will end up even more complex though. :laugh:
-
Dear Josh, I went thru your article and many more articles for bindinf a tree view with database. My problem is still unresolved. my requirement is, I have three tables linked togather as below 1-Order table contains, partyCode and orderNo. 2-Item table contains, orderNo & ItemCode. 3-Stages table contains, orderNo, itemCode & stageCode.(Same stageCode can appear in the table for different items, but not for same Items. Items may or may not have stages. If Item has stages, then entry for such Item will be available in stage table. Otherwise not.) I am unable to generate a tree in below manner: Tree display ord1 ...Item1 .......stage1 .......stage2 ...item2 .......stage1 .......stage2 .......stage3 ...item3 ...item4 ...item5 ...item6 ...item7 ...item8 ...item9 ord2 …… ord3 ……. please help me in generating a tree of such type. I am using dataservices to getch the data from database.