473,698 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tip::Paging on Demand.....

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...but after all client is a
client...if you also encounter such things this is how you solve
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()

I do hate to write these extra lines of code, I hope that .NET team at
Microsoft will incorporate this feature inbuilt in DataGrid itself in their
next release. what do others say...? 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
Nov 19 '05 #1
1 1253
Ily
I usually Inherits from the datagrid and add this feature. Seems to do
the trick

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1461
by: Luka POZVEK | last post by:
Hello! I have a problem regarding ADO paging. I have a simple .mdb database to which i connect through ADO. It contains 42 records (each has 2 fields). I've set up a asp code, which "pages" through those records. The problem is, it doesn't show the first three records (it begins with number 4) and when it comes to the last page, the "next" button should be disabled (span), but it's not. I would really appreciate any help or tip. Thanks....
1
1429
by: Randy | last post by:
Hello, I've got an ASP app. I have a simple datagrid. If I don't use column templates I can easily set up the datagrid to use paging by creating a PageIndexChanged event and putting this code in it... DataGrid1.CurrentPageIndex = e.NewPageIndex; DataGrid1.DataBind(); This works fine. But when I then use column styles for the datagrid using Labels in the item template slot, when I click the next page link at the bottom of the datagrid,...
0
368
by: Mauricio Bastos | last post by:
I have found examples on how to create a DataList Paging iin C#. However , I couldnt find any tip in how to do it with VB.net . Any one has a tip ? Mauricio
2
1752
by: Daniel Walzenbach | last post by:
Hi, I have a question regarding the DataGrid control. If paging is enabled the grid binds the data, sets the paging on the top/bottom (or however it is set up) and throws away unnecessary data. So far so good for a tiny amount of data but if some 100000 of rows are the source this approach is stupid.
4
3509
by: Jim Seymour | last post by:
Hi, Environment: SunOS 5.7 Generic_106541-29 sun4u sparc SUNW,UltraSPARC-IIi-Engine Postgresql-7.4.6 Build config: --with-java --enable-thread-safety gcc version 3.3.1 less-381 readline-4.3
2
2232
by: Jeff | last post by:
Hey ASP.NET 2.0 GridView have AllowPaging & PageSize for the letting the GridView span multiple pages. But is the same allowed on a Repeater control? I didn't see any properties like AllowPaging or PageSize on the Repeater control, so I guess it isn't possible? if it is possible maybe somebody here could give me a tip on how
15
4906
by: kostas | last post by:
Hi, Trying to dump a set<int(s) in a vector (v) my guess was that v.insert(v.end(),s.begin(),s.end()) would be at least as efficient as copy(s.begin(), s.end(), back_inserter(v)) It turn out that it is almost two times slower (even without using reserve() before copy) and that's because it traverses the set twice. I'm posting it as an exception to the usual (and usually correct) advise "Prefer member functions to algorithms".
4
3506
by: snowrupa | last post by:
my .cs file is using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls;
2
6106
ADezii
by: ADezii | last post by:
This week's Tip is basically geared to Power Access Users and Gurus who demand the ultimate in efficiency within their Applications. It involves an undocumented feature of Jet 4, and is a technique you can use to return a variety of pieces of information relating to Disk Reads and Writes. It is a Method of the DBEngine Object, and as such is restricted to DAO. Next week, we will discuss comparable functionality in ADO. The ISAMStats Method is...
0
8672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4361
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2323
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.