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

Setting the Detail Template based programatically

2 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 2
Veteran
Iron
Grant asked on 08 Nov 2018, 08:53 AM

Hi, 

So as my title says I want to be able or remove the detail template of my grid . Is such a thing possible?

Regards, 

Grant

2 Answers, 1 is accepted

Sort by
0
Alex Hajigeorgieva
Telerik team
answered on 12 Nov 2018, 08:00 AM
Hello, Grant,

It is possible to hide the expand icon of some rows in the Kendo UI Grid or use a function for the detail template that may vary dependent on the dataItem.

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/configuration/detailtemplate

Alternatively, you may use the detailInit template and remove the detailRow programmatically:

detailExpand: function(e) {
 e.detailRow.remove();
}

Finally, the setOptions() method could be used as well to change of the grid options:

https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/setoptions

If you are able to share more details on the desired outcome and behaviour - such as when to remove the detailTemplate, should the expand icon of the row also be removed, I could share a more specific code sample best suited for the desired result.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Grant
Top achievements
Rank 2
Veteran
Iron
answered on 12 Nov 2018, 08:25 AM

Hi Alex, 

Thanks for the response, The setOptions worked perfectly. Sorry for wasting your time on something so simple, I know why I think of it.

Thanks,
Grant

Tags
Grid
Asked by
Grant
Top achievements
Rank 2
Veteran
Iron
Answers by
Alex Hajigeorgieva
Telerik team
Grant
Top achievements
Rank 2
Veteran
Iron
Share this question
or