This is a migrated thread and some comments may be shown as answers.

Hierarchy grid RowStyle and HeaderRowStyle

0 Answers 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ivan Kopcanski
Top achievements
Rank 1
Ivan Kopcanski asked on 21 Apr 2010, 12:16 PM
Hi,
     I have the working RowStyle and HeaderRowStyle styles for the RadGridView.
When they applied to the hierarchy grid they don't work.
RowStyle contains the template for the row and because of that the child hierarchy grid is not shown.
When the template from that row style is removed the default row styles are applied.

The following code shows the hierarchy grid (cc:RadGrid is RadGridView inherited chass):

<cc:RadGrid x:Name="gvFreeFieldsUpdate"  IsScrolling="True"
                                Style="{StaticResource CustomerDetailsFreeFieldsGrid}"
                            >
              
                <cc:RadGrid.HierarchyChildTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <cc:RadGrid 
                                AutoGenerateColumns="False" 
                                IsFilteringAllowed="True"
                                x:Name="gvChild"
                                Loaded="gvChild_Loaded">

                            </cc:RadGrid>
                        </StackPanel>
                    </DataTemplate>
                </cc:RadGrid.HierarchyChildTemplate>
            </cc:RadGrid>

code-behind:

public TabFreeFieldsView(IUnityContainer unityContainer, ITabFreeFieldsViewModel viewModel)
        {
            InitializeComponent();

            _unityContainer = unityContainer;
            this.ViewModel = (IViewModel)viewModel;
            this.DataContext = this.ViewModel;

            this.gvFreeFieldsReadOnly.AddColumns(viewModel.FreeFieldsColumns);
            this.gvFreeFieldsUpdate.AddColumns(viewModel.FreeFieldsColumns);

            GridViewTableDefinition definition = new GridViewTableDefinition();
            definition.Relation = new PropertyRelation("FreeFieldValues");

            this.gvFreeFieldsReadOnly.ChildTableDefinitions.Add(definition);
            this.gvFreeFieldsUpdate.ChildTableDefinitions.Add(definition);
}

Also, the HeaderRowStyle is not working for column headers in root hierarchy grid. Could you please assist in this issue?
I suppose the new RowStyle should be created with the template for expandable row, 
but I can't find the expandable row template anywhere. In the next post in this thread you will have the styles/

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Ivan Kopcanski
Top achievements
Rank 1
Share this question
or