How to query Custom Data Adaptor with complex type

I would like to render a view that will be bound to a custom data adaptor (already working).  The model looks like the following... 




The custom data adaptor will return zero or more of the above model. 

I would like to be able to add new Validator (simple name property) as the outer-most-level , then be able to add 1 or more RuleSets inner-level (also just a simple name property), followed by a data grid or FieldValidationRule items.   

Possibly something like the depiction below, but open to other UI layouts...


The entire schema represents the document that is returned by the custom data adapter.  

The following are the models. I can change any aspect of the model if it would be easier to bind to the component.

  public class Validator  
  {
        public System.Guid AggregateRootModelReferenceId {get; set;}
        public System.Guid DomainElementModelReferenceId {get; set;}
        public string ValidatorRoslynScript {get; set;}
        public List RuleSets {get; set;}
        public Guid ValidatorId {get; set;}
 }  
 
 public class RuleSet  
 {
        public string Name {get; set;}
        public List FieldValidationRules {get; set;}
        public Guid RuleSetId {get; set;} 
  }

public class FieldValidationRule 
    {
        public Guid DomainElementFieldModelRefenceId {get;set}
        public Guid ErrorDescriptionResId {get;set} 
        public Guid ToolTipDescriptionResId {get;set}  
        public Guid PropertyNameResId {get;set} 
        public string ErrorCode {get;set} 
        public string Parameter1 {get;set} 
        public string Parameter2 {get;set} 
        public string Parameter3 {get;set} 
        public string Parameter4 {get;set}
        public string Parameter5 {get;set}  
        public string Parameter6 {get;set} 
        public string ErrorDescription {get;set} 
        public string ToolTipDescription {get;set}  
        public string CustomRuleType {get;set}  
        public string NameOfProperty {get;set}  
        public string ItemTypeName {get;set} 
        public SeverityLevel SeverityLevel {get;set} 
        public ConditionType ConditionType {get;set} 
        public ValidateMode ValidateMode {get;set} 
        public CascadeMode CascadeMode {get;set} 
        public RuleType RuleType {get;set} 
        public Guid ParentFieldValidationRuleId {get;set}  
        public Guid FieldValidationRuleId {get;set} 

    }

I am familiar with SF TreeView and DataGrid, just not sure how to stitch this together as a single component that queries via the data adaptor to allow me to edit each of the above depicted sections. 

How can I show and add and edit new Validators and manage related RuleSets and related FieldValidationRules from the custom data adaptor using multiple SF databound control types so as to achieve the above editable layout?





1 Reply 1 reply marked as answer

PS Pon Selva Jeganathan Syncfusion Team April 16, 2021 11:33 AM UTC

Hi John,   
  
Thanks for contacting syncfusion forum. 
  

Query: How to query Custom Data Adaptor with complex type

 

Based on your query and screenshots, we suspect that you need to bind different fields for parent and child records. In TreeGrid, by default we have to bind same column Names for both Parent and child Records. Based on the ParentIdmapping/IdMapping  and ChildMapping fields alone we have form the Hierarchical relationship between them to built Treelike structure.  

If you want to maintain Parent and child records(Hierarchical structure) with different Column names we suggest you to use Detail Template feature of the Data Grid to achieve this requirement.  Using queryString property we can bind the childGrid records with different fields. 
 
Please refer to the below UG documentation of DataGrid. 
Please refer to the below demo sample, 

Kindly get back to us for further assistance. 
 
Regards, 
Pon selva 



Marked as answer
Loader.
Up arrow icon