From: someone on
Alexey Smirnov escribi�:
> On Dec 17, 3:31 am, <some...(a)microsoft.com> wrote:
>> Well, the error is here:
>> protected void Page_Load(object sender, EventArgs e)
>> {
>> gridview1.BottomPagerRow.Visible = true; //**ERROR**//
>> if (!IsPostBack)
>> {
>> OnViewInitialized();
>> }
>> OnViewLoaded();
>>
>> }
>>
>> It looks like it can't find the BottomPagerRow at that time.
>> But I don't know why...
>>
>> Thanks for you help.
>> Regards,
>> Marcelo."Alexey Smirnov" <alexey.smir...(a)gmail.com> wrote in message
>>
>> news:a3bc0322-f87f-4bb3-bdd2-a3fcac5e22e9(a)u20g2000vbq.googlegroups.com...
>> On Dec 16, 4:13 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
>> wrote:
>>
>>
>>
>>
>>
>>>> Why did you add it into gridview1_DataBound? I think this is the
>>>> problem. Try Page_Load instead
>>> Thanks Alexey for your answer.
>>> I added it into gridview1_DataBound because I found some link where it
>>> said that it must be added after databinding.
>>> I'm not good enough with asp.net and english yet. =)
>>> When I try to add it to Page_Load() I receive an error:
>>> System.NullReferenceException: Object reference not set to an instance
>>> of an object.
>>> Thanks again.
>>> Alexey Smirnov escribi�:
>>>> On Dec 16, 3:31 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
>>>> wrote:
>>>>> Hi again,
>>>>> I added this method:
>>>>> protected void gridview1_DataBound(object sender, EventArgs e)
>>>>> {
>>>>> gridview1.BottomPagerRow.Visible = true;
>>>>> }
>>>>> Now when the record per pages is set to 100 and the number of record of
>>>>> the query is lower (80 records as an example), now the PagerTemplate
>>>>> appears in the webpage, but if I press the next or previous button the
>>>>> PagerTemplates dissapears.
>>>>> I think I have to set the BottomPagerRow property to true in another
>>>>> method but I don't know wich one.
>>>>> Regards,
>>>>> Marcelo.
>>>>> Alexey Smirnov escribi�:
>>>>>> On Dec 15, 8:01 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
>>>>>> wrote:
>>>>>>> Hi,
>>>>>>> I have added a PagerTemplate to a gridview, where I can select how
>>>>>>> many
>>>>>>> records I want to show per page(20/50/100). I use this to set the
>>>>>>> gridview pagesize.
>>>>>>> The fact is that when I have 80 records to show and the gridview
>>>>>>> pagesize is set to 100, the PagerTemplate dissapear, and I can't set
>>>>>>> the
>>>>>>> records per page until I do a new query.
>>>>>>> Is there a way to set the PagerTemplate always visible?.
>>>>>>> In advance thanks for any help.
>>>>>>> Regards,
>>>>>>> Marcelo.
>>>>>> Try to set the BottomPagerRow property to true.
>>>>>> In addition, take a look
>>>>>> athttp://www.ryanmcdonnell.com/always-show-the-pagertemplate-in-gridvie...
>>>>>> Hope this helps- Hide quoted text -
>>>>> - Show quoted text -- Hide quoted text -
>>> - Show quoted text -
>> It tells that somewhere is an error. How did you setup the grid, is it
>> created in the code? Maybe you can post the complete code here...- Hide quoted text -
>>
>> - Show quoted text -
>
> Ah, I see. You should call BottomPagerRow after you binded the grid.
>
> Like this
>
> protected void Page_Load(object sender, EventArgs e)
> {
> if (!IsPostBack)
> {
> OnViewInitialized();
> }
> OnViewLoaded();
>
> gridview1.BottomPagerRow.Visible = true;
>
> }


Hi Alexey, (Excuse me I sent this to your personal email by error)
If I put it there I think is called just when the page is loaded, but
not when I press the next or previous button, I think this is because de
gridview is in a updatepanel, so not all the page is updated when I
change the page number.
Is there any other place where I can put the method to be called
everytime I change the page?

Thanks a lot for your time.
Regards,
Marcelo.
From: Alexey Smirnov on
On Dec 17, 2:01 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
wrote:
> Alexey Smirnov escribió:
>
>
>
>
>
> > On Dec 17, 3:31 am, <some...(a)microsoft.com> wrote:
> >> Well, the error is here:
> >> protected void Page_Load(object sender, EventArgs e)
> >> {
> >>         gridview1.BottomPagerRow.Visible = true; //**ERROR**//
> >>         if (!IsPostBack)
> >>         {
> >>                 OnViewInitialized();
> >>           }
> >>     OnViewLoaded();
>
> >> }
>
> >> It looks like it can't find the BottomPagerRow at that time.
> >> But I don't know why...
>
> >> Thanks for you help.
> >> Regards,
> >> Marcelo."Alexey Smirnov" <alexey.smir...(a)gmail.com> wrote in message
>
> >>news:a3bc0322-f87f-4bb3-bdd2-a3fcac5e22e9(a)u20g2000vbq.googlegroups.com....
> >> On Dec 16, 4:13 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> >> wrote:
>
> >>>> Why did you add it into gridview1_DataBound? I think this is the
> >>>> problem. Try Page_Load instead
> >>> Thanks Alexey for your answer.
> >>> I added it into gridview1_DataBound because I found some link where it
> >>> said that it must be added after databinding.
> >>> I'm not good enough with asp.net and english yet. =)
> >>> When I try to add it to Page_Load() I receive an error:
> >>> System.NullReferenceException: Object reference not set to an instance
> >>> of an object.
> >>> Thanks again.
> >>> Alexey Smirnov escribió:
> >>>> On Dec 16, 3:31 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> >>>> wrote:
> >>>>> Hi again,
> >>>>> I added this method:
> >>>>> protected void gridview1_DataBound(object sender, EventArgs e)
> >>>>> {
> >>>>> gridview1.BottomPagerRow.Visible = true;
> >>>>> }
> >>>>> Now when the record per pages is set to 100 and the number of record of
> >>>>> the query is lower (80 records as an example), now the PagerTemplate
> >>>>> appears in the webpage, but if I press the next or previous button the
> >>>>> PagerTemplates dissapears.
> >>>>> I think I have to set the BottomPagerRow property to true in another
> >>>>> method but I don't know wich one.
> >>>>> Regards,
> >>>>> Marcelo.
> >>>>> Alexey Smirnov escribió:
> >>>>>> On Dec 15, 8:01 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> >>>>>> wrote:
> >>>>>>> Hi,
> >>>>>>> I have added a PagerTemplate to a gridview, where I can select how
> >>>>>>> many
> >>>>>>> records I want to show per page(20/50/100). I use this to set the
> >>>>>>> gridview pagesize.
> >>>>>>> The fact is that when I have 80 records to show and the gridview
> >>>>>>> pagesize is set to 100, the PagerTemplate dissapear, and I can't set
> >>>>>>> the
> >>>>>>> records per page until I do a new query.
> >>>>>>> Is there a way to set the PagerTemplate always visible?.
> >>>>>>> In advance thanks for any help.
> >>>>>>> Regards,
> >>>>>>> Marcelo.
> >>>>>> Try to set the BottomPagerRow property to true.
> >>>>>> In addition, take a look
> >>>>>> athttp://www.ryanmcdonnell.com/always-show-the-pagertemplate-in-gridvie...
> >>>>>> Hope this helps- Hide quoted text -
> >>>>> - Show quoted text -- Hide quoted text -
> >>> - Show quoted text -
> >> It tells that somewhere is an error. How did you setup the grid, is it
> >> created in the code? Maybe you can post the complete code here...- Hide quoted text -
>
> >> - Show quoted text -
>
> > Ah, I see. You should call BottomPagerRow after you binded the grid.
>
> > Like this
>
> >  protected void Page_Load(object sender, EventArgs e)
> > {
> >              if (!IsPostBack)
> >         {
> >                 OnViewInitialized();
> >           }
> >     OnViewLoaded();
>
> >    gridview1.BottomPagerRow.Visible = true;
>
> > }
>
> Hi Alexey, (Excuse me I sent this to your personal email by error)
> If I put it there I think is called just when the page is loaded, but
> not when I press the next or previous button, I think this is because de
> gridview is in a updatepanel, so not all the page is updated when I
> change the page number.
> Is there any other place where I can put the method to be called
> everytime I change the page?
>
> Thanks a lot for your time.
> Regards,
> Marcelo.- Hide quoted text -
>
> - Show quoted text -

I think i got it, do you have gridview1_SelectedIndexChanged method?
You need to put gridview1.BottomPagerRow.Visible = true there
From: someone on
Hi Alexey,
The solution didn't work.
There must be another place to set the property...

Thanks a lot for your help.
Regards,
"Alexey Smirnov" <alexey.smirnov(a)gmail.com> wrote in message
news:82870d23-2ad0-4ffb-a41a-850e64780d52(a)r24g2000yqd.googlegroups.com...
On Dec 17, 2:01 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
wrote:
> Alexey Smirnov escribi�:
>
>
>
>
>
> > On Dec 17, 3:31 am, <some...(a)microsoft.com> wrote:
> >> Well, the error is here:
> >> protected void Page_Load(object sender, EventArgs e)
> >> {
> >> gridview1.BottomPagerRow.Visible = true; //**ERROR**//
> >> if (!IsPostBack)
> >> {
> >> OnViewInitialized();
> >> }
> >> OnViewLoaded();
>
> >> }
>
> >> It looks like it can't find the BottomPagerRow at that time.
> >> But I don't know why...
>
> >> Thanks for you help.
> >> Regards,
> >> Marcelo."Alexey Smirnov" <alexey.smir...(a)gmail.com> wrote in message
>
> >>news:a3bc0322-f87f-4bb3-bdd2-a3fcac5e22e9(a)u20g2000vbq.googlegroups.com...
> >> On Dec 16, 4:13 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> >> wrote:
>
> >>>> Why did you add it into gridview1_DataBound? I think this is the
> >>>> problem. Try Page_Load instead
> >>> Thanks Alexey for your answer.
> >>> I added it into gridview1_DataBound because I found some link where it
> >>> said that it must be added after databinding.
> >>> I'm not good enough with asp.net and english yet. =)
> >>> When I try to add it to Page_Load() I receive an error:
> >>> System.NullReferenceException: Object reference not set to an instance
> >>> of an object.
> >>> Thanks again.
> >>> Alexey Smirnov escribi�:
> >>>> On Dec 16, 3:31 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> >>>> wrote:
> >>>>> Hi again,
> >>>>> I added this method:
> >>>>> protected void gridview1_DataBound(object sender, EventArgs e)
> >>>>> {
> >>>>> gridview1.BottomPagerRow.Visible = true;
> >>>>> }
> >>>>> Now when the record per pages is set to 100 and the number of record
> >>>>> of
> >>>>> the query is lower (80 records as an example), now the PagerTemplate
> >>>>> appears in the webpage, but if I press the next or previous button
> >>>>> the
> >>>>> PagerTemplates dissapears.
> >>>>> I think I have to set the BottomPagerRow property to true in another
> >>>>> method but I don't know wich one.
> >>>>> Regards,
> >>>>> Marcelo.
> >>>>> Alexey Smirnov escribi�:
> >>>>>> On Dec 15, 8:01 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> >>>>>> wrote:
> >>>>>>> Hi,
> >>>>>>> I have added a PagerTemplate to a gridview, where I can select how
> >>>>>>> many
> >>>>>>> records I want to show per page(20/50/100). I use this to set the
> >>>>>>> gridview pagesize.
> >>>>>>> The fact is that when I have 80 records to show and the gridview
> >>>>>>> pagesize is set to 100, the PagerTemplate dissapear, and I can't
> >>>>>>> set
> >>>>>>> the
> >>>>>>> records per page until I do a new query.
> >>>>>>> Is there a way to set the PagerTemplate always visible?.
> >>>>>>> In advance thanks for any help.
> >>>>>>> Regards,
> >>>>>>> Marcelo.
> >>>>>> Try to set the BottomPagerRow property to true.
> >>>>>> In addition, take a look
> >>>>>> athttp://www.ryanmcdonnell.com/always-show-the-pagertemplate-in-gridvie...
> >>>>>> Hope this helps- Hide quoted text -
> >>>>> - Show quoted text -- Hide quoted text -
> >>> - Show quoted text -
> >> It tells that somewhere is an error. How did you setup the grid, is it
> >> created in the code? Maybe you can post the complete code here...- Hide
> >> quoted text -
>
> >> - Show quoted text -
>
> > Ah, I see. You should call BottomPagerRow after you binded the grid.
>
> > Like this
>
> > protected void Page_Load(object sender, EventArgs e)
> > {
> > if (!IsPostBack)
> > {
> > OnViewInitialized();
> > }
> > OnViewLoaded();
>
> > gridview1.BottomPagerRow.Visible = true;
>
> > }
>
> Hi Alexey, (Excuse me I sent this to your personal email by error)
> If I put it there I think is called just when the page is loaded, but
> not when I press the next or previous button, I think this is because de
> gridview is in a updatepanel, so not all the page is updated when I
> change the page number.
> Is there any other place where I can put the method to be called
> everytime I change the page?
>
> Thanks a lot for your time.
> Regards,
> Marcelo.- Hide quoted text -
>
> - Show quoted text -

I think i got it, do you have gridview1_SelectedIndexChanged method?
You need to put gridview1.BottomPagerRow.Visible = true there


From: someone on
I added this and now it's working ok:
protected void gridview1_PreRender(object sender, EventArgs e)
{
GridView grid = (GridView)sender;
switch (grid.PagerSettings.Position)
{
case PagerPosition.Bottom:
grid.BottomPagerRow.Visible = true;
break;
case PagerPosition.Top:
grid.TopPagerRow.Visible = true;
break;
case PagerPosition.TopAndBottom:
grid.BottomPagerRow.Visible = true;
grid.TopPagerRow.Visible = true;
break;
}

I have another problem now that is when I change from 50 record per pages
(viewing page3) to 100 records per pages (87 records so only have 1 page),
in this case the current page number dissapear, but this is another problem
I have to analyze. I meant it has to show "viewing page 1 of 1" but it's
showing "viewing page of "
I will try to put the code...

Regards,
<someone(a)microsoft.com> wrote in message
news:%23g7SHQ3fKHA.2188(a)TK2MSFTNGP04.phx.gbl...
> Hi Alexey,
> The solution didn't work.
> There must be another place to set the property...
>
> Thanks a lot for your help.
> Regards,
> "Alexey Smirnov" <alexey.smirnov(a)gmail.com> wrote in message
> news:82870d23-2ad0-4ffb-a41a-850e64780d52(a)r24g2000yqd.googlegroups.com...
> On Dec 17, 2:01 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> wrote:
>> Alexey Smirnov escribi�:
>>
>>
>>
>>
>>
>> > On Dec 17, 3:31 am, <some...(a)microsoft.com> wrote:
>> >> Well, the error is here:
>> >> protected void Page_Load(object sender, EventArgs e)
>> >> {
>> >> gridview1.BottomPagerRow.Visible = true; //**ERROR**//
>> >> if (!IsPostBack)
>> >> {
>> >> OnViewInitialized();
>> >> }
>> >> OnViewLoaded();
>>
>> >> }
>>
>> >> It looks like it can't find the BottomPagerRow at that time.
>> >> But I don't know why...
>>
>> >> Thanks for you help.
>> >> Regards,
>> >> Marcelo."Alexey Smirnov" <alexey.smir...(a)gmail.com> wrote in message
>>
>> >>news:a3bc0322-f87f-4bb3-bdd2-a3fcac5e22e9(a)u20g2000vbq.googlegroups.com...
>> >> On Dec 16, 4:13 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
>> >> wrote:
>>
>> >>>> Why did you add it into gridview1_DataBound? I think this is the
>> >>>> problem. Try Page_Load instead
>> >>> Thanks Alexey for your answer.
>> >>> I added it into gridview1_DataBound because I found some link where
>> >>> it
>> >>> said that it must be added after databinding.
>> >>> I'm not good enough with asp.net and english yet. =)
>> >>> When I try to add it to Page_Load() I receive an error:
>> >>> System.NullReferenceException: Object reference not set to an
>> >>> instance
>> >>> of an object.
>> >>> Thanks again.
>> >>> Alexey Smirnov escribi�:
>> >>>> On Dec 16, 3:31 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
>> >>>> wrote:
>> >>>>> Hi again,
>> >>>>> I added this method:
>> >>>>> protected void gridview1_DataBound(object sender, EventArgs e)
>> >>>>> {
>> >>>>> gridview1.BottomPagerRow.Visible = true;
>> >>>>> }
>> >>>>> Now when the record per pages is set to 100 and the number of
>> >>>>> record of
>> >>>>> the query is lower (80 records as an example), now the
>> >>>>> PagerTemplate
>> >>>>> appears in the webpage, but if I press the next or previous button
>> >>>>> the
>> >>>>> PagerTemplates dissapears.
>> >>>>> I think I have to set the BottomPagerRow property to true in
>> >>>>> another
>> >>>>> method but I don't know wich one.
>> >>>>> Regards,
>> >>>>> Marcelo.
>> >>>>> Alexey Smirnov escribi�:
>> >>>>>> On Dec 15, 8:01 pm, "some...(a)microsoft.com"
>> >>>>>> <some...(a)microsoft.com>
>> >>>>>> wrote:
>> >>>>>>> Hi,
>> >>>>>>> I have added a PagerTemplate to a gridview, where I can select
>> >>>>>>> how
>> >>>>>>> many
>> >>>>>>> records I want to show per page(20/50/100). I use this to set the
>> >>>>>>> gridview pagesize.
>> >>>>>>> The fact is that when I have 80 records to show and the gridview
>> >>>>>>> pagesize is set to 100, the PagerTemplate dissapear, and I can't
>> >>>>>>> set
>> >>>>>>> the
>> >>>>>>> records per page until I do a new query.
>> >>>>>>> Is there a way to set the PagerTemplate always visible?.
>> >>>>>>> In advance thanks for any help.
>> >>>>>>> Regards,
>> >>>>>>> Marcelo.
>> >>>>>> Try to set the BottomPagerRow property to true.
>> >>>>>> In addition, take a look
>> >>>>>> athttp://www.ryanmcdonnell.com/always-show-the-pagertemplate-in-gridvie...
>> >>>>>> Hope this helps- Hide quoted text -
>> >>>>> - Show quoted text -- Hide quoted text -
>> >>> - Show quoted text -
>> >> It tells that somewhere is an error. How did you setup the grid, is it
>> >> created in the code? Maybe you can post the complete code here...-
>> >> Hide quoted text -
>>
>> >> - Show quoted text -
>>
>> > Ah, I see. You should call BottomPagerRow after you binded the grid.
>>
>> > Like this
>>
>> > protected void Page_Load(object sender, EventArgs e)
>> > {
>> > if (!IsPostBack)
>> > {
>> > OnViewInitialized();
>> > }
>> > OnViewLoaded();
>>
>> > gridview1.BottomPagerRow.Visible = true;
>>
>> > }
>>
>> Hi Alexey, (Excuse me I sent this to your personal email by error)
>> If I put it there I think is called just when the page is loaded, but
>> not when I press the next or previous button, I think this is because de
>> gridview is in a updatepanel, so not all the page is updated when I
>> change the page number.
>> Is there any other place where I can put the method to be called
>> everytime I change the page?
>>
>> Thanks a lot for your time.
>> Regards,
>> Marcelo.- Hide quoted text -
>>
>> - Show quoted text -
>
> I think i got it, do you have gridview1_SelectedIndexChanged method?
> You need to put gridview1.BottomPagerRow.Visible = true there
>


From: Alexey Smirnov on
On Dec 18, 3:47 am, <some...(a)microsoft.com> wrote:
> I added this and now it's working ok:
>         protected void gridview1_PreRender(object sender, EventArgs e)
>         {
>             GridView grid = (GridView)sender;
>             switch (grid.PagerSettings.Position)
>             {
>                 case PagerPosition.Bottom:
>                                     grid.BottomPagerRow.Visible = true;
>                                     break;
>                 case PagerPosition.Top:
>                                     grid.TopPagerRow.Visible = true;
>                                     break;
>                 case PagerPosition.TopAndBottom:
>                                     grid.BottomPagerRow.Visible = true;
>                                     grid.TopPagerRow.Visible = true;
>                                     break;
>         }
>
> I have another problem now that is when I change from 50 record per pages
> (viewing page3) to 100 records per pages (87 records so only have 1 page),
> in this case the current page number dissapear, but this is another problem
> I have to analyze. I meant it has to show "viewing page 1 of 1" but it's
> showing "viewing page  of   "
> I will try to put the code...
>
> Regards,<some...(a)microsoft.com> wrote in message
>
> news:%23g7SHQ3fKHA.2188(a)TK2MSFTNGP04.phx.gbl...
>
>
>
> > Hi Alexey,
> > The solution didn't  work.
> > There must be another place to set the property...
>
> > Thanks a lot for your help.
> > Regards,
> > "Alexey Smirnov" <alexey.smir...(a)gmail.com> wrote in message
> >news:82870d23-2ad0-4ffb-a41a-850e64780d52(a)r24g2000yqd.googlegroups.com....
> > On Dec 17, 2:01 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> > wrote:
> >> Alexey Smirnov escribió:
>
> >> > On Dec 17, 3:31 am, <some...(a)microsoft.com> wrote:
> >> >> Well, the error is here:
> >> >> protected void Page_Load(object sender, EventArgs e)
> >> >> {
> >> >> gridview1.BottomPagerRow.Visible = true; //**ERROR**//
> >> >> if (!IsPostBack)
> >> >> {
> >> >> OnViewInitialized();
> >> >> }
> >> >> OnViewLoaded();
>
> >> >> }
>
> >> >> It looks like it can't find the BottomPagerRow at that time.
> >> >> But I don't know why...
>
> >> >> Thanks for you help.
> >> >> Regards,
> >> >> Marcelo."Alexey Smirnov" <alexey.smir...(a)gmail.com> wrote in message
>
> >> >>news:a3bc0322-f87f-4bb3-bdd2-a3fcac5e22e9(a)u20g2000vbq.googlegroups.com...
> >> >> On Dec 16, 4:13 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> >> >> wrote:
>
> >> >>>> Why did you add it into gridview1_DataBound? I think this is the
> >> >>>> problem. Try Page_Load instead
> >> >>> Thanks Alexey for your answer.
> >> >>> I added it into gridview1_DataBound because I found some link where
> >> >>> it
> >> >>> said that it must be added after databinding.
> >> >>> I'm not good enough with asp.net and english yet. =)
> >> >>> When I try to add it to Page_Load() I receive an error:
> >> >>> System.NullReferenceException: Object reference not set to an
> >> >>> instance
> >> >>> of an object.
> >> >>> Thanks again.
> >> >>> Alexey Smirnov escribió:
> >> >>>> On Dec 16, 3:31 pm, "some...(a)microsoft.com" <some...(a)microsoft.com>
> >> >>>> wrote:
> >> >>>>> Hi again,
> >> >>>>> I added this method:
> >> >>>>> protected void gridview1_DataBound(object sender, EventArgs e)
> >> >>>>> {
> >> >>>>> gridview1.BottomPagerRow.Visible = true;
> >> >>>>> }
> >> >>>>> Now when the record per pages is set to 100 and the number of
> >> >>>>> record of
> >> >>>>> the query is lower (80 records as an example), now the
> >> >>>>> PagerTemplate
> >> >>>>> appears in the webpage, but if I press the next or previous button
> >> >>>>> the
> >> >>>>> PagerTemplates dissapears.
> >> >>>>> I think I have to set the BottomPagerRow property to true in
> >> >>>>> another
> >> >>>>> method but I don't know wich one.
> >> >>>>> Regards,
> >> >>>>> Marcelo.
> >> >>>>> Alexey Smirnov escribió:
> >> >>>>>> On Dec 15, 8:01 pm, "some...(a)microsoft.com"
> >> >>>>>> <some...(a)microsoft.com>
> >> >>>>>> wrote:
> >> >>>>>>> Hi,
> >> >>>>>>> I have added a PagerTemplate to a gridview, where I can select
> >> >>>>>>> how
> >> >>>>>>> many
> >> >>>>>>> records I want to show per page(20/50/100). I use this to set the
> >> >>>>>>> gridview pagesize.
> >> >>>>>>> The fact is that when I have 80 records to show and the gridview
> >> >>>>>>> pagesize is set to 100, the PagerTemplate dissapear, and I can't
> >> >>>>>>> set
> >> >>>>>>> the
> >> >>>>>>> records per page until I do a new query.
> >> >>>>>>> Is there a way to set the PagerTemplate always visible?.
> >> >>>>>>> In advance thanks for any help.
> >> >>>>>>> Regards,
> >> >>>>>>> Marcelo.
> >> >>>>>> Try to set the BottomPagerRow property to true.
> >> >>>>>> In addition, take a look
> >> >>>>>> athttp://www.ryanmcdonnell.com/always-show-the-pagertemplate-in-gridvie...
> >> >>>>>> Hope this helps- Hide quoted text -
> >> >>>>> - Show quoted text -- Hide quoted text -
> >> >>> - Show quoted text -
> >> >> It tells that somewhere is an error. How did you setup the grid, is it
> >> >> created in the code? Maybe you can post the complete code here...-
> >> >> Hide quoted text -
>
> >> >> - Show quoted text -
>
> >> > Ah, I see. You should call BottomPagerRow after you binded the grid.
>
> >> > Like this
>
> >> > protected void Page_Load(object sender, EventArgs e)
> >> > {
> >> > if (!IsPostBack)
> >> > {
> >> > OnViewInitialized();
> >> > }
> >> > OnViewLoaded();
>
> >> > gridview1.BottomPagerRow.Visible = true;
>
> >> > }
>
> >> Hi Alexey, (Excuse me I sent this to your personal email by error)
> >> If I put it there I think is called just when the page is loaded, but
> >> not when I press the next or previous button, I think this is because de
> >> gridview is in a updatepanel, so not all the page is updated when I
> >> change the page number.
> >> Is there any other place where I can put the method to be called
> >> everytime I change the page?
>
> >> Thanks a lot for your time.
> >> Regards,
> >> Marcelo.- Hide quoted text -
>
> >> - Show quoted text -
>
> > I think i got it, do you have gridview1_SelectedIndexChanged method?
> > You need to put gridview1.BottomPagerRow.Visible = true there- Hide quoted text -
>
> - Show quoted text -

If I were you I would add a label and put my custom text there. It's
ugly to see "page 1 of 1", and even "page 1" makes no sense to me
because there is no other page. Again, what happens if result returns
no records? It will be again the same situation either "page 1 of 0"
or no text at all... I would do following

if (gridview.rows.count == 0)
label.text = "nothing found"
else if if (gridview.rows.count < pagesize)
label.text = "page 1"
else if if (gridview.rows.count > pagesize)
label.text = "page x of y"