Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
216 views
We have a number of end-users who are photo-happy and like to have single image galleries containing 200 images or more.  When loading all these at the same time, the initial loading of the page is noticeably slow and it's hitting the server harder than it should be (creating all those thumbnails - most of which will never be seen).

To combat this, we've enabled paging and for now set the page size to be 40.  Initial testing shows that the page load times go from about 7.5 seconds back down to sub-second load.  So that's good.  However, it creates a new problem for the end-user, which is (to us) unexpected behavior when the slide-show is running (either full-screen or not).  We figured that after the 40th image on page 1, then the 1st image on page 2 would auto-magically be the next shown.  Instead, the gallery returns to the 1st image on the 1st page (if looping is on) or just stops (if it's off); forcing the user to click "page 2".

Plus, if the end-user has gone full-screen with the gallery, turned on the slide-show, then clicks to go to page 2; it returns back to the non-full-screen version of the gallery with the new set of images.

Having been with Telerik for almost 10 years now, I know you guys can do better :)  A couple suggestions...

Option 1:
The control knows whether or not paging is enabled; it should be able to detect the slide-show index AND page index in order to determine what to do when it hits an upper limit.  I'd suggest automatically going to the next page and re-starting the slideshow with the first image - basically doing what the end-user (who *will* get confused doing this) would have to do manually.  It that causes a page refresh because it's a post-back then so be it, as long as the rotation continues AND the visible state (full-screen or not) is persisted.

Option 2 (even better):
Implement a lazy-loading scenario for the images.  It appears that currently, if we were to load 200 images into the control, that upon the initial loading of the page, all 200 thumbnails are created at the same time instead of just the ones that are currently visible in the thumbnail slider.  Perhaps a better solution is to load all the images in the slider with a blank src attribute and instead use data-src; then detecting the visibility of the thumbnail to switch the data-src attribute to be the actual src attribute.  Since that would break SEO you'd probably want to make lazy-loading an option - however - in our case we don't want SEO on user-submitted image galleries anyway so that would actually be a good thing for search engines to leave them out of their image searches.

Thanks as always for listening :)

Shaun




Kostadin
Telerik team
 answered on 17 Jul 2014
4 answers
280 views
Hello,

I am currently working on a project with a RadTreeView.

I need only when I click on a leaf with no children it do a PostBack.
When I click on a leaf that has children, it will be performed expand/ collapse - depending on the current mode.
(If it has been expanded â€“ it will be collapse, if collapse - expand)

I have a js code, but it’s give me an error every time I click on a node that has children:

ASPX:
01.// TreeView_Menu Expand/Colapse When Pressing On Branch Node
02. function TreeViewExpanCollaps_OnClientNodeClicked(sender, args) {
03.     var node = args.get_node(),
04.         $element = $(node.get_element()),
05.         $selectedNodeElement;
06. 
07.     if (node.get_nodes().get_count() > 0) {
08.         if (!node.get_expanded()) {
09.             node.expand();
10.             args.set_cancel(true);
11.         }
12.         else {
13.             node.collapse();
14.             args.set_cancel(true);
15.         }
16.     }
17. 
18. 
19. }
20.  
21. <telerik:RadTreeView ID="RadTreeView1" Runat="server" Skin="MetroTouch" OnClientNodeClicked="TreeViewExpanCollaps_OnClientNodeClicked">


VB.net:
Protected Sub RadTreeView1_NodeClick(sender As Object, e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RadTreeView1.NodeClick
        lbl_txt.Text = e.Node.Text
End Sub


Errors:
Uncaught TypeError: undefined is not a function expand_colapse_treeview.aspx:28
TreeViewExpanCollaps_OnClientNodeClicked expand_colapse_treeview.aspx:28
(anonymous function) Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScri…:6
Telerik.Web.UI.RadWebControl.raiseEvent Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScri…:951
c.RadTreeView._raiseEvent Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScri…:5434
c.RadTreeView._click Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScri…:5385
Telerik.Web.UI.EventMap._onDomEvent Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScri…:3114
(anonymous function) Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScri…:6
b
(The error refers to lines  10 and 14)


How to solve this problem ?
I’ll be glad for your help.

Thanks,

Daniel.
Daniel
Top achievements
Rank 1
 answered on 17 Jul 2014
9 answers
485 views
In responsive design the DropDownTree control is usually configured with width=100%
I wonder how in this case to make the dropdown width the same as the control width to make it responsive too?
Shinu
Top achievements
Rank 2
 answered on 17 Jul 2014
4 answers
147 views
Hi,

I have a radspell with controlToCheck(Textbox1) in my web form..i want to activate the radspellcheck on button onclientclick event because button  also have onclick event..i need to fire the radspellcheck before button onclick event...Simply i want a spellcheck on button submit...i have tried but onclick event only fired fiirst..could please some example please...
karthik
Top achievements
Rank 1
 answered on 17 Jul 2014
3 answers
159 views
I have found that if you are using the ToolProvder for multiple RadEditors that the undo redo functions do not update the content when pressed ore selected from the Undo / Redo toolbar buttons or dropdowns.

The undo / redo works for the RadEditor that is the ToolProvider but not for any that use the first editors toolbar.

This can be replicated on your demo site.

http://demos.telerik.com/aspnet-ajax/editor/examples/toolprovider/defaultcs.aspx 

Replication Instructions:
  • Tick Use Tool Provider
  • Click apply settings

Type some content in the first editor, press undo - Text entered is removed
Type some content into the second editor, press undo - no changed to the text in this editor.

Note: The dropdown menu still contains a history of undo/redo commands
Ianko
Telerik team
 answered on 17 Jul 2014
1 answer
59 views
I have found that my program which includes multiple RadComboBoxes don't drop down in IE versions 9 and 10, but they work fine with IE 11 and below IE 9, could someone give me reasons as to why this is happening. 
Boyan Dimitrov
Telerik team
 answered on 17 Jul 2014
5 answers
183 views

I am using HtmlChart with scatter. I want to specify the xaxis from 7/1/2013 to Today in multiple graphics so all of them have the same xAxis no matter of the data. How I can achieve this?
How do I specify xasix min value = 7/1/2013 and maxvalue=today?

Ollie
Top achievements
Rank 1
 answered on 17 Jul 2014
12 answers
211 views
OpenArchiveWindowI have a radgrid with GridTemplateColumn that contain linkbutton :
<telerik:GridTemplateColumn HeaderText='<%$Resources:Resources,Archive %>'>
   <ItemTemplate>
      <asp:LinkButton runat="server" ID="getArchiveLB" OnClick="getArchiveLB_Click" CommandArgument='<%# Eval("CONFIGURATION_KEY") %>' OnClientClick="OpenArchiveWindow();">Archive
      </asp:LinkButton>
   </ItemTemplate>
</telerik:GridTemplateColumn>

OpenArchiveWindow() : js fct to open a radwindow :
<telerik:RadWindow runat="server" ID="ArchiveWindow" ShowContentDuringLoad="false" EnableViewState="false"
    Modal="true">
    <ContentTemplate>
        <telerik:RadGrid runat="server" ID="ConfigurationArchiveGrid" AutoGenerateColumns="true"></telerik:RadGrid>
    </ContentTemplate>
</telerik:RadWindow>

and getArchiveLB_Click() is server side fonction to databind grid ('ConfigurationArchiveGrid') inside the radwindow ('ArchiveWindow'),

inside getArchiveLB_Click: radgrid is binded , but doesn't appears inside radwindow ,

how can i achieve that ?
Asutosh
Top achievements
Rank 1
 answered on 17 Jul 2014
4 answers
254 views
I have a RadGrid hooked up to an objectdatasource, which pulls records with a GUID as it's Primary Key.  Whenever I do an update on the RadGrid I get a parse error and it shows the Guid prefixed with the PKey column name like so:

System.FormatException base Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
"{BoatID:\"280f5da9-4048-4569-9e8c-c3aea971b45e\"}"  I'm not sure why it's prefixing the GUID value w/BoatID.  I can see why it cannot parse this value.  I'm not sure how to fix this since Telerik handles the parsing behind the scences.

Info that may help:
<asp:ObjectDataSource ID="DataSource" runat="server"<br>                     <br>                    TypeName="MyNS.SomeClass.SomeMethod" <br><br>UpdateMethod="UpdateBoat"<br> ><br>             <UpdateParameters><br>                        <asp:Parameter Name="name" Type="String" /><br>                        <asp:Parameter Name="boatId" DbType="Guid" /><br>                    </UpdateParameters><br>                </asp:ObjectDataSource><br><telerik:RadGrid ID="BoatGrid"<br>                AllowAutomaticUpdates="True"<br>                AllowAutomaticInserts="True"<br>                AllowAutomaticDeletes="True"<br>                AllowSorting="True"<br>                AllowPaging="True"<br>                PageSize="5"<br>                AllowMultiRowEdit="False"<br>                EnableViewState="true"<br>                runat="server"<br>                DataSourceID="DataSource"<br>                OnItemDataBound="BoatGrid_ItemDataBound"<br>                OnItemCreated="BoatGrid_ItemCreated"<br>                OnItemUpdated="BoatGrid_ItemUpdated"<br>                OnItemDeleted="BoatGrid_ItemInserted" CellSpacing="-1"<br>                GridLines="Both"><br><Columns><br>                <MasterTableView DataSourceID="accountDataSource" CommandItemDisplay="Top" DataKeyNames="BoatID" ><br><telerik:GridClientSelectColumn ColumnGroupName="tstSelect"><br><br>                        </telerik:GridClientSelectColumn><br>                        <telerik:GridBoundColumn HeaderText="Name" DataField="Name" FilterControlAltText="Filter Name column" SortExpression="Name" UniqueName="Name"><br><br>                            <ColumnValidationSettings><br>                                <ModelErrorMessage Text=""></ModelErrorMessage><br>                            </ColumnValidationSettings><br><br>                        </telerik:GridBoundColumn><br>                        <telerik:GridBoundColumn HeaderText="BoatID" ReadOnly="true" Display="false" DataField="BoatID" DataType="System.Guid" FilterControlAltText="Filter BoatID column" SortExpression="BoatID" UniqueName=BoatID"><br>                        </telerik:GridBoundColumn><br></Columns><br>            </telerik:RadGrid>
Angel Petrov
Telerik team
 answered on 17 Jul 2014
5 answers
286 views
hi,

i have been following this example to build a chart with drill down functionality. 
https://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx

<div class="dashboard_div_doublewidth">
                        Business Unit Task Distribution
                            <telerik:RadCodeBlock ID="codeBlock" runat="server">
                                <script type="text/javascript">
                                    function OnClientSeriesClicked(sender, args) {
                                        if (args.get_seriesName() != "Users") $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(args.get_category());
                                    }
                                </script>
                            </telerik:RadCodeBlock>
                            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                                <AjaxSettings>
                                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                                        <UpdatedControls>
                                            <telerik:AjaxUpdatedControl ControlID="RadHtmlChart4" LoadingPanelID="LoadingPanel1">
                                            </telerik:AjaxUpdatedControl>
                                        </UpdatedControls>
                                    </telerik:AjaxSetting>
                                    <telerik:AjaxSetting AjaxControlID="Refresh">
                                        <UpdatedControls>
                                            <telerik:AjaxUpdatedControl ControlID="RadHtmlChart4" LoadingPanelID="LoadingPanel1">
                                            </telerik:AjaxUpdatedControl>
                                        </UpdatedControls>
                                    </telerik:AjaxSetting>
                                </AjaxSettings>
                            </telerik:RadAjaxManager>
                            <telerik:RadHtmlChart ID="RadHtmlChart4" runat="server" DataSourceID="SqlDataSource_DrillDownL1"
                                OnClientSeriesClicked="OnClientSeriesClicked" Height="330px" Skin="Office2010Blue"
                                Width="750px">
                                <PlotArea>
                                    <Series>
                                        <telerik:ColumnSeries DataFieldY="TotalTasks" Name="TotalTasks">
                                            <TooltipsAppearance Color="White" />
                                        </telerik:ColumnSeries>
                                        <telerik:ColumnSeries DataFieldY="CompletedTasks" Name="CompletedTasks">
                                        </telerik:ColumnSeries>
                                        <telerik:ColumnSeries DataFieldY="IncompletedTasks" Name="IncompletedTasks">
                                        </telerik:ColumnSeries>
                                    </Series>
                                    <XAxis DataLabelsField="CBUName">
                                    </XAxis>
                                </PlotArea>
                            </telerik:RadHtmlChart>
                            <asp:SqlDataSource ID="SqlDataSource_DrillDownL1" runat="server" ConnectionString="<%$ ConnectionStrings:customerRelationshipIndexDB_FinalConnectionString %>"
                                SelectCommand="SELECT CBUName, SUM(TotalTasks) AS TotalTasks, SUM(CompletedTasks) AS CompletedTasks, SUM(TotalTasks) - SUM(CompletedTasks) AS IncompletedTasks FROM (SELECT CBUName, COUNT(TaskId) AS TotalTasks, 0 AS CompletedTasks FROM V_ContactsToBeCompleted WHERE (DueDate BETWEEN @start AND @end ) GROUP BY CBUName UNION SELECT CBUName, 0 AS TotalTasks, COUNT(TaskId) AS CompletedTasks FROM V_ContactsToBeCompleted AS V_ContactsToBeCompleted_1 WHERE (DueDate BETWEEN @start AND @end ) AND (IsTaskCompleted = 'true') GROUP BY CBUName) AS t GROUP BY CBUName">
                                <SelectParameters>
                                    <asp:Parameter Name="start" />
                                    <asp:Parameter Name="end" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <asp:HiddenField ID="HiddenField1" runat="server" />
                            <asp:SqlDataSource ID="SqlDataSource_DrillDownL2" runat="server" ConnectionString="<%$ ConnectionStrings:customerRelationshipIndexDB_FinalConnectionString %>"
                                SelectCommand="SELECT Brand, SUM(TotalTasks) AS Brand_TotalTasks, SUM(CompletedTasks) AS Brand_CompletedTasks, SUM(TotalTasks) - SUM(CompletedTasks) AS Brand_IncompletedTasks FROM (SELECT Brand, COUNT(TaskId) AS TotalTasks, 0 AS CompletedTasks FROM V_ContactsToBeCompleted WHERE (DueDate BETWEEN @start AND @end ) AND (CBUName = @cbu) GROUP BY Brand UNION SELECT Brand, 0 AS TotalTasks, COUNT(TaskId) AS CompletedTasks FROM V_ContactsToBeCompleted AS V_ContactsToBeCompleted_1 WHERE (DueDate BETWEEN @start AND @end ) AND (IsTaskCompleted = 'true') AND (CBUName = @cbu) GROUP BY Brand) AS t GROUP BY Brand">
                                <SelectParameters>
                                    <asp:Parameter Name="start" />
                                    <asp:Parameter Name="end" />
                                    <asp:Parameter Name="cbu" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <asp:HiddenField ID="HiddenField2" runat="server" />
                            <asp:SqlDataSource ID="SqlDataSource_DrillDownL3" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:customerRelationshipIndexDB_FinalConnectionString %>" 
                                SelectCommand="SELECT AccountName, SUM(TotalTasks) AS Account_TotalTasks, SUM(CompletedTasks) AS Account_CompletedTasks, SUM(TotalTasks) - SUM(CompletedTasks) AS Account_IncompletedTasks FROM (SELECT AccountName, COUNT(TaskId) AS TotalTasks, 0 AS CompletedTasks FROM V_ContactsToBeCompleted WHERE (DueDate BETWEEN @start AND @end ) AND (CBUName = @cbu) AND (Brand = @brand) GROUP BY AccountName UNION SELECT AccountName, 0 AS TotalTasks, COUNT(TaskId) AS CompletedTasks FROM V_ContactsToBeCompleted AS V_ContactsToBeCompleted_1 WHERE (DueDate BETWEEN @start AND @end ) AND (IsTaskCompleted = 'true') AND (CBUName = @cbu) AND (Brand = @brand) GROUP BY AccountName) AS t GROUP BY AccountName">
                                <SelectParameters>
                                    <asp:Parameter Name="start" />
                                    <asp:Parameter Name="end" />
                                    <asp:Parameter Name="cbu" />
                                    <asp:Parameter Name="brand" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" Height="77px" Width="113px" runat="server">
                            </telerik:RadAjaxLoadingPanel>
                            <br />
                        </div>

public void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        string seriesName = RadHtmlChart4.PlotArea.Series[0].Name;

        if (seriesName == "TotalTasks")
        {

            string cbu = e.Argument;
            HiddenField1.Value = cbu;
            SqlDataSource_DrillDownL2.SelectParameters[0].DefaultValue = GetStartDate();
            SqlDataSource_DrillDownL2.SelectParameters[1].DefaultValue = GetEndDate();
            SqlDataSource_DrillDownL2.SelectParameters[2].DefaultValue = cbu;
            RadHtmlChart4.PlotArea.XAxis.DataLabelsField = "Brand";
            RadHtmlChart4.PlotArea.Series[0].DataFieldY = "Brand_TotalTasks";
            RadHtmlChart4.PlotArea.Series[0].Name = "Brand_TotalTasks";
            RadHtmlChart4.PlotArea.Series[1].DataFieldY = "Brand_CompletedTasks";
            RadHtmlChart4.PlotArea.Series[1].Name = "Brand_CompletedTasks";
            RadHtmlChart4.PlotArea.Series[2].DataFieldY = "Brand_IncompletedTasks";
            RadHtmlChart4.PlotArea.Series[2].Name = "Brand_IncompletedTasks";
            RadHtmlChart4.DataSourceID = "SqlDataSource_DrillDownL2";
        }
        else
        {
            if (seriesName == "Brand_TotalTasks")
            {
                string brand = e.Argument;
                HiddenField2.Value = brand;
                SqlDataSource_DrillDownL3.SelectParameters[0].DefaultValue = GetStartDate();
                SqlDataSource_DrillDownL3.SelectParameters[1].DefaultValue = GetEndDate();
                SqlDataSource_DrillDownL3.SelectParameters[2].DefaultValue = HiddenField1.Value;
                SqlDataSource_DrillDownL3.SelectParameters[3].DefaultValue = brand;
                RadHtmlChart4.PlotArea.XAxis.DataLabelsField = "Brand";
                RadHtmlChart4.PlotArea.Series[0].DataFieldY = "Account_TotalTasks";
                RadHtmlChart4.PlotArea.Series[0].Name = "Account_TotalTasks";
                RadHtmlChart4.PlotArea.Series[1].DataFieldY = "Account_CompletedTasks";
                RadHtmlChart4.PlotArea.Series[1].Name = "Account_CompletedTasks";
                RadHtmlChart4.PlotArea.Series[2].DataFieldY = "Account_IncompletedTasks";
                RadHtmlChart4.PlotArea.Series[2].Name = "Account_IncompletedTasks";
                RadHtmlChart4.DataSourceID = "SqlDataSource_DrillDownL3";
            }
            else
            {
                if (seriesName == "Account_TotalTasks")
                {
                    string brand = e.Argument;
                    HiddenField2.Value = brand;
                    SqlDataSource_DrillDownL3.SelectParameters[0].DefaultValue = GetStartDate();
                    SqlDataSource_DrillDownL3.SelectParameters[1].DefaultValue = GetEndDate();
                    SqlDataSource_DrillDownL3.SelectParameters[2].DefaultValue = HiddenField1.Value;
                    SqlDataSource_DrillDownL3.SelectParameters[3].DefaultValue = brand;
                    RadHtmlChart4.PlotArea.XAxis.DataLabelsField = "Brand";
                    RadHtmlChart4.PlotArea.Series[0].DataFieldY = "Brand_TotalTasks";
                    RadHtmlChart4.PlotArea.Series[0].Name = "TotalTasks";
                    RadHtmlChart4.PlotArea.Series[1].DataFieldY = "Brand_CompletedTasks";
                    RadHtmlChart4.PlotArea.Series[1].Name = "CompletedTasks";
                    RadHtmlChart4.PlotArea.Series[2].DataFieldY = "Brand_IncompletedTasks";
                    RadHtmlChart4.PlotArea.Series[2].Name = "IncompletedTasks";
                    RadHtmlChart4.DataSourceID = "SqlDataSource_DrillDownL3";
                }
            }
        }
    }

this is my code... it's not fully completed but this is how it's supposed to be like. i want to drill my data in the following order starting from "Business Unit" -> "Brand" -> "Account" -> "User" 
for some reason i can only click and view 1 level of detail, that is i can go from "Business Unit" -> "Brand".
the chart doesn't allow me to click on columns that i see when "Brand" details are loaded. 
can you suggest a reason for that and a solution for me. Thank you. 
Danail Vasilev
Telerik team
 answered on 17 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?