c# - DevExpress GridView details view collections data -
i trying populate devexpress gridview datas.
let's have 2 classes :
public class objecta { public string name { get; set; } public list<objectb> details1 { get; set; } public list<objectb> details2 { get; set; } } public class objectb { public string name { get; set; } public string description { get; set; } }
and form created :
private list<objecta> datas; public form1() { initializecomponent(); // fill data datas = ... // set datasource this.gridcontrol1.datasource = datas; this.gridview1.bestfitcolumns(); this.setrelation(); } private void setrelation() { gridview custompatternview = new gridview(gridcontrol1); custompatternview.columns.addfield("name").visibleindex = 0; custompatternview.columns.addfield("description").visibleindex = 1; this.gridcontrol1.leveltree.nodes.add("customrelation", custompatternview); }
this code working i'm obly able display details1 in details view. how can display details2 ?
thanks
you need 1 gridview
each detail view.
gridcontrol1.leveltree.nodes.add("details1", custompatternview);
gridcontrol1.leveltree.nodes.add("details2", custompatternview);
Comments
Post a Comment