Conditional Grid Detail button

1 Answer 243 Views
Grid
Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
Bernd asked on 19 Aug 2022, 09:52 AM

Hi.

I am trying to only show the detail (+) button in a grid row if a field has a specific value but I can't make it work. Here is an example:

https://stackblitz.com/edit/react-skjcz7?file=app%2Fmain.tsx

As you can see, the + button in the first row does not get replaced by my new button and also if I click on my button it results in an error.

I found a quite old example from a similar thread here but it was build with a class based component. I tried to do this with my function based approach but obviously I'm missing something.

Thanks for your help!

Greetings,

Bernd

1 Answer, 1 is accepted

Sort by
1
Accepted
Konstantin Dikov
Telerik team
answered on 23 Aug 2022, 07:37 AM

Hello Bernd,

Thank you for reaching out to us.

The desired result can be achieved by handling the "cellRender" of the Grid and conditionally remove the content of the expand/collapse cell per data item. Here is an example demonstrating such implementation:

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
Answers by
Konstantin Dikov
Telerik team
Share this question
or