Paging

Paging

Old forum URL: forums.lhotka.net/forums/t/5513.aspx


LDSK posted on Thursday, October 02, 2008

Hi there,

Can you please let me know if there is an equivalent for the following overload of a MS.NET dataadapter in CSLA .net?

da.Fill(ds, startrecord,maxrecords,srcTable).

I am using CSLA .net 2.0. I did not find the above overload in 2.0 version.

Would like to know if 2.1 or 3.0 version of CSLA.NET (VB.NET) has this?

 

My problem: I have a datagridview that is being populated by a CSLA.net object. This datagridview would typically display 20,000 to 30,000 records at a time. I want to implement paging for this purpose. I could successfully do if i used a .NET object instead of a CSLA.NET object. Could any one please advise.

thanks,

 

LDSK replied on Thursday, October 02, 2008

Can someone please help me?

RockfordLhotka replied on Thursday, October 02, 2008

Paging in a Web Form with CslaDataSource is discussed in the CSLA .NET Version 2.1 Handbook ebook.

There is direct support for the concept of sorting and paging starting in CSLA .NET 2.1.

LDSK replied on Friday, October 03, 2008

Thanks Rocky. I do have the handbook 2.1 and did see that there is support for paging on web forms.

I want to do paging on a datagrid on a win form. Can you help me with that?

Would be of help if you can point me to an example.

 

RockfordLhotka replied on Friday, October 03, 2008

In a DataGrid control?

 

I don’t have a  specific example, and I’m not entirely sure you can do it with the stock DataGrid.

 

The grid control needs to support “virtual” or “paged” mode. Which means the control itself needs to raise events you can respond to when the grid needs a new page of data. I don’t know if the standard DataGrid supports this concept.

 

I’m reasonably certain that some of the third-party grid controls do support the concept.

 

So step 1 is to make sure you have a grid control that supports this concept.

 

Once you have such a grid control, you should be able to follow the same basic concept as I talk about in the 2.1 ebook for paging. When the grid control raises its “I need more data” event, you’d call a factory method on your business class that accepts the start index and count so it can go get the right data.

 

Rocky

 

rsbaker0 replied on Friday, October 03, 2008

RockfordLhotka:

In a DataGrid control?

 I don’t have a  specific example, and I’m not entirely sure you can do it with the stock DataGrid.

 The grid control needs to support “virtual” or “paged” mode. Which means the control itself needs to raise events you can respond to when the grid needs a new page of data. I don’t know if the standard DataGrid supports this concept.

Ask and ye shall receive... ;)

Here is a complete walkthrough with source on how to do this...

http://msdn.microsoft.com/en-us/library/2b177d6d.aspx

Copyright (c) Marimer LLC