All of the examples I've found regarding custom paging in a GridView that uses the ObjectDataSourc e control retrieve subsets of ALL of whatever it is--all products, all categories, etc--restricted only by specified PageSize. But suppose you are searching for a person by name and the user can enter into a search box any part of last name, first name, middle name, e.g., Adams or Adams M or Adams Michael This input is then a control parameter in addition to the startRowIndex and maximumRows parameters. If the user enters 'Adams', you then want to retrieve x number of records at a time for people named 'Adams'.
I tried putting the logic for parsing the user input both in the Select method and in the SelectCountMeth od. The Select method then passes the parameters to a method in the DAL. At best I am able to retrieve the default first 10 records for people named Adams. The 'Next' button does not retrieve the next batch.
Without looking at my code, can anyone out there give me some guidance on how to work with the control parameter in addition to the startRowIndex and maximumRows parameters or is this not possible with the ObjectDataSourc e control?
1 3336 Frinavale 9,735
Recognized Expert Moderator Expert
All of the examples I've found regarding custom paging in a GridView that uses the ObjectDataSourc e control retrieve subsets of ALL of whatever it is--all products, all categories, etc--restricted only by specified PageSize. But suppose you are searching for a person by name and the user can enter into a search box any part of last name, first name, middle name, e.g., Adams or Adams M or Adams Michael This input is then a control parameter in addition to the startRowIndex and maximumRows parameters. If the user enters 'Adams', you then want to retrieve x number of records at a time for people named 'Adams'.
I tried putting the logic for parsing the user input both in the Select method and in the SelectCountMeth od. The Select method then passes the parameters to a method in the DAL. At best I am able to retrieve the default first 10 records for people named Adams. The 'Next' button does not retrieve the next batch.
Without looking at my code, can anyone out there give me some guidance on how to work with the control parameter in addition to the startRowIndex and maximumRows parameters or is this not possible with the ObjectDataSourc e control?
I've recently done something similar to you and could not use the ObjectDataSourc e control...mainl y because I had a custom object returning the results from a database in a very customized way.
What I did was use a DataView object as my GridView's DataSource. Paging works fine for me...
I'm not sure this would work with your solution because of how you are doing your searches....but it might be worth looking into.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Clint |
last post by:
Hi,
I am trying to implement the custom paging in the datalist in this format:
<< Prev 1,2,3,4,5 Next >>. Does anyone knows how to do this.
Thanks in advance.
Clint
|
by: asad |
last post by:
Hello friends, i am designing a ASP.NET page where i want to use custom
paging bcoz data is too heavy so pls tell me how can i use custom paging in
ASP.NET
Thanks
|
by: asad |
last post by:
hello friends, how ru all
I want to create a custom paging logic in ASP.NET with a next link for
example if i have 100 pages record so i want to show 6 pages link on page one
and next link
like that
1 2 3 4 5 6 <Next>
|
by: Wiktor Zychla [C# MVP] |
last post by:
Hello,
just two sad thoughts on GridView's custom paging support, the first one
rather general and second one rather specific.
First one: I really miss the DataGrid custom paging support with
AllowCustomPaging and VirtualCount. The new declarative model with
ObjectDataSource is much worse! - the amount of "words" you have to type is
comparable (few methods in C# vs declarative binding with ObjectDataSource),
however the static typing...
|
by: Roy |
last post by:
Hey all,
I must be losing my touch. I have made many pages in the 1.1 framework
that utilize custom bidirectional paging in datagrids. We've converted
over to 2.0 and I've been trying to use the built-in functionality of
gridviews and objectdatasource's to accomplish the same thing (w/o
resorting to the 1.1 methodology). I discovered two very nice and
comprehensive articles concerning this:
Custom Paging in ASP.NET 2.0 with SQL Server...
| |
by: Mrozik |
last post by:
Hi!
I'm looking for a solution to show data in a table.
I think about DataView control - but I see one problem.
My data source is a WebService returning paged pieces
of data (I can't change behavior of this data source).
I found in documentation the only way to implement custom
paging is to use ObjectDataSource - but there is different
model of arguments (page size, page number, sort expression ,
order expression) of WS methods - there...
|
by: =?Utf-8?B?SmVmZiBCZWVt?= |
last post by:
The default paging behavior of the gridview doesn't work well with very large
sets of data which means we have to implement some sort of custom paging.
The examples I have seen (4guysfromrolla, etc.) suggest using an
ObjectDataSource which has built-in paging functionality that, when used in
conjunction with certain SQL 2005 functionality, only works with the records
to be displayed on the page rather than the entire set. The problem with...
|
by: Danny Ni |
last post by:
Hi,
Could someone point me to source sample C# code to do gridview custom
paging? No ObjectDataSource please, the reason I don't want to use ODS is
the page is already created using the DataSource to do data binding, it will
takes some efforts to convert it to use ODS.
TIA
|
by: Question123 |
last post by:
Hello
I am trying to implement Gridview Custom Paging by using
ObjectDataSource with properties
How to pass parameters for SelectMethod and SelectCountMethod of ObjectDataSource .??
-- Regards
|
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...
|
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...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| | |