void CreateChildObject(XafGridView masterView, CustomMasterRowEventArgs e)
 {
     string relationName = masterView.GetRelationName(e.RowHandle, e.RelationIndex);
     object masterObject = masterView.GetRow(e.RowHandle);
     IMemberInfo memberInfo = XafTypesInfo.Instance.FindTypeInfo(masterObject.GetType()).FindMember(relationName);
     Type listElementType = memberInfo.ListElementType;
     IMemberInfo referenceToOwner = memberInfo.AssociatedMemberInfo;
     object obj = GetObjectSpace().CreateObject(listElementType);
     referenceToOwner.SetValue(obj, masterObject);
     //if (IsHiddenFrame())
         //((NestedObjectSpace)ObjectSpace).ParentObjectSpace.CommitChanges();
 }
        void CreateChildObject(XafGridView masterView, CustomMasterRowEventArgs e)
        {
            string      relationName     = masterView.GetRelationName(e.RowHandle, e.RelationIndex);
            object      masterObject     = masterView.GetRow(e.RowHandle);
            IMemberInfo memberInfo       = XafTypesInfo.Instance.FindTypeInfo(masterObject.GetType()).FindMember(relationName);
            Type        listElementType  = memberInfo.ListElementType;
            IMemberInfo referenceToOwner = memberInfo.AssociatedMemberInfo;
            object      obj = GetObjectSpace().CreateObject(listElementType);

            referenceToOwner.SetValue(obj, masterObject);
            //if (IsHiddenFrame())
            //((NestedObjectSpace)ObjectSpace).ParentObjectSpace.CommitChanges();
        }
Exemple #3
0
        public bool IsRelationSet(int rowHandle, int relationIndex)
        {
            string rName = _xafGridView.GetRelationName(rowHandle, relationIndex);

            return(GetMasterDetailRule(rName) != null);
        }