Placing a button in HeaderRow Selector

4 posts, 0 answers
  1. Muds
    Muds avatar
    17 posts
    Member since:
    Jan 2015

    Posted 27 Jan 2015 Link to this post

    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.
  2. Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 28 Jan 2015 Link to this post

    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.

     
  3. Muds
    Muds avatar
    17 posts
    Member since:
    Jan 2015

    Posted 28 Jan 2015 Link to this post

    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.
  4. Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 29 Jan 2015 Link to this post

    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.

     
Back to Top