3 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 28 Jan 2013, 08:06 AM
Hi,
Please check the following code snippet I tried to set the scroll position at the bottom of the RadGrid.
ASPX:
Javascript:
Thanks,
Shinu.
Please check the following code snippet I tried to set the scroll position at the bottom of the RadGrid.
ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="true" DataSourceID="Sqldatasource1"> <ClientSettings Selecting-AllowRowSelect="true"> <ClientEvents OnGridCreated="GridCreated" /> <Scrolling AllowScroll="true" ScrollHeight="300px" UseStaticHeaders="true" /> </ClientSettings></telerik:RadGrid>Javascript:
<script type="text/javascript"> function GridCreated(sender, eventArgs) { var scrollArea = document.getElementById(sender.get_element().id + "_GridData"); var length = sender.get_masterTableView().get_dataItems().length; var row = sender.get_masterTableView().get_dataItems()[length - 1]; scrollArea.scrollTop = row.get_element().offsetTop; }</script>Thanks,
Shinu.
0
Hi,
Note that in order to set the vertical scroll at the bottom of the Grid in Firefox SaveScrollPosition property should be set to false, otherwise the code provided by Shinu will not work:
Regards,
Pavlina
Telerik
Note that in order to set the vertical scroll at the bottom of the Grid in Firefox SaveScrollPosition property should be set to false, otherwise the code provided by Shinu will not work:
<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="false" />Regards,
Pavlina
Telerik
See What's Next in App Development. Register for TelerikNEXT.
0
Akshit
Top achievements
Rank 1
answered on 13 Jun 2016, 11:59 PM
Hi Shinu,
Do you have any idea where I can perform the operation in code behind rather than javascript.