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

Implementing Max Height when Using a Web Service

7 Answers 107 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 15 Jun 2011, 01:21 PM
Hi,

I have a menu that is being populated via a web service. It is functioning correctly right now, however, a couple levels deep in the nesting has the items display off the screen. We need to implement a max height on the boxes to prevent this. How would we do this with the control? I have tried using the Group Settings height, however cannot get the desired behavior.

Thanks,
Steve

7 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 15 Jun 2011, 05:46 PM
Hello Steve,

Have you tried setting EnableAutoScroll and see if that helps. Also, do you have EnableScreenBoundaryDetection turned on?
0
Kate
Telerik team
answered on 16 Jun 2011, 02:34 PM
Hi Steve,

Since the issue that you encounter is not a trivial one I would suggest that you open a support ticket and send us a sample runnable project where we can reproduce the issue and help you out with a solution. Providing an image demonstrating the problem would also be very helpful.  

Best wishes,
Kate
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Steve
Top achievements
Rank 1
answered on 16 Jun 2011, 02:34 PM
EnableScreenBoundaryDetection was already on. I EnableAutoScroll = true. but now I just get the popup container cutting off the extra items. I can see they are there, but there is no scroll.
0
Steve
Top achievements
Rank 1
answered on 16 Jun 2011, 02:57 PM
A sample will take me a little while to construct. In the meantime, here is a screenshot of the issue.

0
Kate
Telerik team
answered on 21 Jun 2011, 01:23 PM
Hello Steve,

I suitable solution for the issue that you encounter would be the following code (as I already described in the support ticket that you sent). However, since your scenario is a very customized one, and to avoid any confusion, I would suggest that we continue the communication there.

<script type="text/javascript">
 
        function itemOpened(sender, args) {
 
            var item = args.get_item();
            var childCount = item.get_items().get_count();
            var scrollWrapElement = args.get_item()._getScrollWrapElement();
            var groupHeight = item.get_groupSettings().get_height();
            var itemHeight = item.get_element().offsetHeight;
            itemHeight = childCount * itemHeight;
            if (itemHeight < parseInt(groupHeight)) {
                scrollWrapElement.style.height = itemHeight + "px";
            }
        }
 
    </script>

markup
<telerik:RadMenu ID="RadMenu1" runat="server" EnableRoundedCorners="true" EnableShadows="true"
    OnClientItemPopulated="itemOpened">
    <WebServiceSettings Path="ProductCategories.asmx" Method="GetMenuCategories" />
    <LoadingStatusTemplate>
        <asp:Image runat="server" ID="LoadingImage" ImageUrl="Images/loading.gif" ToolTip="Loading..."
            Width="16px" Height="16px" Style="margin-top: 8px" />
    </LoadingStatusTemplate>
    <Items>
        <telerik:RadMenuItem Text="Products" Value="1" ExpandMode="WebService">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Purchase" Value="132" ExpandMode="WebService">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Support" Value="141" ExpandMode="WebService">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Community" Value="155" ExpandMode="WebService">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Corporate" Value="164" ExpandMode="WebService">
        </telerik:RadMenuItem>
    </Items>
    <DefaultGroupSettings Height="100px" />
</telerik:RadMenu>


Regards,
Kate
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
jolynice
Top achievements
Rank 1
answered on 28 Sep 2011, 08:25 PM
Hi everyone,

I have the same problem, thereĀ“s a solution?

Thanks,

Jolynice
0
Helen
Telerik team
answered on 30 Sep 2011, 02:00 PM
Hi Jolynice,

Did you try the solution below?
Note that in LoadOnDemand scenarios you should subscribe to the OnClientItemPopulated client-side event.

All the best,
Helen
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
Menu
Asked by
Steve
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Kate
Telerik team
Steve
Top achievements
Rank 1
jolynice
Top achievements
Rank 1
Helen
Telerik team
Share this question
or