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

[Solved] initialized with missing first line

1 Answer 107 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
gao
Top achievements
Rank 1
gao asked on 25 Jul 2011, 07:12 AM
I had a problem .
When I use the aggregates in the group header, the component was initialized with missing first line.
For example,
you can see only two lines with total three items existed.
But if you click or reset the grouby-by  item, the missing item will  come out, then you will see three items.
What's wrong with my codes? using MVVM

<Grid x:Name="rightContent">
                                <Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" />
                                <telerik1:RadGridView x:Name="RadGridView1" ItemsSource="{Binding NodeList, Mode=TwoWay}" CanUserFreezeColumns="False"
                             AutoExpandGroups="True" AutoGenerateColumns="False" Loaded="RadGridView1_Loaded" telerik1:StyleManager.Theme="Windows7">
                                    <telerik1:RadGridView.Columns>
                                        <telerik1:GridViewDataColumn Header="SequenceNum" DataMemberBinding="{Binding SequenceNum}" />
                                        <telerik1:GridViewDataColumn Header="NodeId" DataMemberBinding="{Binding NodeId}" />
                                        <telerik1:GridViewDataColumn Header="NodeText" DataMemberBinding="{Binding NodeText}" />
                                        <telerik1:GridViewDataColumn Header="OverDueDate" DataMemberBinding="{Binding OverDueDate}" />
                                        <telerik1:GridViewDataColumn Header="NodeStatusId" DataMemberBinding="{Binding NodeStatusId}" />
                                        <telerik1:GridViewDataColumn Header="ProjectId" DataMemberBinding="{Binding ProjectId}" UniqueName="ProjectId">
                                            <telerik1:GridViewDataColumn.AggregateFunctions>
                                                <telerik1:CountFunction Caption="The number of nodes not started:" />
                                            </telerik1:GridViewDataColumn.AggregateFunctions>
                                        </telerik1:GridViewDataColumn>
                                        <telerik1:GridViewDataColumn Header="Owner" DataMemberBinding="{Binding Owner}" />
                                    </telerik1:RadGridView.Columns>
                                </telerik1:RadGridView>
                            </Grid>

private void RadGridView1_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {

            gridViewModel = new GridViewModel();

            this.DataContext = gridViewModel;
            var descriptor = new ColumnGroupDescriptor { Column = this.RadGridView1.Columns["ProjectId"] };
            this.RadGridView1.GroupDescriptors.Add(descriptor);
               
         
        }


1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 25 Jul 2011, 07:37 AM
Hello Gao,

I have tested the scenario you described, but I was not able to reproduce the same behavior. May you take a look at the sample attached to verify whether there are any misunderstandings ?
 

All the best,
Maya
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
gao
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or