Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi what type of namespce should i declare for PageOffsetList();


C#
bindingSource1.DataSource = new PageOffsetList();



please suggest me

thank u
Posted

Try:
C#
using System.Collections.Generic;
 
Share this answer
 
Comments
ythisbug 9-Jul-12 8:48am    
thanks..tat already i declared but also comng error
Prasad_Kulkarni 9-Jul-12 8:50am    
You're welcome..
..and what's the error?
ythisbug 9-Jul-12 8:52am    
type or namespace name 'PageOffsetList could not found (are u missing directive or an assembly reference"?
Prasad_Kulkarni 9-Jul-12 9:11am    
Have you added reference??
ythisbug 9-Jul-12 8:51am    
http://stackoverflow.com/questions/2825771/how-can-we-do-paging-in-datagridview-in-winform
am trying this artical for gridpaging
I didn't knew of any such class name PageOffsetList, so I Googled it. I didn't find anything as such.

As thought, it was surely a custom class written by someone (surely not you as you are not aware of it.). Looking at the links, found the source from where it looks like the code was copied which you are referring now.

Add this in your code behind class:
C#
class PageOffsetList : System.ComponentModel.IListSource
{
    public bool ContainsListCollection { get; protected set; }

    public System.Collections.IList GetList()
    {
         // Return a list of page offsets based on "totalRecords" and "pageSize"
         var pageOffsets = new List<int>();
         for (int offset = 0; offset < totalRecords; offset += pageSize)
            pageOffsets.Add(offset);
         return pageOffsets;
    }
}

It has been referred/copied/used from here in your code base: Solution 2 here[^]
 
Share this answer
 
Comments
ythisbug 9-Jul-12 8:56am    
ya ur rite am reffering sandeep.
ythisbug 9-Jul-12 9:03am    
any solution for this??
Sandeep Mewara 9-Jul-12 9:50am    
Did you read and understood my reply?

Already gave you the solution. Class is missing, add the above code!
ythisbug 9-Jul-12 10:20am    
ya sandeep tat class already there in my code..but dont know y that error coming.
Sandeep Mewara 9-Jul-12 10:48am    
Check if correct namespace & scope of class is set.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900