This is a migrated thread and some comments may be shown as answers.

[Solved] Paging in DetailTable - Go To Page Number

1 Answer 230 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jes
Top achievements
Rank 1
Jes asked on 22 Jun 2009, 12:53 PM
I am trying to implement go to page number functionality in a detail table and can't seem to get it to work right.  I'd like to implement it using client side code and tried the following based loosely on a demo.

    function txtPendingReleaseInfo_ValueChanged(sender, args) 
    { 
        var grid =$find("<%= RGPendingCases.ClientID %>"); 
        var detailTables = grid.get_detailTables();

        var release = detailTables[1]; 
        release.page(sender.get_value()); 
    } 

There are 3 detail tables, the one I'm trying to access in this case is the second one.

I also tried something server side that didn't work as well.

    Protected Sub txtPendingReleaseInfo_OnTextChanged(ByVal sender As ObjectByVal e As EventArgs) 
        Dim txtPendingReleaseInfo = DirectCast(sender, Telerik.Web.UI.RadNumericTextBox) 
        Dim PageIndex As Integer 
        Integer.TryParse(txtPendingReleaseInfo.Text, PageIndex) 
 
        Dim ChildGrid = RGPendingCases.MasterTableView.DetailTables(1)  
        If PageIndex < 1 Then 
            PageIndex = 1 
        End If 
        ChildGrid.CurrentPageIndex = PageIndex - 1 
        ChildGrid.Rebind() 
    End Sub 

In this case, ChildGrid had a null ClientID, but all the other properties represented the correct grid.  Calling Rebind on it never fires the bind code.  The only way I seemed to be able to get this to work was to do

DirectCast(RGPendingCases.Controls(1).Controls(0).Controls(4).Controls(1).FindControl(ControlName), Telerik.Web.UI.GridTableView) 

and I really detest that way.

Any suggestions or examples I can look at?  I couldn't find any demos that did this.

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 25 Jun 2009, 08:28 AM
Hello Jes,

To get reference to the exact detail table in the grid, you can traverse the hierarchy structure in the following manner. Thus you can find the detail table in question and change its page size. Using the DetailTables collection is not appropriate since it holds the prototype of each nested table at a given level, not a particular detail table instance.

Additionally, have in mind that RadGrid supports two advanced grid pagers which expose 'Go to page' option out-of-the-box. You can see them here.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Jes
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or