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

Add button to RadGrid Header

2 Answers 701 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 16 Dec 2019, 01:49 PM

I am working with a RadGrid, I've followed several examples but nothing seems to work for what I want.

In my picture I show my example of what I am wanting.  I want a button to appear in the header portion of the RadGrid next to Page Size.

Thanks

2 Answers, 1 is accepted

Sort by
0
Jim
Top achievements
Rank 1
answered on 16 Dec 2019, 07:43 PM

I could not get a button to work in the RadGrid, instead I added an asp Button, in a CommandItemTemplate, in the MasterTableView.

I had to add the option CommandItemDisplay="Top" in the MasterTableView.

I used a combination of the answers here 

https://www.telerik.com/forums/how-to-add-a-custom-button-to-the-commanditem-of-my-radgrid-control-and-enable-it-to-postback-its-click-event

https://www.telerik.com/forums/radgrid-insert-button-missing

 

0
Attila Antal
Telerik team
answered on 19 Dec 2019, 10:58 AM

Hi Jim,

One way to achieve this scenario would be to create a Pager Template and handle the paging yourself using Commands: 

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True">
    <MasterTableView>
        <PagerTemplate>
            <%--Your controls here including the ones that will handle paging--%>
        </PagerTemplate>
    </MasterTableView>
</telerik:RadGrid>

 

Another option you can try is to access the PagerItem in the server side and add your custom button to it.

I advise that you review the following articles to get a better understanding on how to access the item:

Kind regards,
Attila Antal
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Jim
Top achievements
Rank 1
Answers by
Jim
Top achievements
Rank 1
Attila Antal
Telerik team
Share this question
or