When using DataGrid, there will always have a variety of needs, and the most used in the project deal with the database will be DataGrid, and Microsoft sometimes does that, so I need us. I have been implemented.
DataGrid custom paging navigation
No other third-party controls are required, on the basis of DataGrid's own paging. Effect:
Let DataGrid's own paging achieve this effect [1] [2] [3] [4] [5] [6]
Let DataGrid's own paging achieve this effect [1] [2] [3] [4] [5] [6]
private void grid_ItemCreated (object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {if (e.Item.ItemType == ListItemType.Pager) {foreach (Control c in e.Item.Cells [0] .Controls) { IF (c is label) // Current page {label lblpage = (label) c; // lblpage.forecolor = system.drawing.colortranslator.fromhtml ("# e
78A
29 "); // # e
78A
29, # ff0000 // lblpage.font.bold = true; lblpage.text = "[
78A 29> lblpage.text " b> font>]"; // (((Label )c ).ForeColor = system.drawing.color.green; // Break;} if (c is LinkButton) // Link Other Pages {LinkButton LinkButton = (LinkButton) C; LinkButton.Text = "[" LinkButton.Text "]";}}}} Auto number in controls such as DataGrid: Add a template column: Creating complex heads in DataGrid Method 1: Implement with Table