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

Issue with same pager for master and detail

6 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 12 Nov 2012, 01:46 PM
Hi, 

I have 2 questions regarding the grid

1. Same pager for master and detail
As you can see in attached picture I obtain 80 items for master table, which is correct behaviour and that pager looks correct... But when I click on the row, detail table is generated and there is the same pager for 80 items even if I have there only 4 rows obtained and displayed...  

I get data through "NeedDataSource"...

2. Display pager all the time
How can I display pager under any circumstances for the master table ? I have grid with page size equal to 10, but 8 rows are obtained and no pager is displayed. But I need it to display it because user may want sometimes change the pagesize. Is this any way how it can be done ?

Thanks for the reply...

6 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 12 Nov 2012, 04:35 PM
Hello,

Please check below link to set the custom pagertextformat.

http://www.telerik.com/help/aspnet-ajax/grid-using-pagertextformat.html

Thanks.
Jayesh Goyani
0
Peter
Top achievements
Rank 1
answered on 12 Nov 2012, 09:25 PM
Hi,

thanks for the reply... I don't mind format of pager ... I have the problem that master and detail table share the same pager as it was shown on my attachement... In detail table there are only 4 rows... I wasn't expecting there pager with pages and 80 items... This information should be only for master table...

Don't you know what can cause it ?

Thanks,

Peter
0
Accepted
Eyup
Telerik team
answered on 15 Nov 2012, 07:55 AM
Hi Peter,

For displaying the pager item at any time, please enable the following property:
<MasterTableView ... PagerStyle-AlwaysVisible="true">

As for the repeating pager issue, I am afraid we are not able to determine the reason for the problem just by the provided information so far. Could you reproduce this behavior with any of our demos?
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx

Please open a support ticket to send us a sample runnable application demonstrating the problematic appearance or provide us the exact steps to reproduce the issue. Thus, we will be able to further analyze the issue and provide a proper solution.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Peter
Top achievements
Rank 1
answered on 15 Nov 2012, 12:33 PM
Thanks for that solution with AlwaysVisible... That's what I needed...

And with that pager issue I don't know how it happened... I will need to extract everything and imitate the behaviour, because now it's implemented into our system environment and it will take some time to prepare it, but I will try to make it, because I really need to solve this issue. I can't give the system to customer with such an error... 

Thanks again...

Peter
0
Peter
Top achievements
Rank 1
answered on 16 Nov 2012, 09:02 AM
Well, 

I found my problem... Such a stupid mistake ;-)

I set VirtualItemCount only for master grid and I forgot to set it also for the detail table so detail table somehow get it from master table... 

protected void RadGridResults_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) {
  GridDataItem item = (GridDataItem)e.DetailTableView.ParentItem;
 
  switch (e.DetailTableView.Name) {
    case "flightsegmentInfo":
      HiddenField BKNGID = (HiddenField)item.FindControl("BKNGID");
 
          DataTable dt = getFlightInfoTable(BKNGID.Value);
 
          e.DetailTableView.DataSource = getFlightInfoTable(BKNGID.Value);
          e.DetailTableView.VirtualItemCount = dt.Rows.Count;
          break;
  }
}

After setting VirtualItemCount also for detail table it started to work correctly...  Well, it's honest mistake because I am new with custom paging... 

Anyway thanks for the help and solving that AlwaysVisible... 

Peter
0
FISCAL
Top achievements
Rank 1
answered on 06 Dec 2012, 03:00 PM
Thanks for finding and solving the problem.

I was using

grid.MasterTableView.DetailTables[0].VirtualItemCount = totalCount;

and it wasn't working.
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Peter
Top achievements
Rank 1
Eyup
Telerik team
FISCAL
Top achievements
Rank 1
Share this question
or