Hi,
Here I need to set radmenu fit to screen (browser). Please assist me how can I achieve it? My Menu binding is dynamic from database.
ref. http://demos.telerik.com/aspnet-ajax/menu/examples/functionality/scrolling/defaultcs.aspx
What I have tried (As below):
JavaScript:
HTML:
Thanks & Regards,
Kaushal Jani
Here I need to set radmenu fit to screen (browser). Please assist me how can I achieve it? My Menu binding is dynamic from database.
ref. http://demos.telerik.com/aspnet-ajax/menu/examples/functionality/scrolling/defaultcs.aspx
What I have tried (As below):
JavaScript:
<script type=
"text/javascript"
>
function
pageLoad() {
var
menu = $find(
"<%= RadMenu1.ClientID %>"
);
debugger;
var
menuWid = getWindowWidth() +
"px"
;
menu.offsetWidth = menuWid;
menu._element.offsetParent.clientWidth = menuWid;
menu._element.offsetParent.scrollWidth = getWindowWidth() - 100 +
"px"
;
menu.repaint();
}
window.onresize = pageLoad;
function
getWindowWidth() {
var
windowWidth = 0;
if
(
typeof
(window.innerWidth) ==
'number'
) {
windowWidth = window.innerWidth;
}
else
{
if
(document.documentElement && document.documentElement.clientWidth) {
windowWidth = document.documentElement.clientWidth;
}
else
{
if
(document.body && document.body.clientWidth) {
windowWidth = document.body.clientWidth;
}
}
}
return
windowWidth;
}
</script>
HTML:
<
telerik:RadMenu
ID
=
"RadMenu1"
runat
=
"server"
EnableRootItemScroll
=
"true"
width
=
"100%"
EnableRoundedCorners
=
"true"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Arial"
/>
<
telerik:RadMenuItem
Text
=
"Verdana"
/>
<
telerik:RadMenuItem
Text
=
"Tahoma"
/>
<
telerik:RadMenuItem
Text
=
"Sans-serif"
/>
<
telerik:RadMenuItem
IsSeparator
=
"true"
/>
<
telerik:RadMenuItem
Text
=
"Arial"
/>
<
telerik:RadMenuItem
Text
=
"Arial Black"
/>
<
telerik:RadMenuItem
Text
=
"Arial Narrow"
/>
<
telerik:RadMenuItem
Text
=
"Arial Unicode MS"
/>
<
telerik:RadMenuItem
Text
=
"Bookman Old Style"
/>
<
telerik:RadMenuItem
Text
=
"Bookshelf Symbol 7"
/>
<
telerik:RadMenuItem
Text
=
"Century"
/>
<
telerik:RadMenuItem
Text
=
"Century Gothic"
/>
<
telerik:RadMenuItem
Text
=
"Comic Sans MS"
/>
<
telerik:RadMenuItem
Text
=
"Courier New"
/>
<
telerik:RadMenuItem
Text
=
"Garamond"
/>
<
telerik:RadMenuItem
Text
=
"Georgia"
/>
<
telerik:RadMenuItem
Text
=
"Goudy Old Style"
/>
<
telerik:RadMenuItem
Text
=
"Goudy Stout"
/>
<
telerik:RadMenuItem
Text
=
"Haettenschweiler"
/>
<
telerik:RadMenuItem
Text
=
"Helvetica"
/>
<
telerik:RadMenuItem
Text
=
"Impact"
/>
<
telerik:RadMenuItem
Text
=
"Imprint MT Shadow"
/>
<
telerik:RadMenuItem
Text
=
"Latha"
/>
<
telerik:RadMenuItem
Text
=
"Lucida Console"
/>
<
telerik:RadMenuItem
Text
=
"Lucida Sans"
/>
<
telerik:RadMenuItem
Text
=
"Lucida Sans Typewriter"
/>
<
telerik:RadMenuItem
Text
=
"Lucida Sans Unicode"
/>
</
Items
>
</
telerik:RadMenu
>
Thanks & Regards,
Kaushal Jani