Click here to Skip to main content
15,894,460 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I am creating some Custom Paging for my GridView , for that I have used PagerTemplate and inside PagerTemplate I have some Placeholder as Ph1, and in code behind, I am finding the placeholder as:
C#
GridViewRow row = grdview.BottomPagerRow;
ph1 = (PlaceHolder)row.FindControl("ph1");

But the value for BottomPagerRow is always getting Null .
I have been googled from last 3 hours and will not find any solution .

Please help ..
Posted
Updated 10-Jun-16 1:18am
v2

1 solution

1. check if grdview is populated with data, if not, bottompagerrow stays null.
2. make the type of row: GridViewPagerRow:
GridViewPagerRow row = grdview.BottomPagerRow;
ph1 = (PlaceHolder)row.FindControl("ph1");

even better would be to user
GridViewPagerRow row = (GridViewPagerRow)grdview.BottomPagerRow;
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900