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

[Solved] Hide Expand / Collapse image in Master Detail Grid

5 Answers 209 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ashok
Top achievements
Rank 1
Ashok asked on 03 Aug 2011, 03:03 PM
We are using Telerik Master Detail (Parent / Child) Grid. In this scenario, Telerik shows "+" / "-" to collapse / expand. Our requirements demands that if we have multiple Master Detail record, we keep "+" / "-" sign. However if we only have one Master record and corresponding details grid we always keep details grid expanded and we don't show "+" / "-" image.

How can we achieve this?

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 03 Aug 2011, 03:19 PM
Hi Tejas,

 This is not supported by Telerik Grid for ASP.NET MVC out of the box. The expand/collapse button is always shown when there is a detail row. Probably some jQuery workaround can be invented but it would be very specific to your scenario. If this is mandatory for you please provide more info about what you need. Ideally you can send us a sample running project which shows the current configuration and explain what the desired behavior should be. A screenshot would also be of help.

All the best,
Atanas Korchev
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

0
Ashok
Top achievements
Rank 1
answered on 03 Aug 2011, 03:36 PM
Hello Atanas,

Look at the attached screens. Let is know if its possible to achieve this?
0
Dimo
Telerik team
answered on 04 Aug 2011, 02:48 PM
Hi Tejas,

The requested behavior can be achieved with the following script:


function removeIcons(e) {
    if ($("> .t-grid-content > table > tbody > .t-master-row", this).length == 1) {
        window.setTimeout(function () { $(".t-hierarchy-cell .t-icon").css("visibility", "hidden"); }, 1);
    }
}

The above function checks how many expandable master rows you have. It should be executed as a Grid OnLoad handler if you are using server binding, and as an OnDataBound handler if you are using client binding.


Regards,
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

0
Ashok
Top achievements
Rank 1
answered on 09 Aug 2011, 08:50 PM
Thank you. Script above worked perfect when we have scroll enabled. With no scrolls, this doesn't work.

Any tweaks? Also, why do we need window.setTimeout?
0
Atanas Korchev
Telerik team
answered on 10 Aug 2011, 06:28 AM
Hi Tejas,

 You can try this which should work when the grid is not scrollable:

function removeIcons(e) {
    if ($(".t-master-row"this).length == 1) {
        $(".t-hierarchy-cell .t-icon").css("visibility""hidden");
    }
}

The setTimeout is probably not needed.

Regards,
Atanas Korchev
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
Ashok
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Ashok
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or