We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Hierarchical grid?

Thread ID:

Created:

Updated:

Platform:

Replies:

102037 Dec 15,2011 03:50 PM Jan 18,2012 09:06 AM ASP.NET MVC (Classic) 6
loading
Tags: Grid
Greg Clouston
Asked On December 15, 2011 03:50 PM

In the hierarchical grid is there any way to prevent the expanding of certain rows? I'd like to allow only child grids with two or more rows to be expandable. Removing the CSS class "MasterCellCollapse" seems to have some side effects. Is there a proper means to accomplish what I want?


Eswari S [Syncfusion]
Replied On December 21, 2011 03:47 AM

Hi Greg,

Thank you for using Syncfusion products.

Query #1 : In the hierarchical grid is there any way to prevent the expanding of certain rows?

We can prevent the expanding of the rows in hierarchical grid by handling OnRecordExpanding event. Please refer to the following code snippets:

<%=Html.Syncfusion().Grid("GridSrc")
. . . . .
.ClientSideEvents(eve =>
{
eve.OnRecordExpanding("OnExpanding");
})
.ChildGrid(child =>
{
. . . . .
.ToChildGridTemplate());
})
%>


[JavaScript]



For your convenience , we have prepared the sample and the same can be downloaded from the following link:

Sample397622127.zip

Note: If you want to run the sample in MVC3, change the configuration manager as Debug_MVC3/Release_MVC3.To briefly know about that steps please kindly refer this document link.

How to Switch between MVC2 to MVC3

Query #2 : I'd like to allow only child grids with two or more rows to be expandable.

In your scenario , we need to get the child record count to cancel the expanding of record. We cannot get the child records count in expanding event. We can only get the record count of child grid after expanding.

Please let us know if you have any other queries.

Regards,
Eswari.S




Greg Clouston
Replied On January 5, 2012 09:15 AM

Thanks for the information. With the data I have I know whether or not the child grid will have more than one record in it or not. My question to you is: Can I turn off the hierarchical grid on a row by row basis?


Ranjithkumar R G [Syncfusion]
Replied On January 10, 2012 06:54 AM

Hi Greg,

Thanks for your update.

We would like to like to let you know that we can disable the expanding of particular rows in the client side row expanding event by specifying the id of the rows. We don't have separate property to turn off the hierarchy. We suggest you to specify the id's which you need not to expand . Please refer to the code snippet below.

[JavaScript]



Please refer to the below link to download the sample application.

http://www.syncfusion.com/downloads/Support/DirectTrac/88902/Sample388765696.zip

Please let me know if you have any concern.

Regards,
Ranjithkumar



Greg Clouston
Replied On January 11, 2012 01:41 PM

Thanks for the sample project. With your help I was able to add the expanding cell suppression to our project.

One more question for you. Is there any way to change the icon in the expand collapse column? I'd like to differentiate between a row that can be expanded and one that can't be.


Greg Clouston
Replied On January 16, 2012 03:54 PM

Any movement on this issue? Do I need to file a support ticket?


Ranjithkumar R G [Syncfusion]
Replied On January 18, 2012 09:06 AM

Hi Greg,

Thanks for your update.

We would like to let you know that it is not possible to change the expand/ collapse image in the hierarchical grid based on some condition.

Please let us know if you have any concern.

Regards,
Ranjithkumar.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;