Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
56 views

Good morning! I would like to know if it is possible to save the state of the radtreelist with the nodes that were opened or closed and this way when the user reloads the screen it will be displayed the way it was before?

Radtreelist asp.net c#

Vasko
Telerik team
 answered on 31 Oct 2024
1 answer
38 views

Two issues on the RadScheduler Weekview column header:

  1. How to disable the clickable link in the column header?
  2. We want to only show dayname as header eg. "Sunday Monday Tuesday". What format string to use herefore?

Thanks,

Marc

 

Vasko
Telerik team
 answered on 31 Oct 2024
1 answer
67 views

How can I get the index of the series item on a Line Chart when clicking on it?

I am using OnSeriesClick

        function OnSeriesClick(args) {
            alert(args.value);
        }

I don't care about the value of the item, what I need is the index of it in the series.

Thanks,

 


Vasko
Telerik team
 answered on 31 Oct 2024
1 answer
51 views
In the gantt chart web client, when I shift one of the tasks that has a chain of dependent tasks below it, the dependencies don't shift the same number of days; I have to manually edit each one.

Am I missing something, or is this not a feature?

Thanks!
Rumen
Telerik team
 answered on 31 Oct 2024
0 answers
56 views

Hi Telerik Team,

One of our requirements is to keep the timeline column header fixed during vertical scrolling when there are numerous records displayed that extend beyond the default view. This feature is essential for improving user navigation and readability.

The following picture depicts the implementation. 

 

The output. 

Could you please advise if there is a method or configuration available to achieve this behavior within the Telerik RadScheduler component?

 Regards,

Sathyendranath

Sathyendranath
Top achievements
Rank 1
Iron
Iron
 asked on 28 Oct 2024
1 answer
32 views

I would like to disable ability to click on chart legend items.

Any ideas?

 

Thank you

Vasko
Telerik team
 answered on 28 Oct 2024
1 answer
43 views

I am using a RadCaptcha control in my web page. If I don't input anything in the textbox of RadCaptcha or enter an invalid code, then after the ajax postback returns the client-side Validity object for the RadCaptcha textbox as shown below is always showing that RadCaptcha is valid when it's not. I thought the Validity object should reflect the invalid state of RadCaptcha.  There is only one RadCaptcha in my web page.

Why is the client-side Validity object on RadCaptcha's textbox not showing the correct state? Can I check on the client-side if RadCaptcha is valid since the Validity object is not reliable. I am using Telerik ASP.NET AJAX Q2 2020 version.

Rumen
Telerik team
 answered on 25 Oct 2024
1 answer
47 views
This is a test project I'm working on, here is the .master page

<%@ Master Language="VB" CodeFile="TelMenu.master.vb" Inherits="ZForges_TelMenu" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <title></title>

    <meta name="viewport" content="width=device-width, initial-scale=1 shrink-to-fit=no">

    
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript"> 

       
            function OnClientItemClicking(sender, args)
            {                
                if (args.get_item().get_navigateUrl() === null)
                {
                    args.get_item().open();
                    args.set_cancel(true);
                }
            }
          
        </script>
    </telerik:RadCodeBlock>

</head>
<body >
    <form id="form1" runat="server">       
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <div class="container-fluid">
            <div class="row BannerRow">
                <div class="col-10 col-sm-6 text-left h3">
                    Title here
                </div>                
            </div>
     
            <div class="row">
                <div class="col-12">
                    <%--<telerik:RadMenu ID="rdMenu" runat="server" ShowToggleHandle="true" OnClientItemClicking="OnClientItemClicking" ExpandAnimation-Type="None" CollapseAnimation-Type="None"></telerik:RadMenu>--%>
                    <telerik:RadNavigation ID="rdNav" runat="server" MenuButtonPosition="Left"></telerik:RadNavigation>
                </div>
            </div>

            <div class="row">
                <div class="col-12">
                    <asp:ContentPlaceHolder id="cpMain" runat="server">
                    </asp:ContentPlaceHolder>
                </div>
            </div>
        </div>

     
    </form>   
</body>
</html>

the code behind of the .master page below

Imports System.Data
Imports Telerik.Web.Device.Detection
Imports Telerik.Web.UI

Partial Class ZForges_TelMenu
    Inherits System.Web.UI.MasterPage

    Private Sub ZForges_TelMenu_Load(sender As Object, e As EventArgs) Handles Me.Load
        Try

            If Not IsPostBack Then

                LoadMenu(Session("UserID"))

             
            End If

        Catch ex As Exception
           
        End Try
    End Sub

    Private Sub LoadMenu(iUserID As Integer)
        Try
            Dim objUser As New TestClass

            'rdMenu.DataSource = objUser.GetUserMenu(iUserID)
            'rdMenu.DataTextField = "MenuName"
            'rdMenu.DataNavigateUrlField = "URL"
            'rdMenu.DataFieldID = "MenuID"
            'rdMenu.DataValueField = "MenuID"   
            'rdMenu.DataFieldParentID = "ParentID"
            'rdMenu.DataBind()


            rdNav.DataSource = objUser.GetUserMenu(iUserID)
            rdNav.DataTextField = "MenuName"
            rdNav.DataNavigateUrlField = "URL"
            rdNav.DataFieldID = "MenuID"
            rdNav.DataFieldParentID = "ParentID"
            rdNav.DataBind()

            objUser = Nothing

        Catch ex As Exception
         
        End Try
    End Sub



End Class


a simple .aspx page with a radbutton on it

<%@ Page Title="" Language="VB" MasterPageFile="~/ZForges/TelMenu.master" AutoEventWireup="false" CodeFile="Welcome.aspx.vb" Inherits="ZForges_Welcome" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cpMain" Runat="Server">      
    Welcome Page    
    <telerik:RadButton ID="btnSearch" runat="server" Text="RadButton"></telerik:RadButton>

</asp:Content>


the radnavigation loads just fine for the first time, then its contents disappear after a postback
when I click the radbutton on the child page (welcome.aspx) the rad navigation contents disappear, if I use a radmenu instead, its able to hold the values

can someone explain whats going on?
Attila Antal
Telerik team
 answered on 22 Oct 2024
1 answer
180 views
I am using the file upload feature and getting a 403 error in the OnClientFileUploadFailed function. It only occurs on some files not all. I have already confirmed it is not an issue with the file extension. I am also confident it is not an issue with file size.

Any ideas why this could be happening? What are situations where a 403 error would occur here? Are there any steps I could take to further narrow down the issue?
Rumen
Telerik team
 answered on 22 Oct 2024
1 answer
40 views

Created js function to edit cells using OnBatchEditClosed and  OnBatchEditOpened. The cells appear to "update" fine in terms of numbers and get a little red icon on cell. Yet whenever click save or attempt to edit a second cell get an error that can't read null properties on getElementsByTagName. 

Basically anything that involves GridBatchEditing again seems to cause an issue. How to resolve?


 //new Object()
        class Step4Rec {
            constructor() {
                this.monthForecast_PreviousVal = "";
                this.safetyStock_PreviousVal = 0;
                this.qtyPlanned_PreviouisVal = 0
            }
        };

        var step4OriginalData = new Array();

        //var DatesStartToEnd = new Array();
        var dateHelp = "T00:00:00";//adding z at end means UTC/Greenwich

        
        const DatesToProcessRec = {
            processingDate : new Date()
            , theYear : 2024 
            , theMonthNotZeroBased : 1
            , theMonthZeroBased : 0
            , theDay : 1
        };


        //OnBatchEditClosed="Step4PlanningEditsClosed" OnBatchEditOpened="Step4PlanningItemOpened" 
        function Step4PlanningEditsClosed(sender, args) {
            
            let grid = sender;
            let masterTableView = grid.get_masterTableView();
            let dataItems = masterTableView.get_dataItems();

            let todayDate = new Date();
            let modMonth = todayDate.getMonth();
            let modDay = 1;
            let modYear = todayDate.getYear();

            try {
                for (var i = 0; i < dataItems.length; i++) {
                    let monthForecast = dataItems[i].get_cell("MonthForecast").innerText;
                    let safetyStock = parseInt(dataItems[i].get_cell("SafetyStock").innerText);
                    let qtyPlanned = parseInt(dataItems[i].get_cell("QtyPlanned").innerText);

                    if (i < dataItems.length - 3)
                        safetyStock = 2;    
                    else
                        safetyStock = 0;
                
                    if (safetyStock > 0) {

                        let getCurrentMthRecord = monthForecast.split("/");
                        let theYear = getCurrentMthRecord[1];
                        let theMonth = MonthConversion(getCurrentMthRecord[0]);
                        let theCurrentMthRecordDate = new DateConversion(theMonth, theYear);

                        let revert = false;

                        for (let j = 1; j <= safetyStock && safetyStock != 0 && revert == false; j++) {
                            //last month can't have a stock value other then 0 as there are no more records
                            if (j + i < dataItems.length - 1) {
                                let expectedMonth = new Date(theCurrentMthRecordDate.setMonth(theCurrentMthRecordDate.getMonth() + 1));

                                let nextMonthForecast = dataItems[i+j].get_cell("MonthForecast").innerText;
                                let getNextMthRecord = nextMonthForecast.split("/");
                                let theNextYearOfRec = getNextMthRecord[1];
                                let theNextMonthOfRec = MonthConversion(getNextMthRecord[0]);
                                theNextRecordMthRecordDate = new DateConversion(theNextMonthOfRec, theNextYearOfRec);

                                //console.log(theNextRecordMthRecordDate.toString() + "|" + expectedMonth.toString());
                                if (theNextRecordMthRecordDate.getTime() === expectedMonth.getTime()) {
                                    let safetyStockToAdd = parseInt(dataItems[j + i].get_cell("QtyPlanned").innerText);
                                    qtyPlanned += safetyStockToAdd;
                                }
                                else {
                                    revert = true;
                                }
                            }
                            else {
                                revert = true;
                            }                                                          
                        }

                        if (revert == true) {

                            for (let k = 0; k < step4OriginalData.length; k++) {
                                //console.log(dataItems[k].get_cell("MonthForecast").innerText .toString() + " | " + step4OriginalData[k].monthForecast.toString())
                                if (dataItems[k].get_cell("MonthForecast").innerText == step4OriginalData[k].monthForecast) {
                                    dataItems[k].get_cell("SafetyStock").innerText = step4OriginalData[k].safetyStock.toString();
                                    dataItems[k].get_cell("QtyPlanned").innerText = step4OriginalData[k].qtyPlanned.toString();
                                }                                    
                            }

                            throw new Error("Invalid number of safety stock months specified. If safety stock months is greater then 0, please be sure following months are included in previous forecast steps.");
                            //alert("Invalid number of safety stock months specified. If safety stock months is greater then 0, please be sure following months are included in previous forecast steps.");
                        }

                        dataItems[i].get_cell("QtyPlanned").innerText = qtyPlanned;       
                    }//end if
                        //else it should be 0 or less (technically only 0) and just keep the number that is in the box that was sent on close
                }//end for
                console.log("before save changes call");
                //saveChangesToGrid();
                //console.log("after save changes call");
            } catch (error) {
                console.log(error.toString());
                alert(error.toString());
            }
        }// end function

        function DateConversion(month, year) {      
            //console.log("month: " + month.toString() + " | year: " + year.toString());
            return new Date(year.toString() + "-" + ("0" + month.toString()).slice(-2) + "-01"  + dateHelp);
        }

        function MonthConversion(str3LtrMonth) {

            switch (str3LtrMonth.toLowerCase()) {
                case "jan": return 1;
                case "feb": return 2;
                case "mar": return 3;
                case "apr": return 4;
                case "may": return 5;
                case "jun": return 6;
                case "jul": return 7;
                case "aug": return 8;
                case "sep": return 9;
                case "oct": return 10;
                case "nov": return 11;
                case "dec": return 12;
                default: throw new Error("month value not found");
            }
        }

        
        function Step4PlanningItemOpened(sender, args) {
            step4OriginalData.length = 0;

            let grid = sender;
            let masterTableView = grid.get_masterTableView();
            let dataItems = masterTableView.get_dataItems();

            let itemCellQtyPlanned = args.get_cell("QtyPlanned");
            let itemCellValue = sender.get_batchEditingManager().getCellValue(itemCellQtyPlanned);

            let rowItem = args.get_row();
            //assuming monthfrecast is in column 1 (first column)
            let itemCellMonthForecast = rowItem.children[0].innerText.toString();
               
            //console.log("::setup::");

            for (let i = 0; i < dataItems.length; i++) {
                let recordStep4 = new Step4Rec();
                
                recordStep4.monthForecast = dataItems[i].get_cell("MonthForecast").innerText;
                recordStep4.safetyStock = dataItems[i].get_cell("SafetyStock").innerText;
                recordStep4.qtyPlanned = dataItems[i].get_cell("QtyPlanned").innerText;

                //attempt to input missing data another way
                if ((recordStep4.qtyPlanned == undefined || recordStep4.qtyPlanned == "") && recordStep4.monthForecast.toString() == itemCellMonthForecast.toString() ) {
                    recordStep4.qtyPlanned = itemCellValue;
                }

                step4OriginalData.push(recordStep4); 
                //console.log(recordStep4.monthForecast.toString() + " | " + recordStep4.safetyStock.toString() + " | " + recordStep4.qtyPlanned.toString());
            }

            /*
            console.log("::output::");
            for (var od = 0; od < step4OriginalData.length; od++) {
                console.log("od: " + od.toString());
                console.log(step4OriginalData[od].monthForecast.toString() + " | " + step4OriginalData[od].safetyStock.toString() + " | " + step4OriginalData[od].qtyPlanned.toString());
            }
            */
        }

 


<telerik:RadWizardStep 
                        ID="StepAggregateDemand" 
                        Title="4. Aggregate Demand" 
                        StepType="Step" 
                        Enabled="false" 
                        Active="false" 
                        runat="server">
                        <telerik:RadAjaxPanel ID="RadAjaxPanelAggregateDemand" runat="server" AsyncPostBackTimeout="20000"   LoadingPanelID="RadAjaxLoadingPanelAggregateDemand"> 
                        <div style="height:30px">
                            <span> 
                                <telerik:RadButton ID="RadButtonNextStepAggregateDemand" Skin="Default" Text="Next" CssClass="button_buttonNext" Width="80px" Height="22px" ToolTip="Click to see next destination"  runat="server" ButtonType="LinkButton" OnClientClicking="OnNextClicking"></telerik:RadButton>     
                                <telerik:RadButton ID="RadButtonPreviousStepAggregateDemand" Skin="Default" Text="Previous" CssClass="button_buttonPrevious" Width="80px" Height="22px" ToolTip="Click to see previous destination"  runat="server" ButtonType="LinkButton" OnClientClicking="OnPreviousClicking" ></telerik:RadButton>                                                    
                            </span>
                        </div>
                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelAggregateDemand" AsyncPostBackTimeout="1200"  runat="server" Skin="Default" Modal="true" /> 
                            <telerik:RadGrid 
                                AutoGenerateColumns="false" 
                                ID="RadGridAggregateDemand" 
                                CssClass="CenterAll"  
                                RenderMode="Lightweight"  
                                AllowFilteringByColumn="false" 
                                AllowSorting="false" 
                                OnItemDataBound="RadGridAggregateDemand_ItemDataBound" 
                                OnItemCommand="RadGridAggregateDemand_ItemCommand"
                                ShowFooter="true" 
                                runat="server" 
                                PageSize="100" 
                                OnBatchEditCommand="RadGridAggregateDemand_BatchEditCommand">
                                <ExportSettings>
                                    <Excel Format="Xlsx"  />
                                </ExportSettings>
                                <GroupingSettings  CaseSensitive="false" />
                                <ClientSettings  EnableRowHoverStyle="false" AllowKeyboardNavigation="true" >
                                    <ClientEvents OnBatchEditClosed="Step4PlanningEditsClosed" OnBatchEditOpened="Step4PlanningItemOpened" /> 
                                </ClientSettings>
                                <MasterTableView 
                                    AutoGenerateColumns="false" 
                                    EditMode="Batch"   
                                    CommandItemDisplay="TopAndBottom" 
                                    DataKeyNames="MonthForecast" 
                                    Name="MonthForecast"   
                                    AllowFilteringByColumn="false" 
                                    ShowFooter="true" 
                                    AllowSorting="false">
                                    <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click"  />
                                    <CommandItemSettings  
                                        ShowAddNewRecordButton="false"  
                                        ShowRefreshButton="false" 
                                        ShowCancelChangesButton="true"                                      
                                        ShowSaveChangesButton="false" 
                                        /> 
                                    <CommandItemTemplate>
	                                    <telerik:RadButton runat="server" ID="ResetButton" autopostback="false"  Text="Reset to Last Save" ToolTip="Reset to Last Save" style="float: right;" OnClientClicked="cancelChangesToGrid" Width="170px"><Icon PrimaryIconCssClass="rgIcon rgCancelIcon" /></telerik:RadButton>
	                                    <telerik:RadButton runat="server" ID="SaveChangesButton" AutoPostBack="false" Text="Save Changes" ToolTip="Save Changes" style="float: right;" OnClientClicked="saveChangesToGrid" Width="145px"><Icon PrimaryIconCssClass="rgIcon rgSaveIcon" /></telerik:RadButton>  
                                    </CommandItemTemplate>
                                    <Columns>
                                        <telerik:GridBoundColumn UniqueName="MonthForecast" DataField="MonthForecast"  HeaderText="MonthForecast" ReadOnly="true" HeaderTooltip=""></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PPPY_1Month" DataField="PPPY_1Month" HeaderText="PPPY_1Month" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip="" Aggregate="Sum"></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PPY_1Month" DataField="PPY_1Month" HeaderText="PPY_1Month" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip=""  Aggregate="Sum" ></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PY_1Month" DataField="PY_1Month" HeaderText="PY_1Month" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip=""  Aggregate="Sum" ></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Composite" DataField="Composite" HeaderText="Composite" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip="This is the sum of the previous sales (from 12 months ago) of the Key Product Master and the Contributing Product Masters, based on the levels of contribution assigned in the Style Demand Composite."  Aggregate="Sum" ></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Months1Perc" DataField="Months1Perc" HeaderText="∆ 1 Month %" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip="This measures the difference between the py 1 month (based on when this report is run) and the same 1 month 2 years ago. This is based on the Key Product Master and proportional contribution from the Contributing Product Masters."></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Months3Perc" DataField="Months3Perc" HeaderText="∆ 3 Months %" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip="This measures the difference between the py 3 months (based on when this report is run) and the same 3 months 2 years ago. This is based on the Key Product Master and proportional contribution from the Contributing Product Masters."></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="Months6Perc" DataField="Months6Perc" HeaderText="∆ 6 Months %" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip="This measures the difference between the py 6 months (based on when this report is run) and the same 6 months 2 years ago. This is based on the Key Product Master and proportional contribution from the Contributing Product Masters."></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PY_PPYPerc" DataField="PY_PPYPerc" HeaderText="∆ PY/PPY %" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip="This measures the difference between 2 year and 3 years rolling."></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="MPPY_MPPPYPerc" DataField="MPPY_MPPPYPerc" HeaderText="∆ 3MPPY/3MPPPY %" ReadOnly="true" DataFormatString="{0:N0}" HeaderTooltip="This measures the difference between a 2 year ago 3 months and 3 years ago 3 months."></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="PlannedPerc" DataField="PlannedPerc" HeaderText="∆ Planned %" ReadOnly="false" DataFormatString="{0:N0}" HeaderTooltip="The suggested value that appears in this field is the stored value else based on ∆ 6 Months % (default min 0, default max 50)"></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="SafetyStock" DataField="SafetyStock" HeaderText="Safety Stock %" ReadOnly="false" DataFormatString="{0:N0}" HeaderTooltip="Default to 10%"></telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn UniqueName="QtyPlanned" DataField="QtyPlanned" HeaderText="Qty Planned" ReadOnly="false" DataFormatString="{0:N0}" HeaderTooltip="This Is the aggregate forecasted demand for this product master For Each month."  Aggregate="Sum" ></telerik:GridBoundColumn>
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                        </telerik:RadAjaxPanel>   
                        <br />
                        <asp:ImageButton ID="ImgExcelOutputAggregateDemand" ImageAlign="Left" ImageUrl="images/excel-2010-icon.gif" OnClick="ExcelOutputAggregateDemand" runat="server" CssClass="ImageButtons" Visible="True" />
                        <br />  
</telerik:RadWizardStep>

Vasko
Telerik team
 answered on 21 Oct 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?