Hi ,
I am trying to do on demand loading for WebHierarchicalDataGrid by using custom paging.The concept is we have to pull only 15 records from database and bind to grid. So in the custom paging control I will be sending the next number from the custom control when next button of custompage control is clicked then i will get the next 15 records from the database.
This i have done in webdatagrid by placing a template like following.
<ig:Paging PagerAppearance="Bottom" PageSize="25" PagerCssClass="igg_CustomPager" Enabled="true"> <PagerTemplate> <ucCPC:CustomPagerCtrl ID="CustomPagerCtrl1" runat="server"></ucCPC:CustomPagerCtrl> </PagerTemplate> </ig:Paging>
and defining an event for the custom control CustomPagerCtrl in code behind.
_pgControl = wdgCommunications.Behaviors.Paging.PagerTemplateContainerBottom.FindControl("CustomPagerCtrl1") as UsrCtrlPagerControl; if (_pgControl != null) { _pgControl.PageChanged += (PagerControlPageChanged); }
This is working fine in webdatagrid. But when i am doing this in WebHierarchicalGrid my custompaging user control is not found in the following code
wdgCommunications.Behaviors.Paging.PagerTemplateContainerBottom.FindControl("CustomPagerCtrl1")
the above code is not returning control so i am unable to attach event to it.
Please help.
Thanks and Regards,
Kiran
Hi David,
This is the answer solves my problem. but i am getting an other error which is not related to this question. I have converted WebDataGrid to WebHierarchicalDataGrid. I was bidning the webDataGrid with the data of List of some objects. in the next page it used to get the new page data and bind it using
wdgCommunications.DataSource = ViewState["MC"]; wdgCommunications.DataBind();
Where as viewstate contains the list collection of objects that i am binding to grid.
But now after converting to the WebHierarchicalDataGrid in next page I am getting following error.
Unable to cast object of type 'Infragistics.Web.UI.Framework.Data.DataRecord' to type 'System.Web.UI.IHierarchyData'.
Can you please reply me today i have depending work tomarrow.
Hi Kiran,
I have answered this question in another forum post. http://community.infragistics.com/forums/p/44108/240784.aspx#240784
You need to search off of wdgCommunications.GridView.Behaviors.Paging.PagerTemplateContainerBottom
regards,
David Young