![]() |
VOOZH | about |
dotnet add package VPaged.WF --version 2.0.1
NuGet\Install-Package VPaged.WF -Version 2.0.1
<PackageReference Include="VPaged.WF" Version="2.0.1" />
<PackageVersion Include="VPaged.WF" Version="2.0.1" />Directory.Packages.props
<PackageReference Include="VPaged.WF" />Project file
paket add VPaged.WF --version 2.0.1
#r "nuget: VPaged.WF, 2.0.1"
#:package VPaged.WF@2.0.1
#addin nuget:?package=VPaged.WF&version=2.0.1Install as a Cake Addin
#tool nuget:?package=VPaged.WF&version=2.0.1Install as a Cake Tool
This library will help you to paginate desktop application easily with C#. Source : https://github.com/tranthanhvan/VPaged.WF
dotnet add package VPaged.WF --version 2.0.1
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();
}
private void FrmEmployee_Load(object sender, EventArgs e)
{
_pag.VPagRunOrRefresh();
}
private void BtnLoad_Click(object sender, System.EventArgs e)
{
_pag.VPagRunOrRefresh();
}
<WindowsFormsHost Margin="257,237,276,354" Width="500" Height="50" Name="HostNamePagingWF">
<wf:Control x:Name="ContainerPaging" Text="Here" Height="48" Width="370"/>
</WindowsFormsHost>
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. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
Optimize version