VOOZH about

URL: https://www.nuget.org/packages/VPaged.WF/

⇱ NuGet Gallery | VPaged.WF 2.0.1




VPaged.WF 2.0.1

dotnet add package VPaged.WF --version 2.0.1
 
 
NuGet\Install-Package VPaged.WF -Version 2.0.1
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VPaged.WF" Version="2.0.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="VPaged.WF" Version="2.0.1" />
 
Directory.Packages.props
<PackageReference Include="VPaged.WF" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add VPaged.WF --version 2.0.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: VPaged.WF, 2.0.1"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package VPaged.WF@2.0.1
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=VPaged.WF&version=2.0.1
 
Install as a Cake Addin
#tool nuget:?package=VPaged.WF&version=2.0.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

VPaged.WF Pagination component for .NET desktop application

This library will help you to paginate desktop application easily with C#. Source : https://github.com/tranthanhvan/VPaged.WF

Install

dotnet add package VPaged.WF --version 2.0.1

How to Use

With Winform application

Initialize a VPag with the current Form ,set method you use to get data & totalCount in SelectDataMaster & SelectCountMaster properties:
 public partial class FrmEmployee : Form
 {
 private readonly VPagedContext _context;

 private VPagination _pag;

 public FrmEmployee()
 {
 InitializeComponent();
 _context = new VPagedContext();
 //Initilizer VPaged.WF. `this.groupPaging` is System.Windows.Forms.GroupBox type Winform Base
 _pag = new VPagination(this.ContainerPaging, pageSize: 3);
 //Set method Select Data
 _pag.SelectDataMaster = SelectData;
 //Set method get count need paging
 _pag.SelectCountMaster = GetCount;
 }

 /// <summary>
 /// Method VPaged SelectDataMaster
 /// </summary>
 private void SelectData()
 => GridMaster.DataSource = _context.Employees.OrderBy(p => p.ID).Skip((_pag.PageIndex - 1) * _pag.PageSize)
 .Take(_pag.PageSize).ToList(); //GridMaster is DataGridView

 /// <summary>
 /// Method VPaged SelectCountMaster
 /// </summary>
 /// <returns>total count need paging</returns>
 private long GetCount() => _context.Employees.Count();
 }
VPagRunOrRefresh() method used to run get data or can also refresh data after insert/update or delete . After Initialize a VPag , call VPagRunOrRefresh() Method to run. ex i will run VPag get Data and paging when Form load events :
 private void FrmEmployee_Load(object sender, EventArgs e)
 {
	_pag.VPagRunOrRefresh();
 }
Or create a button with click event is run VPaged :
 private void BtnLoad_Click(object sender, System.EventArgs e)
 {
 _pag.VPagRunOrRefresh();
 }

With WPF application

it's still the same. just create System.WindowForms.Control to initialize VPaged . eg :
 <WindowsFormsHost Margin="257,237,276,354" Width="500" Height="50" Name="HostNamePagingWF">
 <wf:Control x:Name="ContainerPaging" Text="Here" Height="48" Width="370"/>
 </WindowsFormsHost>
The rest is similar to the window form application:
 public partial class MainWindow : Window
 {
 private readonly VPagedContext _context;

 private VPagination _pag;

 public MainWindow()
 {
 InitializeComponent();
 _context = new VPagedContext();
 //Initilizer VPaged.WF. `this.groupPaging` is System.Windows.Forms.GroupBox type Winform Base
 _pag = new VPagination(ContainerPaging, pageSize: 3); //ContainerPaging is child WindowsFormsHost
 //Set method Select Data
 _pag.SelectDataMaster = SelectData;
 //Set method get count need paging
 _pag.SelectCountMaster = GetCount;
 }

 /// <summary>
 /// Method VPaged SelectDataMaster
 /// </summary>
 private void SelectData()
 => GridView.ItemsSource = _context.Employees.OrderBy(p => p.ID).Skip((_pag.PageIndex - 1) * _pag.PageSize)
 .Take(_pag.PageSize).ToList();

 /// <summary>
 /// Method VPaged SelectCountMaster
 /// </summary>
 /// <returns>total count need paging</returns>
 private long GetCount() => _context.Employees.Count();

 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
 _pag.VPagRunOrRefresh();
 }
 }
Product Versions Compatible and additional computed target framework versions.
.NET Framework net472 net472 is compatible.  net48 net48 was computed.  net481 net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.1 757 1/2/2023
2.0.0 467 1/1/2023
1.0.5 472 12/31/2022
1.0.4 473 12/31/2022
1.0.3 592 8/18/2022
1.0.2 577 8/17/2022

Optimize version