Welcome to the Xceed Community | Help
Community Search  
More Search Options

Master/Detail - Displaying a child collection as a Detail.

Sort Posts: Previous Next
  •  02-15-2010, 11:24 AM Post no. 25784

    Master/Detail - Displaying a child collection as a Detail.

    I am currently evaluating the use of Xceed datagrid. I have the following Entity and am trying to display it as a master detail table flow grid with multiple levels:

     public class Entity

    {
        public decimal Id;

        public string Name;

        public Entity ParentEntity;

        public ObservableCollection<Entity> ChildEntities;

    }

     

    I understand that TreeView style master detail (where there is only one column header) is currently not supported but has been added as a feature request. As a side, is there any indication as to when this is coming out? In the mean time I don't mind displaying multiple levels of child entities with seperate column headers.

     

    I have bound my collection of entities to a DataGridCollectionViewSource and have got the grid to display the first level but I don't know how to display the multiple recursive child levels. None of the samples seem to cover binding a business entity in this way.

  •  02-15-2010, 11:54 AM Post no. 25785 in reply to 25784

    Re: Master/Detail - Displaying a child collection as a Detail.

    Hi Rehan,

    There is no scheduled release date on a TreeView master detail feature for the Xceed Datagrid for WPF, at the moment.

    For each level of details, you should implement a DetailDescription and a DetailConfiguration, since there is no auto creation of recursive details on the Datagrid component.


    Xceed - Software Developer and Technical Support
  •  02-15-2010, 12:29 PM Post no. 25788 in reply to 25785

    Re: Master/Detail - Displaying a child collection as a Detail.

    I have tried to add a DataGridDetailDescription but it does not seem to work:

     

    <xcdg:DataGridCollectionViewSource AutoCreateItemProperties="False" AutoFilterMode="And" AutoCreateForeignKeyDescriptions="True"
                                       DistinctValuesConstraint="Filtered" Source="{Binding Funds}">

      <xcdg:DataGridCollectionViewSource.DetailDescriptions>
                     
          <local:EntityDetailDescription AutoFilterMode="And"
                                       DistinctValuesConstraint="Filtered"
                                       AutoCreateItemProperties="False"
                                       AutoCreateForeignKeyDescriptions="False">
              <local:EntityDetailDescription.ItemProperties>
                  <xcdg:DataGridItemProperty Name="Name" Title="Name"/>
                  <xcdg:DataGridItemProperty Name="Id" Title="Entity Id"/>
                  <xcdg:DataGridItemProperty CalculateDistinctValues="False" Name="ParentEntity"/>
                  <xcdg:DataGridItemProperty CalculateDistinctValues="False" Name="ChildEntities"/>
              </local:EntityDetailDescription.ItemProperties>
          </local:EntityDetailDescription>

      </xcdg:DataGridCollectionViewSource.DetailDescriptions>
     
      <xcdg:DataGridCollectionViewSource.ItemProperties>
        <xcdg:DataGridItemProperty Name="Name" Title="Name"/>
        <xcdg:DataGridItemProperty Name="Id" Title="Entity Id"/>
        <xcdg:DataGridItemProperty CalculateDistinctValues="False" Name="ParentEntity"/>
        <xcdg:DataGridItemProperty CalculateDistinctValues="False" Name="ChildEntities"/>
      </xcdg:DataGridCollectionViewSource.ItemProperties>    
             
    </xcdg:DataGridCollectionViewSource>


    <xcdg:DataGridControl AllowDetailToggle="True">
      ...
    <xcdg:DataGridControl>


    public sealed class EntityDetailDescription : DataGridDetailDescription
    {
        #region Constructors

        public FundDetailDescription()
        {
            this.RelationName = "ChildEntities";
        }

        #endregion

        #region DataGridDetailDescription Members

        protected override IEnumerable GetDetailsForParentItem(
            DataGridCollectionViewBase parentCollectionViewBase,
            object parentItem)
        {
            Entity entity = (Entity)parentItem;

            if (entity == null)
            {
                return null;
            }

            return entity.ChildEntities;
        }

        #endregion
    }

    The Detail expand button does not appear. Is there something I am missing? Is there a simple code sample which I can take a look at to get this working?

  •  02-16-2010, 9:57 AM Post no. 25803 in reply to 25788

    Re: Master/Detail - Displaying a child collection as a Detail.

    Any update on this?
  •  02-17-2010, 12:44 PM Post no. 25831 in reply to 25803

    Re: Master/Detail - Displaying a child collection as a Detail.

    Hi Rehan,

    Can you please provide us with your self contained sample, including the bound data source? This would enable us to properly implement the relations for the master detail feature. Thank you.

     

     


    Xceed - Software Developer and Technical Support
  •  06-24-2010, 4:37 PM Post no. 27284 in reply to 25788

    Re: Master/Detail - Displaying a child collection as a Detail.

    Hi

    Were you able to figure this out? Im running into same issue. Trying to bind to an Enitity Collection and cant get the expander icon to show up on header record if I set AutoDetailConfiguration property to false.

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.