We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGrouping Control with ObjectDataSource and Paging (revisisted)

Thread ID:

Created:

Updated:

Platform:

Replies:

50011 Oct 3,2006 03:32 PM UTC Oct 9,2006 07:25 AM UTC ASP.NET Web Forms (Classic) 7
loading
Tags: GridGroupingControl
David A. Gonzales
Asked On October 3, 2006 03:32 PM UTC

Hi,
I am using the latest Studio (4.302.0.30) and am trying to use the Grouping Grid with a ObjectDataSource. For the ObjectDataSource I have the SelectMethod="GetInfo" (which returns a dataset of 20 records) and SelectCountMethod="GetAllRows" (which returns the total number of rows (in this case 1.2 million). The OnSelecting event will build a parameter list for picking out 20 records at a time from the database. The GridGrouping control is set to the ObjectDataSource''s ID and in the Page_Init routine I set DataMember = "DefaultView" and PrimaryKey = "RowID" and do the databind. In the page I get the Headers of the columns from the database ok but no data. In the past I had to manually assign a database to the grid and manage all the paging myself (ie, use my own buttons, keep track of rows, etc).

This works with a GridView (same ObjectDataSource) and Infragistics UltraWebGrid (without the need for Page_Init or DataMembers being set or Primary Keys) but since we have the Syncfusion toolkit I would like to use it''s tools.

Thanks.
David

Sivakumar [Syncfusion]
Replied On October 3, 2006 05:09 PM UTC

Hi David,

Our grid supports ''Object Datasource''. please download the sample from the below link, Where grid is bound to ObjectDataSource.

Object DataSource Sample

You can also have a look at the following forum where Grid bound to ObjectDataSource inside a Masterpage is discussed.

Forum discussion on Object dataSource

>>Also you have mentioned, "In the past I had to manually assign a database to the grid and manage all the paging myself" , so is it when trying to use our paging bar the sample is not working as expected?

I am not sure if the above samples can help you in your scenario, please let us know if you are able to reproduce the issue in the above sample.

Sorry for any inconvenience caused


Thanks
A.Sivakumar

David
Replied On October 3, 2006 06:27 PM UTC

Ok. I was able to get the ObjectDataSource to work by disabling paging of the ObjectDataSource. However that opens up a big problem for me. The ODS allows you to do paging at the DataSource level so I can pass to my SelectMethod of the ODS the startRow and endRow of the data I want and the grid will display only that data in the grid. The method that you have in your sample will retrieve all of the data and then you can break it up if you want (ie, Paging). So, if I was to use your sample I would be loading in 1.2 Million records. Not a good thing to do.

So as to why I had to do my own paging was because of the way the GridGrouping control works with the ODS. I would call a routine that would only retrieve the data that i needed (20 rows at a time), bind the datatable to the grid and then manually update the page count to let the user know the page they were on. If they clicked a next button (all the paging buttons are seperate from the Grid) then the routine to get the next page would be called, grid binding to returned datatable and page count updated, etc, etc.

So, I guess the big question is can the GridGrouping Control work with the ODS that is setup in Paging Mode? When using other grids I can do this. I setup the SelectMethod and SelectCountMethod in the ODS and enable paging in the ODS and bind that to the grid and it just works.

I tried to enable paging in the sample you sent and I get an error regarding missing startRowIndexParameter and maximumRowsParameter (these are part of the ObjectDataSource that limit the selection of data in the SelectMethod that is used).

In my test.aspx page I have the following definition for my objectdatasource:

TypeName="UserDataInfo" OnSelecting="ObjectDataSource1_Selecting" EnablePaging="true" SelectCountMethod="GetAllRows" >








FYI, SelectCountMethod is the method that returns the total number of Rows in the data so the paging buttons can be updated.


Thanks.
David.

David A. Gonzales
Replied On October 3, 2006 06:35 PM UTC

Sorry, my source code got cut off. I have attached my test.aspx, test.aspx.cs and my App_Code file for attaching my Business Layer to my Data Layer.

Thanks.
David

membership.zip

Sivakumar [Syncfusion]
Replied On October 3, 2006 11:05 PM UTC

Hi David,

We are looking in to this and will update you as soon as possible

Thanks,
A.Sivakumar

Sivakumar [Syncfusion]
Replied On October 4, 2006 07:52 PM UTC

Hi David,

We need some more time, to research on this. Will get back to you at the earliest.

Thanks for your patience.

Thanks,
A.Sivakumar

Sivakumar [Syncfusion]
Replied On October 5, 2006 11:59 PM UTC

Hi David,

We are able to see this issue in a sample, and the reason for this issue is the pageSize is automatically assigned to ''0'' in our sample. We are looking for some workaround regarding this and will get back to you at the earliest.

We regret for any inconvenience caused and Sorry for the delay.

Thanks,
A.Sivakumar

Administrator [Syncfusion]
Replied On October 9, 2006 07:25 AM UTC

Hi David,

Attached is a sample which uses Custom Paging for the Grid using ObjectDataSource.

We acheived this behavior by specifying the StartRowIndex in the ObjectDataSource''s OnSelecting ''Event''.

The current Start Row index is stored in the Session Variable and each time when the Next or previous button is clicked this session variable is updated accordingly and then the grid gets the corresponding rows from the List.

GGCwithObjectDataSource and Custom Paging

Let us know if the above sample helps you to solve the issue in your scenario.

Please feel free to let us know if you need more info.

Thanks,
A.Sivakumar

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;