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

Dynamic Scroll Height

1 Answer 43 Views
Designs, skins, themes
This is a migrated thread and some comments may be shown as answers.
Fenil
Top achievements
Rank 1
Fenil asked on 10 Apr 2014, 11:46 AM
Hi,
I  have a common aspx page.
I have one "Rad Tab" control in which we are loading the diffrent usercontrol dynamically as a content of the each tab control.
Each user control having "Rad Grid" in it, and grid has static header and scoll area.
I want to set the  the scroll area height of grid as per user desktop height.
I tried with setting up scroll area height dynamically in "Grid Created" event. Its working but when I move from one tab to another the previous tab grid height get reser to its default height.
If anyone has came across such issue let me know.

Thanks,
Fenil

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 14 Apr 2014, 01:58 PM
Hi Fenil,

Your problem is most probably caused by the fact that RadGrid cannot adjust its layout properly when it is placed inside an invisible container on the page (this is needed when using static headers). In order to prevent this behavior you can try to obtain a reference to the RadGrid client object once its container is visible (e.g. subscribe to RadTabStrip's OnClientTabSelected) and call the repaint() method of the grid as shown below.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
        <script type="text/javascript">
            function ClientTabSelected(sender, eventArgs) {
                var radgrid = $find('<%= RadGrid1.ClientID %>');
                radgrid.repaint(); 
            }
        </script>        
</telerik:RadCodeBlock>

Give this suggestion a try and see if it works for you.

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Designs, skins, themes
Asked by
Fenil
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or