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

Customize GridView Paging panel

12 Answers 150 Views
GridView
This is a migrated thread and some comments may be shown as answers.
British
Top achievements
Rank 1
British asked on 06 Mar 2016, 12:07 PM

hi

i use paging in my winform grid view.everytrhing is ok.

but i wanna customize the panel paging. for example disable ShowFastBackButton and ShowFastForwardButton in panel paging.

in this page it said that :

There are a number of properties, which allow you to customize the paging panel to your specific needs. You can access these properties through the RadGridView.GridViewElement.PagingPanelElement.

i want change these properties in design time not by code, but i cant find any of these properties in property grid or in property builder.

i have another question and that is about TextBoxStripElement in paging panel. iwant localize that and put my text intead of page and of in TextBoxStripElement.

is there any solution for these two question?

Best Regard

 

12 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Mar 2016, 10:48 AM
Hello ,

Thank you for writing.

You can access the RadGridView.GridViewElement.PagingPanelElement only programmatically. It is not possible to customize which button elements to be displayed at design time.

As to the question about localizing the TextBoxStripElement, feel free to use the RadGridLocalizationProvider and specify the RadGridStringId.PagingPanelPagesLabel and RadGridStringId.PagingPanelOfPagesLabel texts. Additional information is available here: http://docs.telerik.com/devtools/winforms/gridview/localization/localization

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
British
Top achievements
Rank 1
answered on 08 Mar 2016, 01:00 PM

Hi

Thanks for reply.

in did all you said and work fine.

but here i have question:

page number text box content in StripElementTextBox is align to left but i wanna align to middle center

i try the code below but not worked:

1.MyGridView.GridViewElement.PagingPanelElement.PageNumberTextBox.TextAlignment = ContentAlignment.MiddleCenter;

thanks in advanced
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Mar 2016, 01:36 PM
Hello ,

Thank you for writing back. 

In order to center the text of the PageNumberTextBox, you can use the following code snippet:
this.radGridView1.GridViewElement.PagingPanelElement.PageNumberTextBox.TextBoxElement.TextAlign = HorizontalAlignment.Center;

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Aseman
Top achievements
Rank 1
Veteran
answered on 15 Dec 2019, 11:12 AM

Hi Dear Dess

I`d like to change the number button Count Manually By assign  value in its property but I couldn`t .Do you know Why ?

RadGridView.GridViewElement.PagingPanelElement.NumericButtonsCount=5;

it Doesn`t Work unfortunately!

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Dec 2019, 12:39 PM

Hello, Aseman,    

The NumericButtonsCount property controls how many buttons for navigation to concrete pages there are on the panel.

NumericButtonsCount = 3:

NumericButtonsCount 5:

Note that considering the total records in your DataSource and the specified PageSize you have to be careful what value you set in the NumericButtonsCount. For example, if you have 100 records in the applied DataSource and the PageSize is 20, it is expected to have 5 as NumericButtonsCount.

If you are still experiencing any further difficulties, please give us some more details about the exact requirement that you are trying to achieve. Thus, we would be able to get better understanding of the precise case and assist you further. Thank you in advance.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
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.
0
Aseman
Top achievements
Rank 1
Veteran
answered on 16 Dec 2019, 01:05 PM

Hello 

As I said In another Post ,

I wrote Custom Pagination (Server Side Paging) on Win Form By use of Linq to Sql`(Because Of 2 Million Records ) relatively successful. so I`m loading  20 (Page Size) Records for every page in my Data source
.it means I don`t use a data source with 2 million records in Back of the Form .

Question:

1- I can Not set the numeric button Count On Loading. why?
RadGridView.GridViewElement.PagingPanelElement.NumericButtonsCount=5; <it doesn`t Work>
I have just One button in numeric button Count Controls 

 

2- can I have event for numeric button in paging panel element in grid view in win Form ?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Dec 2019, 07:42 AM
Hello, Aseman,     

If you have your custom implementation for paging, note that the built-in paging panel actually takes into consideration the total number of rows in the RadGridView.Rows collection. If you have a DataSource collection that stores only the records for the current page, it is normal that only one button will be displayed. In order to obtain more page number buttons, feel free to reduce the page size and thus if you have 20 records in the DataSource and the page size is 5, you are expected to obtain 4 pages and 4 page number buttons respectively.

However, I would like to suggest you using RadVirtualGrid. It is a grid component developed on top of Telerik Presentation Framework which provides a convenient way to implement your own data management operations and optimizes the performance when interacting with large amounts of data. It also supports paging and the data is loaded on demand with firing the CellValueNeeded event. Additional information is available in the online documentation: https://docs.telerik.com/devtools/winforms/controls/virtualgrid/overview.html 

I hope this information helps. 

 

Regards,
Dess | Tech Support Engineer, Sr.
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.
0
Aseman
Top achievements
Rank 1
Veteran
answered on 17 Dec 2019, 12:53 PM

Thank you for helping me improve.

As You said in Server Side Paging ,I can not Set 

RadGridView.GridViewElement.PagingPanelElement.NumericButtonsCount

More than 1.

Thank you So Much Again

0
Er
Top achievements
Rank 1
answered on 23 Feb 2021, 12:09 PM

Hi, 

How can I change the Tab color  (PagingPanelElement)  ?  from orange 

Picture attached 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Feb 2021, 02:16 PM

Hi, Er,

The easiest way to customize the color for the toggled page button in RadGridView is to iterate the toggle buttons and override their color for the toggled state: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/override-theme-settings-at-run-time

I have prepared a sample code snippet for your reference:

        private void RadGridView1_PageChanged(object sender, EventArgs e)
        { 
            foreach (var item in this.radGridView1.GridViewElement.PagingPanelElement.ButtonsStripElement.Items)
            {
                CommandBarToggleButton toggleButton = item as CommandBarToggleButton;
                if (toggleButton != null)
                {
                    toggleButton.SetThemeValueOverride(LightVisualElement.BackColorProperty,
                        Color.Red, "CommandBarToggleButton.Toggled");
                    toggleButton.SetThemeValueOverride(LightVisualElement.GradientStyleProperty,
                        GradientStyles.Solid, "CommandBarToggleButton.Toggled");
                }
            }
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Er
Top achievements
Rank 1
answered on 23 Feb 2021, 06:15 PM

I getting error about SetThemeValueOverride

 

SeverityCodeDescriptionProjectFileLineSuppression State
ErrorCS1061'CommandBarToggleButton' does not contain a definition for 'SetThemeValueOverride' and no accessible extension method 'SetThemeValueOverride' accepting a first argument of type 'CommandBarToggleButton' could be found (


0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Feb 2021, 09:34 AM

Hello, Er,

I have attached my sample project for your reference. Please give it a try and see how it works on your end.

The SetThemeValueOverride method was introduced in Q3 2015 (version 2015.3.930). Please make sure that you are not using an older version of the Telerik UI for WinForms suite.

I believe that you will find the provided application useful.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
British
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
British
Top achievements
Rank 1
Aseman
Top achievements
Rank 1
Veteran
Er
Top achievements
Rank 1
Share this question
or