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

[Solved] 2010 Q3 Breaking Changes and GroupDescriptor

3 Answers 111 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.
Halász Levente
Top achievements
Rank 1
Halász Levente asked on 07 Feb 2011, 04:17 PM
Dear Telerik!

A few days ago I started to evaluate Telerik's Silverlight components for our new project. As you can see we did some evaluation in the past, but we could not finish it from different reasons. Anyway I tried to recompile my test solutions and found out that there was some breaking changes regarding GroupDescriptor. One of them is making DisplayContent read only. This way I lost the possibility to customize the look of my group header (I put a textbox in it).

Is there an other way to customize it.

Regards,

Levente

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 07 Feb 2011, 04:22 PM
Hello,

 You can use GroupHeaderTemplate to customize the group header. Please check this demo for more info.

Regards,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Halász Levente
Top achievements
Rank 1
answered on 08 Feb 2011, 08:40 AM
Thank you for your quick response. The problem is that GroupHeaderTemplate is not the best place for my textbox. The goal of the text box is to let the user change the aggregation function period parameter. For example I have a list of events. When the user groups this list by the time the event occurred I'd like to present the data grouped in 10 minute periods. First the ones occurred between 00:00 - 00:10, than 00:10-00:20 and so on.
This is not a problem for me. However I need to let the user change the period, and this is what the above mentioned textbox is for. Of course I could place a texbox somewhere near by the grid view, but it was so cool in the GroupDescriptor.DisplayContent.

Meanwhile I examined this issue and fount that in theory I could still use this approach, but the problem is that whenever I add a GroupDescriptor to grids GroupDescriptors, unless it is a ColumnGroupDescriptor, I get an Value does not fall within expected range error (see attached image).

My code looks like this:

if (member == "TimeOfArrivalCategory")
                {
                    int index = radGrid.GroupDescriptors.IndexOf(e.GroupDescriptor);
                    radGrid.GroupDescriptors.Remove(e.GroupDescriptor);
                    radGrid.GroupDescriptors.Insert(index, (IGroupDescriptor)radGrid.ParentOfType<UserControl>().Resources["timeOfArrivalCategory"]);
                }

where timeOfArrivalCategory resource is

<telerik:GroupDescriptor x:Key="timeOfArrivalCategory" Member="TimeOfArrivalCategory"  SortDirection="Ascending">
            <telerik:GroupDescriptor.DisplayContent >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Width="50"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding TimeOfArrivalCategory}" Grid.Column="0"></TextBlock>
                    <TextBox Text="{Binding DataSource.TimeFrame, Source={StaticResource dataContextProxy}, Mode=TwoWay}" Grid.Column="1" InfrastructureCommon:DataContextProxyObserver.BindedProperty=""/>
                </Grid>
            </telerik:GroupDescriptor.DisplayContent>
        </telerik:GroupDescriptor>


Regards,

Levente
0
Veselin Vasilev
Telerik team
answered on 08 Feb 2011, 04:48 PM
Hello Halász Levente,

We have tried to describe this in the Breaking Changes section of RadGridView's help.
Here is the relevant text:

  • The GroupDescriptor property of GridViewGroupedEventArgs and GridViewGroupingEventArgs is now of type IGroupDescriptor.
  • The Action property of the GridViewGroupedEventArgs and GridViewGroupingEventArgs is now of type GroupingEventAction instead of CollectionChangeAction.
  • The GroupDescriptors property of RadGridView is now a collection of IGroupDescriptor, instead of GroupDescriptor.
  • RadGridView now generates the new ColumnGroupDescriptor when grouping from the UI.
  • The Grouping and Grouped events now fire only when a grouping operation has been performed on the UI.

Let us know if you have any problems converting your old code to use the changed properties.

Kind regards,
Veselin Vasilev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
GridView
Asked by
Halász Levente
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Halász Levente
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or