Hi:
I plan to use the Web Grid for displaying large number of records using ASP.NET. The issue i am facing currently is that when I enable paging, i cannot restrict the no of page links that appears in the page. If i have 10000 records in the resultset and the page size is set as 10, it displays 1000 page links pointing to all the pages. i want only a few of the links to be displayed, let's say 5 of them. Remaining links can be accessed using a "Next" or "Previous" button/link.
I have seen an example under the JSF examples where the output is how i should get it
, but for ASP.NET, i can't find a similar one.
How it is coming currently is shown below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
How i want it is shown below.
<Previous> 5 6 7 8 9 <Next>
-Faustus.
You can use custom paging links as demonstrated in the WebGrid-XmlPaging sample
The code in the InitializeLayout event for WebGrid 2 will set up the grid for custom paging and set up the custom labels for the footer.
I am trying to use this example, but cannot get the InitializeLayout event to fire. I put in the event handler, like this:
this.UltraWebGrid1.InitializeLayout += new Infragistics.WebUI.UltraWebGrid.InitializeLayoutEventHandler(this.UltraWebGrid1_InitializeLayout);
but the UltraWebGrid1_InitializeLayout code never gets executed.
The PageIndexChanged event fires okay. The InitializeDataSource doesn't fire, but I don't expect it to, since I am not creating the data source programmatically.
But how do I get the InitializeLayout to fire, since I want to change the page number options at the bottom of the screen?