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

How to dynamically calculate width of grid

1 Answer 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mukesh
Top achievements
Rank 1
Mukesh asked on 14 Aug 2019, 09:20 AM

I have a panel bar and grid in same page. I want to calculate available width/ space on the screen and assign the same width to the grid. So that grid will have same width. It will not grow beyond that. It there any way to do that.

 

Regards,

Mukesh 

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 14 Aug 2019, 10:55 AM
Hello, Mukesh,

The width of the Grid can be dynamically set with its style property.

For example the width value can be bound to the state. Then when the width of the Panelbar element is known, the same width can set dynamically to the Grid:

https://stackblitz.com/edit/react-imarjk?file=app/main.jsx

Regards,
Stefan
Progress Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Mukesh
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or