The following is the Markup.
<Grid Grid.Row="4" Grid.Column="0" >
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!--RadGridView for View Workforce Plan-->
<Tele:RadGridView Name="RgvViewWorkforcePlan" GridLinesVisibility="Both" IsReadOnly="True" AutoGenerateColumns="False" VerticalAlignment="Stretch"
CanUserFreezeColumns="False" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" Width="Auto"
ScrollViewer.VerticalScrollBarVisibility="auto" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="auto" SnapsToDevicePixels="False" VerticalContentAlignment="Top"
ItemsSource="{Binding TempGridData,Mode=OneWay}" CanUserResizeColumns="False" SelectionMode="Single" SelectionUnit="FullRow" SelectedItem="{Binding SelectedGridItem,Mode=TwoWay}"
Background="#EAF3FC">
<!--It creates a column group in which we can merge column headers as needed-->
<Tele:RadGridView.ColumnGroups>
<Tele:GridViewColumnGroup Name="MonthName">
<Tele:GridViewColumnGroup.HeaderTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#EAF3FC" >
<Grid.RowDefinitions>
<RowDefinition Height="23"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Name="lblMonthName" Grid.Row="0" Grid.Column="0" Content="August - 2012" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" Padding="0.3" ></Label>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Stretch" Width="Auto">
<Button Name="btnFirst" HorizontalAlignment="Center" VerticalAlignment="Center" Content="<<"/>
<Button Name="btnPrevious" HorizontalAlignment="Center" VerticalAlignment="Center" Content="<"/>
<Button Name="btnNext" HorizontalAlignment="Center" VerticalAlignment="Center" Content=">" Click="btnNext_Click"/>
<Button Name="btnLast" HorizontalAlignment="Center" VerticalAlignment="Center" Content=">>"/>
</StackPanel>
</Grid>
</DataTemplate>
</Tele:GridViewColumnGroup.HeaderTemplate>
</Tele:GridViewColumnGroup>
</Tele:RadGridView.ColumnGroups>
<Tele:RadGridView.Columns>
<Tele:GridViewDataColumn Header="" HeaderCellStyle="{StaticResource GridDropHeaderCell}">
<!--<Tele:GridViewColumn.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Button Grid.Row="0" Grid.Column="0" Content="test Button" ></Button>
</Grid>
</Tele:GridViewColumn.Header>-->
<Tele:GridViewColumn.CellTemplate>
<DataTemplate>
<Tele:RadButton Name="BtnDeleteComponent" Width="21" Style="{StaticResource GridButton}" ToolTip="Delete" VerticalAlignment="Top" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="0" Margin="0,1,0,0" Background="Transparent" Height="21" Padding="0" Foreground="Transparent" BorderBrush="Transparent" BorderThickness="0" DataContext="{Binding componentCode}">
<Image Name="ImgSearchGenCode" Source="Images\DeleteButton.png" Width="21" Height="21" Cursor="Hand" OpacityMask="#D3E6FF" AllowDrop="False" HorizontalAlignment="Center" VerticalAlignment="Top"></Image>
</Tele:RadButton>
</DataTemplate>
</Tele:GridViewColumn.CellTemplate>
</Tele:GridViewDataColumn>
<Tele:GridViewDataColumn Header="Job Type" DataMemberBinding="{Binding jobType,Mode=OneWay}" HeaderCellStyle="{StaticResource GridDropHeaderCell}">
</Tele:GridViewDataColumn>
<Tele:GridViewDataColumn Header="Branch/Gen" DataMemberBinding="{Binding branchGeneratorCode,Mode=OneWay}" HeaderCellStyle="{StaticResource GridDropHeaderCell}" Width="80">
</Tele:GridViewDataColumn>
<Tele:GridViewDataColumn Header="Custom Data field TBD" DataMemberBinding="{Binding customDataField,Mode=OneWay}" HeaderCellStyle="{StaticResource GridDropHeaderCell}" Width="132" >
</Tele:GridViewDataColumn>
</<Tele:RadGridView>
<Grid>
In the above markup I added a Label control, Panel and controls in GridViewColumnGroup.HeaderTemplate. In the Panel added 4 buttons. My issue is I can't able to find those control which are added in GridViewColumnGroup.HeaderTemplate in code behind .cs file. I need to update the Label content and set the button enable and disable as per business requirement.
Please help me to resolve this issue.
one more issue I have is I am adding columns in the grid at run time and assigning those column ColumGroupName="MonthName" which I set in Markup but first time it work fine when and sets a comon Column Group Header. I click on next button I am creating some more columns again in the grid and adding with same ColumGroupName="MonthName" in that case, for next time dynamically added columns the ColumnGroupName is not working so It is not putting next time dynamically added column in the same Colum Group Header.
Waiting for your quick response.
Thanks
Laxman
<Grid Grid.Row="4" Grid.Column="0" >
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<!--RadGridView for View Workforce Plan-->
<Tele:RadGridView Name="RgvViewWorkforcePlan" GridLinesVisibility="Both" IsReadOnly="True" AutoGenerateColumns="False" VerticalAlignment="Stretch"
CanUserFreezeColumns="False" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" Width="Auto"
ScrollViewer.VerticalScrollBarVisibility="auto" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="auto" SnapsToDevicePixels="False" VerticalContentAlignment="Top"
ItemsSource="{Binding TempGridData,Mode=OneWay}" CanUserResizeColumns="False" SelectionMode="Single" SelectionUnit="FullRow" SelectedItem="{Binding SelectedGridItem,Mode=TwoWay}"
Background="#EAF3FC">
<!--It creates a column group in which we can merge column headers as needed-->
<Tele:RadGridView.ColumnGroups>
<Tele:GridViewColumnGroup Name="MonthName">
<Tele:GridViewColumnGroup.HeaderTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#EAF3FC" >
<Grid.RowDefinitions>
<RowDefinition Height="23"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Label Name="lblMonthName" Grid.Row="0" Grid.Column="0" Content="August - 2012" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" Padding="0.3" ></Label>
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Stretch" Width="Auto">
<Button Name="btnFirst" HorizontalAlignment="Center" VerticalAlignment="Center" Content="<<"/>
<Button Name="btnPrevious" HorizontalAlignment="Center" VerticalAlignment="Center" Content="<"/>
<Button Name="btnNext" HorizontalAlignment="Center" VerticalAlignment="Center" Content=">" Click="btnNext_Click"/>
<Button Name="btnLast" HorizontalAlignment="Center" VerticalAlignment="Center" Content=">>"/>
</StackPanel>
</Grid>
</DataTemplate>
</Tele:GridViewColumnGroup.HeaderTemplate>
</Tele:GridViewColumnGroup>
</Tele:RadGridView.ColumnGroups>
<Tele:RadGridView.Columns>
<Tele:GridViewDataColumn Header="" HeaderCellStyle="{StaticResource GridDropHeaderCell}">
<!--<Tele:GridViewColumn.Header>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Button Grid.Row="0" Grid.Column="0" Content="test Button" ></Button>
</Grid>
</Tele:GridViewColumn.Header>-->
<Tele:GridViewColumn.CellTemplate>
<DataTemplate>
<Tele:RadButton Name="BtnDeleteComponent" Width="21" Style="{StaticResource GridButton}" ToolTip="Delete" VerticalAlignment="Top" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="0" Margin="0,1,0,0" Background="Transparent" Height="21" Padding="0" Foreground="Transparent" BorderBrush="Transparent" BorderThickness="0" DataContext="{Binding componentCode}">
<Image Name="ImgSearchGenCode" Source="Images\DeleteButton.png" Width="21" Height="21" Cursor="Hand" OpacityMask="#D3E6FF" AllowDrop="False" HorizontalAlignment="Center" VerticalAlignment="Top"></Image>
</Tele:RadButton>
</DataTemplate>
</Tele:GridViewColumn.CellTemplate>
</Tele:GridViewDataColumn>
<Tele:GridViewDataColumn Header="Job Type" DataMemberBinding="{Binding jobType,Mode=OneWay}" HeaderCellStyle="{StaticResource GridDropHeaderCell}">
</Tele:GridViewDataColumn>
<Tele:GridViewDataColumn Header="Branch/Gen" DataMemberBinding="{Binding branchGeneratorCode,Mode=OneWay}" HeaderCellStyle="{StaticResource GridDropHeaderCell}" Width="80">
</Tele:GridViewDataColumn>
<Tele:GridViewDataColumn Header="Custom Data field TBD" DataMemberBinding="{Binding customDataField,Mode=OneWay}" HeaderCellStyle="{StaticResource GridDropHeaderCell}" Width="132" >
</Tele:GridViewDataColumn>
</<Tele:RadGridView>
<Grid>
In the above markup I added a Label control, Panel and controls in GridViewColumnGroup.HeaderTemplate. In the Panel added 4 buttons. My issue is I can't able to find those control which are added in GridViewColumnGroup.HeaderTemplate in code behind .cs file. I need to update the Label content and set the button enable and disable as per business requirement.
Please help me to resolve this issue.
one more issue I have is I am adding columns in the grid at run time and assigning those column ColumGroupName="MonthName" which I set in Markup but first time it work fine when and sets a comon Column Group Header. I click on next button I am creating some more columns again in the grid and adding with same ColumGroupName="MonthName" in that case, for next time dynamically added columns the ColumnGroupName is not working so It is not putting next time dynamically added column in the same Colum Group Header.
Waiting for your quick response.
Thanks
Laxman