I am trying to achieve a paging with custom databinding in Infragistics WebHierarchicalDataGrid control. Desired behavior when user clicks a page link in WHDG pager is to retrieve one page of data from backend (I already have an SQL Server SP that does that) and bind it to WHDG to display 1 page at a time.
I believe using “ContainerGridDataBinding” event is the way to do it but unable to set up a working code. Any help or code examples of how to do it is greatly appreciated.
It would also be great if same behavior persisted on child bands of the WHDG
Once you have your SQL requests/select commands you are going to get a single page you will want to create a custom pager to do this. Then in the events tied to the buttons/dropdown or other control you have in the pager you would call your SQL commands. Please see the following for how to implement the custom pager for the WebDataGrid:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=WebDataGrid_Using_Custom_Paging_Template.html
Custom pager through code:
http://help.infragistics.com/NetAdvantage/ASPNET/2012.1/CLR4.0/?page=WebDataGrid_Using_Custom_Paging_Template_in_Code.html
Doing this for the WebHierarchicalDataGrid will be the same for parent band. For children you will want to do it for the behaviors of that band instead of the parent band.
Now if you don’t want to use buttons and/or dropdowns in your pager and instead want links (1,2,3,4, etc.) this can be done by doing the following in code:
The real issue though is when getting data this way from the database where you only get enough data for one page so the grid has no idea how many pages there are in the database. So you will either need to know how to find this or just know it. This also will make the implementing the child band more difficult as you will need to know for each row that can expanded how many child records or pages of records there are.