DataGrid control Pieces, the page has colors

xiaoxiao2021-03-17  197

Implementing paging in DataGrid is quite simple, but if you use a page number paging, you will not know the page number of the current page, which will be troublesome. There are a lot of solutions, which mainly tells how to add the current page number.

Simply add the following code in the DataGrid1_itemcreated event:

Private void DataGrid1_itemcreated (object sender, system.web.ui.webcontrols.dataGriditeMEventAndargs e) {listiteMTYPE ELEMTYPE = E.Item.ItemType;

IF (ELMTYPE == ListItemType.pager) {Tablecell Pager = (TableCell) E.Item.controls [0];

For (int i = 0; i ";}}}}

转载请注明原文地址:https://www.9cbs.com/read-129692.html

New Post(0)