.net - Paged ObjectDataSource Results In PageSize -1?

Jun 11, 2010

I'm using a ListView with a Paged DataSource. When the ObjectDataSource tries to fetch data from the "GetData"-method, the parameter PageSize is set to -1, even though I have set the PageSize to 8 in the DataPager.

Have I forgotten something?

<asp:ListView DataSourceID="odsProductIndex" ID="lstProductIndex" runat="server" OnItemDataBound="lstProductIndex_ItemDataBound">
<LayoutTemplate>
<asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>[code]....

View 1 Replies


Similar Messages:

.net - NHibernate Paged Results & Incorrect Row Count?

Mar 10, 2011

I have a model called 'BusinessPage' which can be associated with 1 or more 'BusinessPageCategories'. So I've got a 3rd table called 'BusinessPagesInCategories' that links these two.I am trying to get a paged recordset of BusinessPages, along with the total number of records (I may have 100 rows in total but only return 20 at a time, but I pass back an int containing that total number in addition to the 20 rows).The problem I have is that, since I implemented the Many-To-Many relationship, it was bringing back the same BusinessPage row x times (where x is the number of categories that BusinessPage is associated with). I only want a single instance of each business page to be returned. So I added the following to my NHibernate Criteria to give Distinct BusinessPage results..SetResultTransformer(CriteriaSpecification.DistinctRootEntity);

Whilst this works for me, in that I'm now correctly getting a single row per BusinessPage (and my Categories property within each BusinessPage contains the correct x categories that it's assigned to), my row count is not reflecting that 'distinct' count - instead, if I have just 1 BusinessPage record which is associated with 3 categories, the row count is 3!?!

public virtual int BusinessPageId { get; private set; }
public virtual IList<BusinessPageCategory> Categories { get; set; }
public virtual string BusinessName { get; set; }

[code]...

View 1 Replies

DataSource Controls :: Display All Results In ObjectDataSource?

Oct 23, 2010

I have objectDataSource connected to report viewer.

This datasource have a select method to filter the results by Dep_id parameter

Now if i want to include all results(All Departments) what should i do ???

View 5 Replies

C# - How To Use DataPager With Database Paged

Mar 15, 2010

I am using ListView/DataPager.

For performance reasons I page my results at database, using ROW_NUMBER(SQl2005).

At my C# code just comes one page at time. How can I say to DataPager that I have more rows that really are at my List?

View 2 Replies

C# - Export All Rows Of Paged ListView To Excel

Mar 6, 2011

In ASP.NET 4.0 webforms, I'm trying to export a paged ListView control to an Excel file by un-paging the ListView's (trucks) datasource:

dsTrucks.EnablePaging = false;

For a non-paged ListView control, I can get it to work.

Here's the attempt to "un-page" and then export the ListView control:

[Code]....

There's no error but the output in the Excel file is still just one page of the ListView control instead of all rows.

View 1 Replies

C# - SubSonic .Paged() Query Returns Duplicate Records

Feb 8, 2011

Using a SubSonic (2.2) SqlQuery object, I am querying a view that contains distinct rows from another table. The results of the query, however, contain multiple rows for certain rows in the view. It appears to be because of a join on a temporary table in the query generated to achieve paging. How can I avoid this duplication of rows?

Bonus points: I have to use the view because SubSonic can't do .Paged() and .Distinct() at the same time. Why not?

View 1 Replies

C# - Paged List With Checkboxes, Keep The Checkbox Value Browsing Through The Paging?

Mar 29, 2010

I got a list of customers I thought I would list in a gridview or a repeater with customer html, it gone have paging. I'm gone have a checkbox for each customer in the list. Do you guys have any suggestions on how I should do to keep the checkbox value when I go to page 2-3-4 ect in the paging. I'm thinking a session to store the id of the checked customers. After I'm done setting the values they go to the database.

Do you got any other ideas then the session I'm thinking of?

View 2 Replies

Determine The Number Of Pages In A Custom Paged Control?

Mar 21, 2011

I am trying to determine the number of pages in a custom paged control I have Built

there are 46 records and I am trying to get to the exact number of pages when there are 5, 10, 25 items per page etc...

at 5 items per page I should have 10 pages

and at 10 items per pages I should have 5 pages

but my code returns values that cannot use.

this is my code:

[Code]....

those are values I get.

When maxrowperpage is 5
pagecountConverted is = 9
pagecount is = 9
When maxrowperpage is 10
pagecountConverted is = 5
pagecount is = 5

how can I get a correct quotient?

View 1 Replies

Forms Data Controls :: Finding Pages In A Paged GridView

May 27, 2010

I have a gridview that is a directory of people with about 50 pages

How would I make another gridview that had first row with 26 columns, 1 for each letter of the

alphabet and second row with the first page that has last names that start with that letter.

View 6 Replies

Forms Data Controls :: Paged Sortable Lists And Efficiency?

Jan 13, 2010

I need to make a large Ebay-style list of listings (think of the page that comes up when you search for something in Ebay, with a photo, title, one-line description, price, that's paged, and sortable). My limited experience with DataGrids in the past always resulted in what felt like a sluggish page to me, but I'm not sure if it would have been faster if I had pieced it together with a data reader instead.So I'm wondering before I even get started, what is the fastest / most efficient way to retrieve and manage this data.Is it more efficient at runtime to use a DataGrid, or to write the paging and sorting in more manually and use a DataReader, or another way?Ebay manages to get thousands of listings to display very quickly, but they've obviously got a lot of manpower to squeeze every last bit of performance they can out of the site, and good high-powered servers.

View 5 Replies

C# - Determine If A DataGrid Has Been Sorted Or Paged, Prior To The Events Being Triggered?

Jun 25, 2010

I have a DataGrid that has event handlers bound to SortCommand and PageIndexChanged. How can I determine if those event handlers are about to be called, say on page_load? These events will fire just fine after page_load, but I'd like to know at page_load if they are to be fired.

View 1 Replies

Web Forms :: ITextSharp : Change Printer's Pagesize?

Sep 29, 2010

in my webapplication i create a pdf document based on a pdf template which paegsize is Iso C6 (envelope ).
The documet is returned to the client in the response output stream .

If i choose to open the document (and print it) , i have the printer pagesize automatically set to the a4 pagesize;

This cause a side effect : the text printed on the envelope is not in the right position because the printer pagesize is different (on a a4 paper the envelope is centered on the paper!!!).

Can i set the printer pagesize with itextsharp?

View 3 Replies

C# - Bind That Information Accordingly To The Actual PageCount And PageSize Properties?

Mar 4, 2010

Is it possible to insert information into the gridview's pager, like "Showing 10 of 55 items (You are on page 3)" and bind that information accordingly to the actual PageCount and PageSize properties?

I can only think of doing it outside the pager, even outside the GridView.

View 1 Replies

Forms Data Controls :: Dataset / Datatable According To Pagesize Given?

Mar 26, 2010

I need your help / guidence for doing custom paging in c#, through sqlserver. so that i can have data in dataset/datatable according to the pagesize given, not all the data in dataset. some code /url .......with full discrption if possible.

View 12 Replies

Forms Data Controls :: How To Get The GridviewPager Selected PageSize In A Webform

Mar 16, 2010

I need to get the selected Pagesize value from the gridview pager.

View 3 Replies

Forms Data Controls :: GridView Shows Only Three Records Even I Have Given Pagesize 10

Feb 25, 2010

There is a gridview and I am binding some records to it. in my database there are 4 records but gridview always shows 3 records. Even I have given PageSize 10.

View 4 Replies

Forms Data Controls :: How To Set The Datapager PageSize Programmatically In The Code Behind (vb)

Mar 13, 2011

how to set the Datapager PageSize programmatically in the code behind (vb)?

here is my datapager asp(.net) code:

[Code]....

View 3 Replies

Forms Data Controls :: Time To Set PageSize For The ListView's DataPager?

Aug 20, 2010

When (in what event) is the best time to set PageSize for the ListView's DataPager? I have tried every event on the ListView and either it does not work (i.e., reverts to the default 10) or I get a CRASH of some sort (mostly error 12002) - but that's a different story.

View 6 Replies

Active Directory/LDAP :: Modifying The Underlying Searcher To Set PageSize And SizeLimit?

Jul 30, 2010

I'm using PrincipalContext, UserPrincipal and PrincipalSearcher to get the total number of objects in a particular OU. I know total is somewhere around 9,000. But what I get is 1,000. I've tried modifying the underlying searcher to set PageSize and SizeLimit, but same result. Here is the code:

[Code]....

View 3 Replies

Controls :: ITextSharp Error - Pagesize Is Ambiguous Imported From Namespace Or Types

Feb 15, 2013

I tried ur code , but it show an error ....

pagesize is ambiguous , imported from the namespace or types 'iTextsharp.text.document,iTextsharp.text

Dim pdfDoc AsNew Document(PageSize.A4, 10.0F, 10.0F, 100.0F, 0.0F)

View 1 Replies

Custom Server Controls :: Extended GridView.Rows Collection Always = PageSize Even On Last Page?

Mar 22, 2010

Using VS2005, VB code behind,

I am extending the GridView control to include a custom pager for a custom paging scheme (only one page returned from the database at a time rather than all records). In my testing a discovered an issue - on my last page of data, the GridView's rows property always returns a collection of PageSize page, rather than the actual number of records on the page, with non-data fill records being empty rows.

For example, suppose I have 23 records in my database. Assuming a PageSize of 10, when I page to the last page of data the gridview it properly displays the last 3 recrods - but when I handle the GridView's CommandName="Select" event the GridView's Rows collection contains 10 records, the last seven of which are empty.

I set a break point in just before I call GridView.DataBind and verified that the DataTable used as the DataSource for the last page of data does in fact only contain the 3 expected records. But when I set a breakpoint on the Sub that handles the "Select" GridView command, the GridView.rows collection contains 10 records, the last 7 of which are empty.

This post[URL] and comments make note of the issue but the solution prescribed by the author does not seem to work.

Attached are some snippets of my extended GridView and the two methods from my page where I mentioned setting breakpoints above.

Snippets from my extended GrdiView

[Code]....

MyReport.aspx.vb:

[Code]....

View 1 Replies

Forms Data Controls :: GridView PageSize And ItemTemplate Button Event Conflict?

Jul 30, 2010

GridView bound to a SqlDataSource. GridView.AllowPaging is True. In one of the ItemTemplates I have a LinkButton with a OnClick event.Have a DropDownList for changing GridView.PageSize - done in Page_LoadEverything in of-course in an UpdatePanel.

The whole thing work fine (we are in test fase). The problem is that the LinkButton OnClick event is only being attached to the initial "PageSize" amount of elements. Fx. if I sat PageSize=15 in the <asp:GridView> then change the page size to say 30 from the DropDownList, the page size changes but only the first 15 LinkButtons fire the OnClick event when clicked.

I've tried to do the following:

Attached an "onchange" javascript client event for saving the selected value in a <asp:HiddenField> before postback. Problem here is that the HiddenField value is then only available on Page_Load. By then it's too late to set the new page size on the GridView because the attachemnt of events to the LinkButtons have allready happened - of-course only to the first 15 elements.Then I tried to drop the PageSize=15 in the <asp:GridView> and only sat it in the Page_load. The idea was that with no paging all the Linkbuttons will get treated evenly. That worked, but when I change the GridView page size and click fx. on LinkButton 25, the Click event forks fine but the GridView page size resets to the initial value (15) - no good.

how I can get all the LinkButtons to have their event working, even after I change GridView page size?

View 3 Replies

Forms Data Controls :: GridView Increased Pagesize And Poor Retrieval Performance?

Feb 21, 2011

I have developed a application using Visual Studio 2008 and SQLServer 2008. I have a page called "Billing Center" where i need to display more than 500 records in a gridview and the gridview has sorting enabled. If i limit the page size upto 10 only the gridview performs well but user requirement is to view atleast 500 records at once which is slowing down the gridview record retrieval process.

I am using the following C# code in code behind to sorting, paging and retrieval . Please guide me what am i doing wrong in this code and how to make it work with large data set.

[Code]....

View 5 Replies

Forms Data Controls :: .net Gridview Dynamic Change Pagesize Not Work On The Last Page?

May 7, 2010

Asp.net gridview dynamic change pagesize not work on the last page.

I have added one dropdownlist in the pager of gridview and add event of selectedIndexChanged with the DropDownList.

Changing pagesize is working except the last page

We can have a look at this link:

http://marss.co.ua/DropDownListInPager.aspx

View 3 Replies

Forms Data Controls :: Security Tutorial 12, User Account GridView Doesn't Shrink To PageSize?

Mar 8, 2010

I've been working through the ASP.NET Security Tutorial 12, seen here:

http://www.asp.net/%28S%28pdfrohu0ajmwt445fanvj2r3%29%29/learn/security/tutorial-12-cs.aspx

Part of this tutorial entails setting up a GridView which is bound to the collection of UserAccounts, and then enabling paging on the GridView. There are the usual four links for First, Prev, Next, and Last pages, which should work because I have twelve users defined, and the pagesize of my GridView set to 5. I've set up the code to enable or disable the paging links depending on what section of the entire UserGrid is currently visible.

So when I first run the website and go to the ManageUsers.aspx page, I would expect to see only the first five users in my collection. But it shows all twelve.


I must have overlooked something, but I can't find it in the text and examples.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved