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

Issue with RAD grid Scrollbar

1 Answer 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hari krishna
Top achievements
Rank 1
Hari krishna asked on 27 Dec 2012, 02:39 PM
Hi ,

I'm facing one strange issue

In RAD grid ,i have an edit icon as shown in IMG1. First time when I Click on Edit Icon RAD grid scroll position is remains same not going down as shown in IMG2. But the scroll position suppose to be like shown in IMG3

But second time when i click on edit icon in rad grid scroll position is going down as expected as shown like in IMG3.

My issue is when i load the page first time and click on edit icon in rad grid , getting the scrollbar issue.


and my code for the above is shown in IMG4

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 Jan 2013, 03:42 PM
Hi Hari krishna,

Thank you for contacting us.

Please try the following approach:
<ClientEvents OnGridCreated="gridCreated" />
JavaScript:
function gridCreated(sender, eventArgs) {
    var scrollArea = document.getElementById(sender.get_element().id + "_GridData");
    var row = sender.get_masterTableView().get_editItems()[0];
 
    if (row) {
        var editForm = row.get_editFormItem();
        var formBottom = editForm.offsetTop + editForm.offsetHeight;
        var areaBottom = scrollArea.offsetTop + scrollArea.offsetHeight;
 
        if (formBottom > areaBottom) {
            setTimeout(function () {
                scrollArea.scrollTop = formBottom - scrollArea.offsetHeight;
            }, 1);
        }
    }
}

I hope this will prove helpful. Please give it a try and let me know about the result.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Hari krishna
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or