This is a migrated thread and some comments may be shown as answers.

Self Reference..

1 Answer 86 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sachin jagtap
Top achievements
Rank 1
sachin jagtap asked on 09 Sep 2009, 02:00 PM

Hi,

i am not able to get this work...

 

public

 

class ProductDTO

 

{

 

public int product_key { get; set; }

 

 

public string product { get; set; }

 

 

public string product_area { get; set; }

 

 

public String last_updated_by { get; set; }

 

 

public DateTime last_updated_on { get; set; }

 

}

 

 


public
class ProductExtDTO

 

{

 

 

public IList<ProductDTO> Products;

 

}

 

PropertyRelation

 

relation = new PropertyRelation("product_area");

 

relation.IsSelfReference =

true;

 

Product_Grid.TableDefinition.Relation = relation;

Product_Grid.RowIndicatorVisibility =

Visibility.Visible;

 

 

 

if (tableDefinition != null)

 

{

Product_Grid.TableDefinition.ChildTableDefinitions.Clear();

Product_Grid.TableDefinition.ChildTableDefinitions.Add(tableDefinition);

}

 

Product_Grid.ItemsSource = ProductList.Products;

I don;t see any row details or hierarchy.

Thanks,
Sachin

 

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 10 Sep 2009, 09:04 AM
Hello sachin jagtap,

The relation that you are trying to create does not seem to be a self-reference. Self-reference means that the object has objects of the same type associated with it. For example, the class Employee can have a collection of sub-ordinates, which are of the same type -- Employee.

You are creating a relation between ProductDTO and product_area which is a string and not a collection of ProductDTo's.

To learn more about hierarchy and relations please check out our online example of self-reference. Make sure you check out the other three Hierarchy examples. Please, let us know if you have any problems.

All the best,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
sachin jagtap
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or