Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

ParentId replaces the real Model property for parent id

$
0
0

Hi,
    If you have a model say

public class Category {
 public int Category_Id {get;set;}
 public string Category_Name {get;set;}
 public int? Parent_Category_Id {get;set;}
}

 and you set the Model in the datasource of the treelist to

.Model(m =>
            {
                m.Id(f => f.Category_id);
                m.ParentId(f => f.Parent_Category_Id);
                m.Expanded(true);
 
            })

Then the Parent_Category_Id is replaced with ParentId so when you view the datasource data items the property Parent_Category_Id is no longer there on any items. This causes problems when trying to update,edit etc as the real Parent_Category_id is never passed but instead a ParentId is.

Surely m.ParentId(f => f.Parent_Category_Id); should be just mapping this property and not replacing it.

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>