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

column group name issue

6 Answers 150 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 2
Adam asked on 06 Jun 2012, 02:38 PM
I've recently implemented the use of column group names in one of my grids and it works as it should. I have another RadGrid that's nested inside a tab control and when I attempt to add the column group names it's acting weird. I set each column to the appropriate column group name but it's setting the columns to the same group name or not setting the column group name at all..

Any thoughts?

Thanks,
Adam

6 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 06 Jun 2012, 02:42 PM
Hello Adam ,

I will check this . Can you please share some details on your setup ( code/XAML) . Any info on how to reproduce the problem would be helpful.

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Adam
Top achievements
Rank 2
answered on 06 Jun 2012, 02:45 PM
Certainly,
Here you go. This is the tab control with two RadGrids embedded.

            <telerik:RadTabControl x:Name="tabDetails" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" Margin="15,5,15,50" Align="Left"
                                   BackgroundVisibility="Collapsed" SelectionChanged="tabDetails_SelectionChanged">
                <telerik:RadTabControl.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" >
                        <LinearGradientBrush.RelativeTransform>
                            <CompositeTransform CenterY="0.5" CenterX="0.5" SkewY="25"/>
                        </LinearGradientBrush.RelativeTransform>
                        <GradientStop Color="White"/>
                        <GradientStop Color="#FF06313A" Offset="1"/>
                        <GradientStop Color="#FFAAB9BC" Offset="0.363"/>
                        <GradientStop Color="#FFB0BEC0" Offset="0.487"/>
                        <GradientStop Color="#FFBCC7C8" Offset="0.209"/>
                    </LinearGradientBrush>
                </telerik:RadTabControl.Background>
                <telerik:RadTabControl.Effect>
                    <DropShadowEffect Opacity="0.5" ShadowDepth="4"/>
                </telerik:RadTabControl.Effect>
                <telerik:RadTabItem x:Name="tabDirectCustomer" Header="DIRECT to CUSTOMER" ToolTipService.ToolTip="DIRECT to CUSTOMER" FontSize="16" FontWeight="Bold">
                    <telerik:RadTabItem.Effect>
                        <DropShadowEffect Color="White" Opacity="0.6" BlurRadius="5" ShadowDepth="4"/>
                    </telerik:RadTabItem.Effect>                     
                    <telerik:RadGridView x:Name="grdDirectCustomer" Width="auto" ShowColumnFooters="False" AutoGenerateColumns="False" IsFilteringAllowed="False"
                                         IsReadOnly="True" CanUserResizeColumns="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False"                                          
                                         telerik:StyleManager.Theme="Transparent" RowLoaded="grdDirectCustomer_RowLoaded" IsScrolling="True">                                                             
                        <telerik:RadGridView.ColumnGroups>
                            <telerik:GridViewColumnGroup x:Name="directCustomerDays" Header=""/>                            
                            <telerik:GridViewColumnGroup x:Name="directCustomerReqDays">
                                <telerik:GridViewColumnGroup.HeaderTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                                            <TextBlock HorizontalAlignment="Center">Requisition Standard 2</TextBlock>
                                            <TextBlock HorizontalAlignment="Center">Days</TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewColumnGroup.HeaderTemplate>
                            </telerik:GridViewColumnGroup>
                            <telerik:GridViewColumnGroup x:Name="directCustomerSupplyDays">
                                <telerik:GridViewColumnGroup.HeaderTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                                            <TextBlock HorizontalAlignment="Center">Supply Standard 2</TextBlock>
                                            <TextBlock HorizontalAlignment="Center">Days</TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewColumnGroup.HeaderTemplate>
                            </telerik:GridViewColumnGroup>
                            <telerik:GridViewColumnGroup x:Name="directCustomerTransDays">
                                <telerik:GridViewColumnGroup.HeaderTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                                            <TextBlock HorizontalAlignment="Center">Transportation Standard 7</TextBlock>
                                            <TextBlock HorizontalAlignment="Center">Days</TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewColumnGroup.HeaderTemplate>
                            </telerik:GridViewColumnGroup>                            
                        </telerik:RadGridView.ColumnGroups>
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Width=".026*" Background="#6DFFFFFF" Header="Doc Number" TextAlignment="Center" DataMemberBinding="{Binding DOCNO}" ColumnGroupName="directCustomerReqDays"/>
                            <telerik:GridViewDataColumn Width=".016*" Background="#6DFFFFFF" Header="Req Date" TextAlignment="Center"  DataMemberBinding="{Binding REQDATE}" ColumnGroupName="directCustomerReqDays"/>
                            <telerik:GridViewDataColumn Width=".016*" Background="#6DFFFFFF" Header="MRO Date" TextAlignment="Center" DataMemberBinding="{Binding MRODATE}" ColumnGroupName="directCustomerReqDays"/>
                            <telerik:GridViewDataColumn Width=".016*" Background="#6DFFFFFF" Header="Ship Date" TextAlignment="Center"  DataMemberBinding="{Binding SHIPDATE}" ColumnGroupName="directCustomerSupplyDays"/>
                            <telerik:GridViewDataColumn Width=".020*" Background="#6DFFFFFF" Header="Delivery Date" TextAlignment="Center" DataMemberBinding="{Binding DELIVERYDATE}" ColumnGroupName="directCustomerTransDays"/>
                            <telerik:GridViewDataColumn Width=".25*" Background="#6DFFFFFF" Header="Remarks" TextAlignment="Center" DataMemberBinding="{Binding REMARKS}" ColumnGroupName="directCustomerReqDays"/>
                        </telerik:RadGridView.Columns>                        
                    </telerik:RadGridView>
                </telerik:RadTabItem>
                <telerik:RadTabItem x:Name="tabDepotAPOE" Header="DEPOT Thru APOE" ToolTipService.ToolTip="DEPOT Thru APOE" FontSize="16" FontWeight="Bold">
                    <telerik:RadTabItem.Effect>
                        <DropShadowEffect Color="White" Opacity="0.6" BlurRadius="5" ShadowDepth="4"/>
                    </telerik:RadTabItem.Effect>
                    <telerik:RadGridView x:Name="grdDepotAPOE" ShowColumnFooters="False" AutoGenerateColumns="False" IsFilteringAllowed="False"
                                         IsReadOnly="True" CanUserResizeColumns="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False"
                                         telerik:StyleManager.Theme="Transparent" AutoExpandGroups="True" RowLoaded="grdDepotAPOE_RowLoaded">
                        <telerik:RadGridView.ColumnGroups>
                            <telerik:GridViewColumnGroup x:Name="depotAPOEDays" Header=""/>
                            <telerik:GridViewColumnGroup x:Name="depotAPOEReqDays">
                                <telerik:GridViewColumnGroup.HeaderTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                                            <TextBlock HorizontalAlignment="Center">Requisition Standard 2</TextBlock>
                                            <TextBlock HorizontalAlignment="Center">Days</TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewColumnGroup.HeaderTemplate>
                            </telerik:GridViewColumnGroup>
                            <telerik:GridViewColumnGroup x:Name="depotAPOESupplyDays">
                                <telerik:GridViewColumnGroup.HeaderTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                                            <TextBlock HorizontalAlignment="Center">Supply Standard 2</TextBlock>
                                            <TextBlock HorizontalAlignment="Center">Days</TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewColumnGroup.HeaderTemplate>
                            </telerik:GridViewColumnGroup>
                            <telerik:GridViewColumnGroup x:Name="depotAPOETransDays">
                                <telerik:GridViewColumnGroup.HeaderTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                                            <TextBlock HorizontalAlignment="Center">Transportation Standard 8</TextBlock>
                                            <TextBlock HorizontalAlignment="Center">Days</TextBlock>
                                        </StackPanel>
                                    </DataTemplate>
                                </telerik:GridViewColumnGroup.HeaderTemplate>
                            </telerik:GridViewColumnGroup>
                        </telerik:RadGridView.ColumnGroups>
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Width=".026*" Background="#6DFFFFFF" Header="Doc Number" DataMemberBinding="{Binding DOCNO}" ColumnGroupName="depotAPOEDays"/>
                            <telerik:GridViewDataColumn Width=".016*" Background="#6DFFFFFF" Header="Req Date" TextAlignment="Center" ColumnGroupName="depotAPOEReqDays" DataMemberBinding="{Binding REQDATE}"/>
                            <telerik:GridViewDataColumn Width=".016*" Background="#6DFFFFFF" Header="MRO Date" TextAlignment="Center" ColumnGroupName="depotCCPReqDays" DataMemberBinding="{Binding MRODATE}"/>
                            <telerik:GridViewDataColumn Width=".016*" Background="#6DFFFFFF" Header="Ship Date" TextAlignment="Center" ColumnGroupName="depotCCPSupplyDays" DataMemberBinding="{Binding SHIPDATE}"/>
                            <telerik:GridViewDataColumn Width=".020*" Background="#6DFFFFFF" Header="Arrive at APOE" TextAlignment="Center" ColumnGroupName="depotCCPTransDays" DataMemberBinding="{Binding ARRIVEAPOE}"/>
                            <telerik:GridViewDataColumn Width=".016*" Background="#6DFFFFFF" Header="Leave APOE" TextAlignment="Center" ColumnGroupName="depotCCPTransDays" DataMemberBinding="{Binding LEAVEAPOE}"/>
                            <telerik:GridViewDataColumn Width=".020*" Background="#6DFFFFFF" Header="Delivery Date" TextAlignment="Center" ColumnGroupName="depotCCPTransDays" DataMemberBinding="{Binding DELIVERYDATE}"/>
                            <telerik:GridViewDataColumn Width=".25*" Background="#6DFFFFFF" Header="Remarks" TextAlignment="Center" DataMemberBinding="{Binding REMARKS}"/>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </telerik:RadTabItem>
</telerik:RadTabControl>
0
Accepted
Yordanka
Telerik team
answered on 07 Jun 2012, 02:53 PM
Hello Adam,

You should use Name property when define column group:

<telerik:GridViewColumnGroup Name="directCustomerDays" Header=""/>
 
Regards,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Adam
Top achievements
Rank 2
answered on 07 Jun 2012, 02:58 PM
Agreed,
But how is your syntax different from mine that I supplied above?

Yours:
<telerik:GridViewColumnGroup Name="directCustomerDays" Header=""/>

Mine:
 <telerik:GridViewColumnGroup x:Name="directCustomerDays" Header=""/>  
0
Accepted
Yordanka
Telerik team
answered on 07 Jun 2012, 03:16 PM
Hello,

In short, the column groups are not visual elements and the logic behind x:Name won't work in this case.
 
Kind regards,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Adam
Top achievements
Rank 2
answered on 07 Jun 2012, 03:18 PM
Ah, I got it.

Thanks again!

Adam
Tags
GridView
Asked by
Adam
Top achievements
Rank 2
Answers by
Pavel Pavlov
Telerik team
Adam
Top achievements
Rank 2
Yordanka
Telerik team
Share this question
or