GridViewComboBoxColumn dynamic itemsource

3 posts, 0 answers
  1. Fredrik
    Fredrik avatar
    58 posts
    Member since:
    Mar 2013

    Posted 18 Dec 2014 Link to this post

    Hello!
    I have a gridview with a collection of entities.
    Each entity has a subcollection, that matches a group id found on a property on the entity.

    explanined:
    The subcollection base is same for all entities, but each entity only displays a portion given by the group id.
    I want the subcollection displayed by GridViewComboBoxColumn in the gridview

    if all the entites would display the same subcollection, this would be easy to do.
    but i strugle to solve this with diffrent sub collections on each entity.

    any help would be appreicated


  2. Fredrik
    Fredrik avatar
    58 posts
    Member since:
    Mar 2013

    Posted 19 Dec 2014 Link to this post

    Solved it by using a collection on a partial class of the entity 
    key was using itemsourcebinding insted of itemsource

                            <controls:GridViewComboBoxColumn Header="{Binding LocalizedStrings.view_epark_appvare, Source={StaticResource LocalizedStrings}}" ItemsSourceBinding= "{Binding Evarer,Mode=TwoWay}" DataMemberBinding="{Binding p_EparkGroup ,Mode=TwoWay}" SelectedValueMemberPath="p_Ident"  DisplayMemberPath="p_Tekst" >



                var result = await EntityManager.ExecuteQueryAsync<db_Organisasjon>(qry);
                foreach (var org in result)
                {
                     org.Evarer = varer;
                }

            private List<db_Vare> _evarer = null;
            public List<db_Vare> Evarer
            {
                get
                {

                    return _evarer != null && p_EparkVaregruppe p_EparkGroup != null ? _evarer.Where(x => x.p_Group == p_EparkGroup : null;
                }
                set
                {
                    _evarer = value;
                }
           }





  3. DevCraft banner
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 19 Dec 2014 Link to this post

    Hi,

    Thank you for updating the thread and sharing your solution with the community.

    Regards,
    Dimitrina
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top