Winform paging control similar to web style

Source: Internet
Author: User

Background

Recently, a Winform applet needs to use paging, because we have been usingTonyPagerForWinForm. dllBut the library does not have the source code, and the online search is not comprehensive, so you have to prepare your own transformation. I flipped through the garden and found that a paging control was written many years ago by the fall. This is a practical article on Winform universal paging control (source code download is provided ). Standing on the shoulders of the gods is fast, and it will be changed in a moment.

The functions are quite complete, but in terms of style, the landlord prefers the list paging style of easyUI or ext. So I changed several buttons and added the icon to see the current effect.

  

The control source code is at the bottom of the body.

Introduction

That's the feeling of web paging. For specific usage, simply paste a post. For more details, you can go to the autumn blog and see the link on it.

  StartForm_Load(, ,  [] { , ,  ( i = ; i < ; i++) (MAction action =  MAction(, ,  +,  +, i%==+=  pagerControl1_OnPageChanged( (MAction action =  MAction(, .Empty, 
About Winform

Plug in off-questions. If you haven't done Winform for a long time, some will gradually forget it. Here are some points.

1. The control is adaptive to the window. The anchor attribute is set with top left right down, which is set as needed.

2. To bind data to a Datagrid, if you need to bind a special column, slice, or drop-down box, specify the column header, and then create rows and cells cyclically.

                DataGridViewRow row = = = i++ state = reader[].ToString().AsInt(= = state >  ?  :  _dval = reader[].ToString().AsInt(= = _dmin = reader[].ToString().AsInt(= =                DataGridViewImageCell t2 = = _dval > _dmin ?

 

3. The DataGrid automatically adjusts the column width as the window is maximized.

=.dataGridView.DataSource = ds.Tables[.dataGridView.Columns[].FillWeight = ;           .dataGridView.Columns[].FillWeight = ;           .dataGridView.Columns[].FillWeight = ;      .dataGridView.Columns[].HeaderText = .dataGridView.Columns[].HeaderText = .dataGridView.Columns[].HeaderText = ;

Page Control source code download

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.