I using this code for generete gridview master detail but not work
any ideas?
thancks a lot
GridViewTemplate
childTemplate = CreateChildTemplate();
GridViewRelation relation = new GridViewRelation(this.gwSchemi.MasterTemplate, childTemplate);relation.ChildColumnNames.Add("XMLFLUSSI");
this.gwSchemi.Relations.Add(relation);
this.gwSchemi.DataSource = ManagerSchema.GetSchemi();
this.gwSchemi.Refresh();
private GridViewTemplate CreateChildTemplate(){
GridViewTemplate template = new GridViewTemplate();
template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
template.AllowDeleteRow = false;
template.AllowEditRow = false;
template.AllowAddNewRow = false;
template.ReadOnly = true;
GridViewTextBoxColumn idColumn = new GridViewTextBoxColumn("id");
ridViewTextBoxColumn nomerColumn = new GridViewTextBoxColumn("nome");
GridViewCheckBoxColumn statoColumn = new GridViewCheckBoxColumn("stato");
GridViewTextBoxColumn tipoColumn = new GridViewTextBoxColumn("tipo");
template.Columns.AddRange(idColumn,nomerColumn,statoColumn,tipoColumn);
template.Columns["id"].IsVisible = false;
return template;
}
this is the definition of the two poco class
public class XMLSCHEMI{
public Guid id { get; set; }
public string nome { get; set; }
public string XMLSCHEMA { get; set; }
public List<XMLFLUSSI> XMLFLUSSI { get; set; }
}
public class XMLFLUSSI{
public Guid id { get; set; }
public Guid id_xmlschemi { get; set; }
public string nome { get; set; }
public string f_origine { get; set; }
public string tab_destin { get; set; }
public Boolean stato { get; set; }
public string namepart { get; set; }
public Int32 length { get; set; }
public string extension { get; set; }
public string f_storico { get; set; }
public string f_errore { get; set; }
public string tipo { get; set; }
public XMLSCHEMI XMLSCHEMI { get; set; }
}