How to create Hierachy Grid from Objects

Posted by Vuyiswamb under ASP.NET on 8/16/2010 | Points: 10 | Views : 1516 | Status : [Member] [MVP] [Administrator] | Replies : 2
Good Day All

I have a Class that is defined like this

namespace EAVV
{
public class EAV
{

private string _Attribute;
private string _Value;



public string Attribute
{
get
{
return _Attribute;
}

set
{
_Attribute = value;
}

}

public string Value
{
get
{
return _Value;
}
set
{
_Value = value;
}

}

public EAV(string AttributeEA, string ValueEA)
{
this._Attribute = AttributeEA;
this._Value = ValueEA;

}

public EAV()
{


}

}
}


And I have another one to process this like this

namespace EAVV
{
public class EAVProcess
{

public List<EAV> GetRecords(List<string> ParentRecords,List<string> ChildRecords)
{
List<EAV> Final= new List<EAV>();

for (int i = 0; i < ParentRecords.Count; i++)
{

for (int J = 0; J < ChildRecords.Count; J++)
{
Final.Add(new EAV(ParentRecords[i], ChildRecords[J]));
}
}

return Final;
}

public EAVProcess()
{
}
}
}


And as you can see this will return a list. So I am binding my Grid(Telerik) which is the same as binding the normal asp.net grid like this

                        RadGrid1.DataSource = EAVobj.GetRecords(ParentRecordsRow, ChildRecordsField); 
RadGrid1.DataBind();


And I get the Following Data
http://www.telerik.com/ClientsFiles/212012_grid-hierachy.JPG

from the Image, You can see there is an Attribute Column and there is a Value Column, Now what i want to do is that i want to have only one Country and one Event in the Attribute and the Values must be nested underneath each other in a Grid, so basically i need a nested View and the Attribute is the parent and the Values will be grouped according to their parent.

Thanks

Thank you for posting at Dotnetfunda
[Administrator]



Responses

Posted by: Vuyiswamb on: 10/21/2010 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
i got a Solution. Thanks

Thank you for posting at Dotnetfunda
[Administrator]

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja on: 10/22/2010 [Member] Starter | Points: 25

Up
0
Down
Hi Vuyiswa,

Could you please give the solution of this problem or at least hint how to solve this?

Thanks

Regards,
Raja, USA

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response