Hi Jignesh,
Another means is use the DataGrid's PreRender event and set the
DataGrid.PagerS tyle.Visible according to its current page count. e.g:
protected void dgPage_PreRende r(object sender, EventArgs e)
{
if (dgPage.PageCou nt == 1)
{
dgPage.PagerSty le.Visible = false;
}
}
This can make our code just specific to the DataGrid without put in some
other page wide event.....
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Edwin Knoppert" <in**@pbsoft.sp eedlinq.nl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| Subject: Re: ASP.NET:: Paging on Demand
| Date: Tue, 24 Jan 2006 22:11:50 +0100
| Organization: QinIP
| Lines: 117
| Message-ID: <dr**********@a zure.qinip.net>
| References: <es************ **@TK2MSFTNGP12 .phx.gbl>
| NNTP-Posting-Host: h8441197235.dsl .speedlinq.nl
| Mime-Version: 1.0
| Content-Type: multipart/alternative;
| boundary="----=_NextPart_000_ 0016_01C62133.2 D11FC80"
| X-Trace: azure.qinip.net 1138137108 8548 84.41.197.235 (24 Jan 2006
21:11:48 GMT)
| X-Complaints-To:
ab***@qinip.net
| NNTP-Posting-Date: Tue, 24 Jan 2006 21:11:48 +0000 (UTC)
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Path:
TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne wsfeed00.sul.t-online.de!t-onli
ne.de!newsfeed. freenet.de!213. 132.189.2.MISMA TCH!multikabel. net!feed20.mult i
kabel.net!news2 .euro.net!azure .qinip.net!not-for-mail
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3732 73
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Agreed, but you can also extend this paging template with a checkbox to
disable it.
| I did a similar thing but outside the grid.
| "Jignesh Desai" <ji***********@ hotmail.com> schreef in bericht
news:es******** ******@TK2MSFTN GP12.phx.gbl...
| Info::
| Most of you must have worked on paging feature of DataGrid. its works
fine as long as you have more no of records to show, but if you have
configured 20 records per page and no of records you retrieved is less then
20 then also pager gets rendered at the bottom of the grid showing "1".
most of us do not bother about it , but Clients ,,,uff...
| Solution:
| SQLDataAdapter. Fill(DS,"Emp")
| If DS.Tables("Emp" ).Rows.Count > MyDataGrid1.Pag eSize then
| MyDataGrid1.All owPaging = True
| Else
| MyDataGrid1.All owPaging = False
| End if
| MyDataGrid1.Dat aBind()
| Any better ways?
| ya perhaps this could have been reduced to one line also eg.
| MyDataGrid1.All owPaging = ( DS.Tables("Emp" ).Rows.Count >
MyDataGrid1.Pag eSize )
| Anything better then this?
| Regards
| Jignesh Desai
|
www.dotnetjini.com
|