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:
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:
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