Hello,
I am trying to do SelfReference and adding relation together in the grid.
I have 2 collection: ProjectTemplate and ProjectTask. Each of these 2 contains selfreference 2 each other and they also have relation between them.Checkout code snipet below.
Note: "ProjectContract" is datacontract containing these 2 collection.
I am getting somewhat desirable result. I am getting self hierarchy of ProjectTemplate and relation of template and task. But i am unable to get self hierarchy of Project Task.
Please checkout image attached below for more clarification.
Thanks,
I am trying to do SelfReference and adding relation together in the grid.
I have 2 collection: ProjectTemplate and ProjectTask. Each of these 2 contains selfreference 2 each other and they also have relation between them.Checkout code snipet below.
Note: "ProjectContract" is datacontract containing these 2 collection.
"ProjectContract.TemplateContracts
" is ProjectTemplate Collection and
"ProjectContract.TaskContracts
" is ProjectTask Collection.radGridView1.MasterTemplate.DataSource = ProjectContract.TemplateContracts;
radGridView1.MasterTemplate.Templates.Add(
new
GridViewTemplate() { DataSource = ProjectContract.TaskContracts });
radGridView1.Relations.AddSelfReference(radGridView1.MasterTemplate,
"ProjectTemplateId"
,
"ParentProjectTemplateId"
);
radGridView1.Relations.AddSelfReference(radGridView1.MasterTemplate.Templates[0],
"ProjectTaskId"
,
"ParentProjectTaskId"
);
var relation =
new
GridViewRelation(radGridView1.MasterTemplate, radGridView1.MasterTemplate.Templates[0])
{
RelationName =
"TemplateTask"
};
relation.ParentColumnNames.Add(
"ProjectTemplateId"
);
relation.ChildColumnNames.Add(
"ParentProjectTemplateId"
);
radGridView1.Relations.Add(relation);
I am getting somewhat desirable result. I am getting self hierarchy of ProjectTemplate and relation of template and task. But i am unable to get self hierarchy of Project Task.
Please checkout image attached below for more clarification.
Thanks,