locked
L2S ManyToMany FieldTemplate RRS feed

  • Question

  • User-751080518 posted

    Hi!

    I made ManyToMany field template for linq to sql model based on this article

    http://www.codeproject.com/KB/webforms/DynamicDataManyToManyFld.aspx

    Edit field works. Now I would like to make this field template for view mode.

    Code from entity framework is:

    base.OnDataBinding(e);
    
            // Get the real entity from the wrapper
            object entity = ((ICustomTypeDescriptor)Row).GetPropertyOwner(null);
    
            // Get the collection and make sure it's loaded
            var entityCollection = (RelatedEnd)Column.EntityTypeProperty.GetValue(entity, null);
            entityCollection.Load();
    
            // Bind the repeater to the list of children entities
            Repeater1.DataSource = entityCollection;
            Repeater1.DataBind();

    Did someone else try to make ManyToMany field template for L2S models?

    Thursday, December 8, 2011 1:48 AM

Answers

All replies