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

TileGroup Title

3 Answers 89 Views
TileList
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 09 May 2016, 02:08 PM
01.private void BuildUserGroup() {
02.             
03.            group = new TileGroup();
04.            //group.Name = "Personal";
05.            group.Title = "Personal";
06.             
07.            BuildDashboard();
08.            group.Tiles.Add(kpiTile);
09.            BuildMyCompetencies();
10.            group.Tiles.Add(kpiTile);
11.            BuildTranscript();
12.            group.Tiles.Add(tile);
13.            BuildCatalog();
14.            group.Tiles.Add(tile);          
15.            BuildIDP();
16.            group.Tiles.Add(tile);
17.            
18.            rtlTJA.Groups.Add(group);
19.        }

Above is a snippet of code I use in the code behind to create groups and tiles dynamically. It works great without referencing the Title property (image #1). When I un-comment it above, the tiles disappear (image #2).

I am using version 2016.1.113.35.

3 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 12 May 2016, 07:00 AM
Hello Randy,

I tried to replicate the scenario in a local ASP.NET site using the mentioned version, but to no avail. 

I have attached an example so that you can see if I am missing something that might be the reason for the results you experience. It would be helpful if you can further update the sample sent and provide it so that I can investigate the code that leads to the described situation. 

Regards,
Ianko
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Randy
Top achievements
Rank 1
answered on 12 May 2016, 05:14 PM
<asp:Panel runat="server" ID="pnlTJA">
 
    <telerik:RadScriptBlock runat="server" ID="rscbBrowse">
        <script type="text/javascript">
 
            function tileHover(ele) {
                addClass(ele, "tileHover");
                removeClass(ele, "tile");
            }
 
            function tileNormal(ele) {
                addClass(ele, "tile");
                removeClass(ele, "tileHover");
            }
 
            function hasClass(ele, cls) {
                return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
            }
            function addClass(ele, cls) {
                if (!hasClass(ele, cls)) ele.className += " " + cls;
            }
            function removeClass(ele, cls) {
                if (hasClass(ele, cls)) {
                    var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
                    ele.className = ele.className.replace(reg, ' ');
                }
            }
 
            function LogOutConfirm(arg) {
                if (arg) {
                    $find("<%= ramTJA.ClientID %>").ajaxRequest("LogOut");
                    window.setTimeout(Quit, 1000);                       
                }
            }
 
            function RefreshCatalog(sender, eventArgs) {
                $find("<%= ramTJA.ClientID %>").ajaxRequest("RefreshCatalog");
            }
 
            function RefreshApproval(sender, eventArgs) {
                $find("<%= ramTJA.ClientID %>").ajaxRequest("RefreshApproval");
            }
             
            function Quit() {
                window.open('', '_self', '');
                window.close();
            }
 
            function LiveError(sender, eventArgs) {
               //if(eventArgs.get_errorMessage().indexOf("500") > -1) {
                    eventArgs.set_cancelErrorAlert(true);
                //}
            }
        </script>
    </telerik:RadScriptBlock>
 
    <div class="pad bkgTrianglesSmall">
            <telerik:RadTileList runat="server" ID="rtlTJA" Height="450px" OnDataBinding="rtlTJA_DataBinding" AutoPostBack="false" CssClass="scrollNoVertical" ScrollingMode="Native" RenderMode="Lightweight" TileRows="2" />
        </div>
 
        <telerik:RadWindowManager
            runat="server"
            ID="rwmTJA"
            KeepInScreenBounds="true"
            IconUrl="~/App_Themes/TJA/images/usff_bullet_icon.gif"
            Animation="Fade"
            EnableShadow="true"            
            Behaviors="Close, Move, Resize, Maximize, Reload"
            RenderMode="Auto"
            ShowContentDuringLoad="false"
            VisibleStatusbar="false"
            VisibleOnPageLoad="false"
            Modal="true"
        />
    </asp:Panel>

Above is a code block from my default.aspx page.

protected void rtlTJA_DataBinding(object sender, EventArgs e) {
    BuildUserGroup();
     
    if(true) {
        BuildSupervisorGroup();
    }
 
    if(tjaCache.TJAUser.SecurityRole.GetAccess() >= Permissions.Edit) {
        BuildManagementGroup();
    }
    BuildSupportGroup();
}

I have methods that I use to create the tiles dynamically.

The BuildUserGroup method in the beginning of the post is called in the binding.

private void BuildCatalog() {
    tile = BuildTile(TileShape.Square, "Catalog", "bkgTileCatalog", "DisplayInCart", "Click to browse catalog");
    window = BuildWindow("Catalog", "~/Catalog/Browse.aspx", 1200, 600, true);
 
    rwmTJA.Windows.Add(window);
 
    clickAction = "radopen(null, '" + window.ID + "');";
    tile.Attributes.Add("onclick", clickAction);
}

 Each tile is built in the code behind and associated to a dynamically build RadWindow.

private RadLiveTile BuildTile(TileShape shape, String name, String cssClass, String method, String toolTip) {
    tile = new RadLiveTile();
    tile.ID = "tile" + name;
    tile.Name = name;
    tile.Attributes.Add("onmouseover", "tileHover(this)");
    tile.Attributes.Add("onmouseout", "tileNormal(this)");
    tile.WebServiceSettings.Method = method;
    tile.WebServiceSettings.Path = "Default.aspx";
    tile.ClientTemplate = "<div class='liveDiv'><span class='liveText'>#= data #</span></div>";
    tile.ClientTemplateAnimationSettings.Animation = ClientTemplateAnimation.None;
    tile.UpdateInterval = method.Equals("DisplayNothing") ? 0 : 300000;
    tile.OnClientDataLoadingError = "LiveError";
    tile.CssClass = "tile bkgTile " + cssClass;
    tile.Shape = shape;
    tile.Title.Text = name;
 
    return tile;
}

Above is the "tile factory" method.

Somewhere in this complexity, the addition of a Group.Title prevents my dynamic tiles from displaying.

0
Ianko
Telerik team
answered on 13 May 2016, 06:10 AM
Hi Randy,

I am afraid the sent code does not shed much more light on the reason for the encountered issue. 

I suggest you using the page I sent you in my previous reply as a base and build up the situation that you have on your end. By attaching it to your message I will be able to run the page and see the result you get on your end. Plus, I will be able to determine better what the difficulty is. 

On a side note, check if upgrading will not resolve the issue. The encountered situation might be an already fixed bug. 

Regards,
Ianko
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
TileList
Asked by
Randy
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Randy
Top achievements
Rank 1
Share this question
or