Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ricardo Covo 13 posts 33 karma points
    Jun 15, 2011 @ 15:05
    Ricardo Covo
    0

    Issue using 3rd Party Controls (ComponentArt)

    Hello Everyone,

    I want to use ComponentArt's datagrid in one of my projects, but it doesn't seem to be working for me. The usage of it is pretty simple, as follow: 

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProjectList.ascx.cs" Inherits="RIM.GCSS.Tracker.Web.ProjectList" %>
    <%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
    <link href="../css/blackice/theme.css" rel="stylesheet" type="text/css" />
    <link href="../css/blackice/icons.css" rel="stylesheet" type="text/css" />
    
    <ComponentArt:Grid
        runat="server" ID="Grid1" FillContainer="true"
        PageSize="15" ShowHeader="true" RunningMode="Callback"
        AutoTheming="true">
        <Levels>
            <ComponentArt:GridLevel>
            <Columns>
                <ComponentArt:GridColumn DataField="ProjectId" HeadingText="Project ID" SortedDataCellCssClass="SortedDataCell" Width="25" FixedWidth="true"/>
                <ComponentArt:GridColumn DataField="Description" HeadingText="Description" SortedDataCellCssClass="SortedDataCell" Width="150" />               
            </Columns>
            </ComponentArt:GridLevel>
        </Levels>
        </ComponentArt:Grid>

    In the code behind I simply bind to the grid:

    projList = services.GetAll().Take(10).ToList();
    Grid1.DataSource = projList;
    Grid1.DataBind();

     

    I have this on a user control. If I use it on my page it works. If I create a macro and use it on a page in Umbraco, it doesn't. The grid renders, but is completely empty.

    When I see the code behind, I can see many things are generated by the ComponentArt's Grid. Even the data is there in a javascript block, but the grid is completely empty, no headers, not footer, no anything. 

    I've done extensive debugging and found that the Grid is calling some /WebResources.axd; I thought that might be a problem with the urlRewriter, but when I see it on Fiddler it seems to be working. 

    I've also added "~/WebResources.axd" to the reserved URLs and added  "WebResources.axd" as an HTTPHandler both in system.web. and system.webserver sections. No luck.

    Any ideas?

  • jaygreasley 416 posts 403 karma points
    Jun 15, 2011 @ 22:28
    jaygreasley
    0

    Hi,

    when you say it works on your page, do you mean outside Umbraco?

    If so, then it sounds to me like the component can not see the services assembly.

    I use a GAC registered assembly from a razor script, to do this I need to add the assembly details to the Umbraco web.config.

    hth

    Jay

  • Ricardo Covo 13 posts 33 karma points
    Jun 15, 2011 @ 23:15
    Ricardo Covo
    0

    Hi Jay, thanks for the suggestion.

    It turns out that it has something to do with the auto-generated-ids. Component Art downloads and generates a lot of javascript. After much detailed investigation, I noticed one of the references to the container for the grid was not accurate. 

    It turned out to be a good pointer as I started to see the options to generate the client id for the component.

    The problem got fixed when I added the ClientIDMode="AutoID". So the tag for the datagrid would be like this:

     <ComponentArt:Grid
                runat="server"
                ID="Grid1"
                FillContainer="true"
                PageSize="15"
                ShowHeader="true"
                RunningMode="Client"
                AutoTheming="true"
                OnItemContentCreated="Grid1_ItemContentCreated"
                 ClientIDMode="AutoID">

    I really hope this saves some time for other developers

    Thanks again for your quick response. 

    -Ricardo

  • Ricardo Covo 13 posts 33 karma points
    Jun 16, 2011 @ 06:02
    Ricardo Covo
    0

    One more comment. This seems to be a known issue with Component Art controls that reside on pages with Master Pagers.

    So nothing to do with Umbraco it self, just with master pages in general.

Please Sign in or register to post replies

Write your reply to:

Draft