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

[Solved] Prevent a RadGrid Group from Collapsing

3 Answers 531 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Suresh Mishra
Top achievements
Rank 1
Suresh Mishra asked on 30 Oct 2009, 08:49 PM
This is a two part question:

1.  How do can show the group header and yet prevent the group from collapsing?

2.  I format my own header and footer for the RadGrid by inserting rows in the ItemCreated event of the rad grid. If I do this, the original headeing for the RadGrid does not appear.  However, if the collpase header icon on the group header is clicked so hte group collapses, the radgrid header I created disappears and so does the footer.  How can I prevent this from happening?  Can this be prevented, is a call back is triggered?  If yes, then how do I trigger a call back when collapse / expand icon in the group header is clicked.

Thanks.

Suresh

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Nov 2009, 09:38 AM
Hi,

Try setting the GroupsDefaultExpanded property of the MasterTableView property to True. This will set the groups in expanded mode

ASPX:
 <MasterTableView GroupsDefaultExpanded="true"
</MasterTableView > 

To hide the Group Expand/Column use the following code snippet
C#
// to hide the Group Expand/Collapse column   
   
 protected void RadGrid2_ColumnCreated(object sender, GridColumnCreatedEventArgs e)   
    {   
        if (e.Column is GridGroupSplitterColumn)   
        {   
            e.Column.Display = false;   
        }   
    }   
 


Thanks,
Shinu
0
Suresh Mishra
Top achievements
Rank 1
answered on 02 Nov 2009, 05:10 PM
Shinu,

Thanks for your reply.  However, the code you suggested did not work for preventing the user from collapsing the group.  Here is the vb code I used:

 

Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated

 

 

If e.Column.ColumnType = "GridGroupSplitterColumn" Or _

 

e.Column.ColumnType =

"GridExpandColumn" Then

 

e.Column.Display =

False

 

 

End If

 

 

End Sub

 


Suresh
0
Martin
Telerik team
answered on 05 Nov 2009, 03:22 PM
Hello Suresh,

Please check the following help topic:

Preventing groups expansion by hiding the expand/collapse images

I hope this helps.

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Suresh Mishra
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Suresh Mishra
Top achievements
Rank 1
Martin
Telerik team
Share this question
or