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

groupby only display first two items

2 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
appdev
Top achievements
Rank 1
appdev asked on 04 Dec 2008, 02:59 AM
everytime i tried to do this, it will only display a few not all.

dt.Load(rs)

RadGrid1.HeaderStyle.VerticalAlign = VerticalAlign.Middle

RadGrid1.HeaderStyle.HorizontalAlign = HorizontalAlign.Center

RadGrid1.Width = 868

RadGrid1.MasterTableView.Width = UnitType.Pixel

RadGrid1.MasterTableView.Width = 868

RadGrid1.MasterTableView.Height = UnitType.Percentage

RadGrid1.MasterTableView.Height = 100

RadGrid1.ClientSettings.Resizing.AllowColumnResize =

True

 

RadGrid1.ExportSettings.ExportOnlyData =

True

 

RadGrid1.ExportSettings.IgnorePaging =

True

 

RadGrid1.DataSource = dt

RadGrid1.AllowPaging =

True

 

RadGrid1.AutoGenerateColumns =

True

 

RadGrid1.AllowSorting =

True

 

RadGrid1.Height = 768

RadGrid1.ClientSettings.Resizing.ClipCellContentOnResize =

False

 


Dim

expression As GridGroupByExpression = New GridGroupByExpression

 

 

Dim gridGroupByField As GridGroupByField = New GridGroupByField

 

gridGroupByField =

New GridGroupByField

 

gridGroupByField.FieldName =

"section"

 

gridGroupByField.HeaderText =

"Total for Section "

 

expression.SelectFields.Add(gridGroupByField)

expression.GroupByFields.Add(gridGroupByField)

 

 

RadGrid1.MasterTableView.GroupByExpressions.Add(expression)

 

RadGrid1.MasterTableView.TableLayout = GridTableLayout.Fixed

RadGrid1.ClientSettings.Scrolling.AllowScroll =

True

 

 

 

 

RadGrid1.ClientSettings.Scrolling.UseStaticHeaders =

True

 

 

 

 

 

Dim item As GridItem

 

RadGrid1.Rebind()

 

For Each item In RadGrid1.MasterTableView.Controls(0).Controls

 

 

If TypeOf item Is GridGroupHeaderItem Then

 

 

 

 

item.Expanded =

False

 

 

 

 

 

End If

 

 

 

 

 

Next

 

 

for example
if i have a column section with
apple
apple
pear fruit
strawberry
peanut butter
peanut butter,
i only get apple and pear fruit back. why is this the problem? i know i get all of the databack because if i go to the next page, it will show up the strawberry and peanut butter. and so i put a break point in the line item.expand = false, i noticed that only a few items get into that loop not all. mostly the first two. can you help me ? Thank you for your help.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Dec 2008, 05:08 AM
Hi Duy,


My understanding of your scenario is that you are trying to put all the groups in the same page when you collapse the Groupheader .
But this only  collapses the grouped items and doesn't  decrease the page size. To achieve your scenario  remove paging to show all the groups together.

Thanks,
Princy





0
appdev
Top achievements
Rank 1
answered on 04 Dec 2008, 11:40 AM
if that is the case that i have to remove paging then when i expand the group, how do i have paging again?
Tags
Grid
Asked by
appdev
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
appdev
Top achievements
Rank 1
Share this question
or