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

Resize grid page with grouping applied

1 Answer 48 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gosha
Top achievements
Rank 1
Gosha asked on 02 Oct 2010, 10:14 AM
I use this code to resize grid page to fit spliter container and browser window

Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)
        Dim rows As Integer = (Int32.Parse(Me.RadPane2.Height.Value.ToString()) - 80) / 27
If rows >= 1 Then
grid.MasterTableView.PageSize = rows
grid.Rebind()
End If
End Sub

and that works ok but problem is when grid have grouping. Group headers use some space and question ih how to determine how groups have each page to corect pagesize property? One page can have 1 group and another 10 or more...

If grid.MasterTableView.GroupByExpressions.Count <> 0 Then
rows = rows - ???
End If



1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 04 Oct 2010, 10:06 AM
Hi Sasa,

You can use

grid.MasterTableView.GetItems(GridItemType.GroupHeader)

to see how many group headers you have. However, a lot easier solution is to use scrolling of the RadPane or RadGrid (but not both).

All the best,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Gosha
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or