How to set the size on TreeList?

2 Answers 136 Views
TreeList
Ciprian Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Ciprian Daniel asked on 01 Feb 2023, 08:00 AM

Hello,
Now the TelerikTreeList component is rendered by default with the css class k-grid-md.
On the TelerikGrid component the Size can be set so the grid can be rendered with the css class k-grid-sm.

I would need the possibility to set on TelerikTreeList component the css class k-grid-sm.
How can that be achieved now?

Best regards,
Cipri

2 Answers, 1 is accepted

Sort by
0
Justin
Telerik team
answered on 03 Feb 2023, 07:20 PM | edited on 23 Apr 2023, 03:30 PM

This answer was using information regarding a different component and as such it was incorrect and has been removed. 

Regards,
Justin
Progress Telerik

Learn about the important changes coming in UI for Blazor 4.0 in January 2023!
Rob
Top achievements
Rank 1
Iron
Iron
commented on 19 Apr 2023, 12:54 PM

I'm using the latest release of the components; if I add your suggested Size="sm" the treelist disappears from the rendered view. It also doesn't seem to be recognised by visual studio as a valid property. 

I simply want consistency between grid and treelist row size.

I'm rendering a hierarchical data set if that matters.

 

Thanks

 

Rob

Rob
Top achievements
Rank 1
Iron
Iron
commented on 19 Apr 2023, 12:55 PM

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Object of type 'Telerik.Blazor.Components.TelerikTreeList`1[[Metre2.Snowdrop.Shared.Schema.Estimating.EstimateNode, Metre2.Snowdrop.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' does not have a property matching the name 'Size'.
System.InvalidOperationException: Object of type 'Telerik.Blazor.Components.TelerikTreeList`1[[Metre2.Snowdrop.Shared.Schema.Estimating.EstimateNode, Metre2.Snowdrop.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' does not have a property matching the name 'Size'.
 
0
Justin
Telerik team
answered on 23 Apr 2023, 04:14 PM

Hello Rob,

Yes, the previous answer was incorrect. I apologize for any inconvenience that this may have caused. The TreeList component does not currently have a Size parameter. 

That being said, you may manually adjust the CSS to create consistency between the size of the Treelist and a Grid that is set to Size="sm". To help with this see our article on how to Override Theme Styles.

Also, I have created an example in this REPL, that uses inline CSS to override the default size of the Treelist in order to be consistent with the size of a small grid.

Regards,
Justin
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
TreeList
Asked by
Ciprian Daniel
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Justin
Telerik team
Share this question
or