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

Grid events not working as intended

3 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Domantas
Top achievements
Rank 1
Domantas asked on 31 Aug 2015, 05:52 AM

Hello,
I've been working with radgrids lately and they are working very inconsistently for me. 
Here is my latest grid:

 [CODE]          <telerik:RadGrid ID="PermissionsGrid" runat="server" AllowPaging="True"              CellSpacing="0" GridLines="None" AutoGenerateColumns="false" OnPageSizeChanged="PermissionsGrid_PageSizeChanged"             OnPageIndexChanged="PermissionsGrid_PageIndexChanged" OnNeedDataSource="PermissionsGrid_OnNeedDataSource"             EnableLinqExpressions="False" Skin="Tabbed" EnableEmbeddedSkins="False" AllowCustomPaging="True"             OnPreRender="PermissionsGrid_PreRender" OnInit="PermissionsGrid_Init">             <ClientSettings>                 <Selecting AllowRowSelect="false"></Selecting>                 <Scrolling AllowScroll="True" UseStaticHeaders="true"></Scrolling>                 <Resizing AllowColumnResize="True" />             </ClientSettings>  [/CODE]

However the pageindexchanged event was not fiiring, therefore I added rebind on postback, which then fired onneeddatasource which made the page index changed event fire only then, which was very weird, as well it only worked if i did databind on the radgrid once again (rebind was not working).
Now I am having problem with PageSizeChanged event, was not inteding to put it, but it is not working for me at all. However this time it's neither fiiring even after rebinding on postback and I cant seem to find why.  

Init and prerender are only for nestedViewTemplate purposes, therefore there is nothing interesting there.

I am using one of the newer telerik controls (2015.2.623.35)

As well as the pager dissapears even if I set pager style on mastertableview as always visible, on in the grid itself and even in the code, it does not intend to stay even with all this code on its back. I am out of ideas and I need help with this.

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 02 Sep 2015, 01:06 PM
Hello Domantas,

I examined the provided markup and noticed that custom paging is enabled for RadGrid. Note that when this option is enabled you should perform the paging manually. Check out the following article for additional information.


With that said, please remove the AllowCustomPaging property from RadGrid. Also set AllowPaging to true. Note that the default page size is 10. You can specify how many items would be shown per page via the PageSIze property.

In addition, you can remove the AllowScroll and UseStaticHeaders properties. They are not necessary in this case since you would be using paging.

Moreover, I would recommend to implement the behavior you would like with one of the built-in skins first and then apply custom look and feel for the control.

Regards,
Viktor Tachev
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
Domantas
Top achievements
Rank 1
answered on 03 Sep 2015, 07:44 AM
Yes, it is enabled, and I did the custom paging. 
I'm not at work at this moment, but the code was simple
Existing grid pageindex = new page index, and that is it.
However pageindexchanged event was just not fiiring, only if i do extra rebind for the grid on postback the event fires, which is not THAT bad and I could live with that, but the thing is that page size changed event is not working as intended and I still can't seem to find why. 
0
Viktor Tachev
Telerik team
answered on 04 Sep 2015, 02:18 PM
Hello,

Please send us your complete markup with the related code behind. Thus, we will be able to examine the setup and look for what could cause the behavior.

Regards,
Viktor Tachev
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
Tags
Grid
Asked by
Domantas
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Domantas
Top achievements
Rank 1
Share this question
or