0

I am working on a project that reads an XML file with information about metal bars and the cut lengths that are required on each bar. I want to display this data in a tree view, sorted by bar supplier then bar type, then individual bars. The operator should be able to select a bar and then view all the cuts on that bar in a gridview. Please see the image below:

Bar Length

So far I have been able to read all the data i require from a file into a structure which I have defined below:

public List<cutdetails> Cutdetails = new List<cutdetails>();

    public class cutdetails
    {
        public int Bar_id { set; get; }
        public int Cut_id { set; get; }
        public string Brand { set; get; }
        public string System { set; get; }
        public string Code { set; get; }
        public string Length { set; get; }
        public string AngleL { set; get; }
        public string AngleR { set; get; }
        public string LenInn { set; get; }
        public string LenOut { set; get; }
        public string Barcode { set; get; }
        public string Description { set; get; }
        public string Status { set; get; }
        public string Label1 { set; get; }
        public string Label2 { set; get; }
        public string Label3 { set; get; }
        public string Label4 { set; get; }
    }

This structure represents all the cuts that need to be made by the "Sawman". On the datagridview it looks like the following:

enter image description here

What i want to achieve now is the ability to filter this cutlist based on a selection made in the tree view on the left. The cutlist has a column that defines the id of the "Parent Bar" (Bar_id). What is the best way to populate the treeview and perform filtering of the list on the left with the treeview?

I would also want checkboxes next to the treeview so i can potentially display all the cuts for a number of selected bars etc.

Thanks in advance,

Will

György Kőszeg
  • 17,093
  • 6
  • 37
  • 65
Will
  • 17
  • 3
  • is it `winform` or `wpf`? – Hari Prasad Feb 11 '16 at 07:14
  • Hi Hari, this is c#. Im using telerik controls at the moment which is why it looks a bit different. – Will Feb 11 '16 at 07:17
  • Sorry mate, its been a long day. This is WinForms is what i meant to say. – Will Feb 11 '16 at 07:39
  • In general you can directly bind `DataSet/DataTable` to `Treeview` control, If you are using `Telerik` controls take a look at this [link](http://www.telerik.com/forums/tree-from-self-referencing-data) – Hari Prasad Feb 11 '16 at 08:08

0 Answers0