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

[Solved] Grid row expand collapse on row selection

2 Answers 56 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.
Srikanth
Top achievements
Rank 1
Srikanth asked on 07 May 2012, 02:33 PM
Hi,

I want to expand/collapse the row details on row selection too. I got the expanding working. However for collapsing is there a way to check the row state(expanded/collapsed).
My client side event handler for row selection is as follows

function onRowSelected(e) {
        var grid = $(e.target).data('tGrid');
        grid.expandRow(e.row);
    }

Can you please let me know how to collapse the row if it was expanded already ??

thanks in advance,
Srikanth.

2 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 07 May 2012, 02:48 PM
Hello Srikanth,

You can use the following approach to check if the detail-row is expanded:
function onRowSelect(e) {
            var grid = $(e.target).data('tGrid');
 
            if (!$(e.row).next().is('.t-detail-row:visible')) {
                grid.expandRow(e.row);
            }
            else {
                grid.collapseRow(e.row);
            }
        }

I hope this helps.

Greetings,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Atith
Top achievements
Rank 1
answered on 21 Jan 2013, 04:50 PM
Hi,

I want the detailview event to be fired based on the specific condition,

e.g. if quantity>10 then only fire detailview event orelse hide the detailview event and disable that master grid complete Row.

Can anyone please let me know how to work on such requirement...please reply... ??
Tags
Grid
Asked by
Srikanth
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Atith
Top achievements
Rank 1
Share this question
or