I have an application where paging is done in the database. That is, the call to retrieve a list of items includes the page number, the page size, and will return only that pages' data. For example:
ItemCollection items = ListAllItems(1, 20); // page 1, show 20 items per page
ItemCollection includes a PagingUtil property that is a class that contains properties to support paging without retrieving all records.
public class PagingUtil
{
public int StartRow { get; private set; }
public int EndRow { get; private set; }
public int TotalPages { get; private set; }
public bool HasPrevPage { get; private set; }
public bool HasNextPage { get; private set; }
public int TotalCount { get; private set; }
private PagingUtil() {}
public PagingUtil(int pageNumber, int visiblePerPage, int totalCount)
{
... logic for setting property values here ...
}
}
I would like to use the BindingNavigator Control UI in a Windows Forms application without having to specify a BindingSource.
The problem is, the BindingNavigator will only be rendered as enabled if a BindingSource is set. Setting the Enabled property to true both in the designer and in code is not respected and I cannot seem to find a workaround or alternative stock control.
Is it possible to use the BindingNavigator this way? I can create a custom paging control if needed, but would prefer not to if I don't have to.