NestedViewTemplate - RadGrid - How to autosize height

Raka

I have a RadGrid inside a NestedViewTemplate. I want it to auto-size its height to match number of rows in the Grid. So if the grid is empty, it should show one row with 'No Records Found'. If there are more rows, it should resize the height to contain those. This is to avoid having a fixed size space with lots of blanks.

How can I do this?

Thank you
Raka

Kostadin

Note that the Grid will automatically adjust the height based on the items in it if you do not set a height of the control. In case your requirement differs could you please elaborate more on your scenario?

Regards,
Kostadin
Telerik by Progress

Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.

Raka

Thank you for your reply. However, it is not automatically adjusting the height.

I have a nested grid inside the main grid. I set the height of main grid. If I do not set a height for NestedGrid, it picks some number and the nested grid area is big. If I set the "ScrollHeight" for nested grid to something like '200px', then it looks reasonable. But I want it to be automatically (dynamically) adjusted to the number of rows it contains.

Kostadin

In order the grid to change the height dynamically you should not set a height neither to the MainGrid nor to the nested RadGrid. You can check out the following live example which demonstrates a NestedViewTemplate with a grid in it.

Regards,
Kostadin
Telerik by Progress

Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.