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

Placing a button in HeaderRow Selector

3 Answers 367 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Muds
Top achievements
Rank 1
Muds asked on 27 Jan 2015, 05:02 PM
Hi

We are new to telerik and still trying to evaluate RadDataGrid

Can you please provide me with an sample explaining how  can I override Header Row Selector to have a button inside it.

Thanks
M.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 28 Jan 2015, 05:14 PM
Hello Mudit,

In order to add a Button to the GridView Header Row please check the code snippet below:
<telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn.Header>
            <Button/>
        </telerik:GridViewDataColumn.Header>
    </telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>

In addition you can check how to customize the Header Row in the Styling the Header Row documentation article.

Let me know how this works for you.

Kind Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Muds
Top achievements
Rank 1
answered on 28 Jan 2015, 05:20 PM
Hi Stefan

Thanks for posting a reply, but unfortunately I wasn't looking for this. the solution that you have suggested will place a button in a  column header whereas I wanted to have a button in ROW SELECTOR of Column Row, which is the top left area of the grid.

Please have a look at the attachment.

Thanks
M.
0
Stefan
Telerik team
answered on 29 Jan 2015, 01:57 PM
Hi Mudit,

The cell you are referring to is called GridViewHeader IndentCell. You can customize it if you are using the NoXAML binaries with Implicit Themes. You can read more about this topic in the Setting a Theme(Implicit Styles) documentation article.

To add a Button as in the image you sent us, you should open the Telerik.Windows.Controls.GridView.xaml file, search for a Border tag named "PART_IndicatorPresenter" and add the Button in it. Please check the code snippet below:
<Border x:Name="PART_IndicatorPresenter"
        Grid.Row="1"
        Width="25"
        BorderBrush="{TemplateBinding BorderBrush}"
        BorderThickness="0 0 1 1"
        Visibility="{TemplateBinding RowIndicatorVisibility}"
        grid:SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical">
    <Border BorderBrush="{StaticResource GridView_HeaderInnerBorder}"
            Background="{StaticResource GridView_HeaderBackground}"
            BorderThickness="1">
        <telerik:RadButton Content="Btn"/>
    </Border>
</Border>


In addition you can check our documentation article on Styling the Indent Cells in RadGridView.

Kind Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Muds
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Muds
Top achievements
Rank 1
Share this question
or