Hi,
my client needs a second horizontal scrollbar, in top of RadGrid.
I used to do it with this Javascript function:
The element "divGrid" is the HTML div that contains the grid.
This code works properly with .NET GridView, but it doesn't work with Telerik RadGrid. RadGrid creates more "div" elements than GridView and these divs have the value "0" for scrollWidth property.
Can anybody help me?
Thanks a lot
my client needs a second horizontal scrollbar, in top of RadGrid.
I used to do it with this Javascript function:
function dobleScroll() {
var element = document.getElementById('divGrid');
if (element == null) {
setTimeout('dobleScroll();', 1000);
}
else {
var scrollbar = document.createElement('div');
scrollbar.appendChild(document.createElement('div'));
scrollbar.style.overflow = 'auto';
scrollbar.style.overflowY = 'hidden';
scrollbar.style.width = element.clientWidth + 'px';
scrollbar.firstChild.style.width = element.scrollWidth + 'px';
scrollbar.firstChild.style.paddingTop = '1px';
scrollbar.firstChild.appendChild(document.createTextNode('\xA0'));
scrollbar.onscroll = function () {
element.scrollLeft = scrollbar.scrollLeft;
};
element.onscroll = function () {
scrollbar.scrollLeft = element.scrollLeft;
};
element.parentNode.insertBefore(scrollbar, element);
}
}
The element "divGrid" is the HTML div that contains the grid.
This code works properly with .NET GridView, but it doesn't work with Telerik RadGrid. RadGrid creates more "div" elements than GridView and these divs have the value "0" for scrollWidth property.
Can anybody help me?
Thanks a lot