C # custom paging control 3.0
C # The Custom page control reaches 3.0 without knowing it, indicating that there are still some problems. I didn't think well enough at the beginning. When the first version came out, I felt okay and waited for myself to read it again.CodeBut it still needs to be improved.
We warmly welcome you to download, use, analyze, criticize, and propose suggestions for modification.I want to downloadC # custom paging control 3.0
This blog may be of little help to many people. If you have time, you can look at the source code. It may be a little helpful to your loss. The next blog may be helpful to you, I haven't written a blog for so long this time because the project is too busy. The next article will write lessons about my failure, because I wrote more than 60% pieces of code for a recent project, not prepared in the early stage, causing trouble in the later stage. Fortunately, it was launched last night. The address is as follows:
Target software recharge center:Http://card.object.com.cn/
A recently-developed project (the recharge center of the target software) used custom page controls that were not complete enough and were not very convenient to use, so it was upgraded, this is the second upgrade. It is estimated that the upgrade will continue. Why is it estimated?
1: I don't know if I have any friends or want to improve it.
2: I want to do C ++. If I have the opportunity, I will start to write c ++ code. C # will write less code.
3: if a friend suggested that I upgrade, it would definitely be an upgrade.
Content of this upgrade:
1: modified the pageindex attribute and set it to read-only. The user who uses this control does not need to assign values to it. In the past, the user had to obtain the page on which the current page is located, it is troublesome and not concise.
2: A property currentrecord is added to indicate the index position of the first record on the current page. If you want to display the number on the page, it is very convenient to use this property.
Used in the project:
Now the use of this control is relatively concise, and there are so many background code:
Protected Void Paginglist_onpagechanging ( Object Sender, eventargs E)
{
Datatable datasource = createdatasource (); // Get Data Source
Paginglist. recordcount = datasource. Rows. count; // Set the total number of pages
Rptdatalist. datasource = paging. getpagingdata (datasource, paginglist. pageindex, paginglist. pagesize ); // ProgramPaging
Rptdatalist. databind (); // Data Binding
}
The demo is as follows. This serial number uses a new feature.
Author: Chen taihan
Blog: http://www.cnblogs.com/hlxs/