Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
63 views
The application is doing unknown timeout even if working on the application.We have done the manual alert & session out using JavaScript with the following code. We are using the RadWindow from telerik in the application. But this code is not able to attach the mousemove, keydown & click events from the radwindow popup.Even if we are working on the application we get an alert for timeout. Can anyone help with this problem? 

// Function to Open Any Generic Window Popup
function OpenRadWind(URL, HorzLength, VertLength, MoveToLeft, MoveToTop) {
RadWindow1 = new window.radopen(URL, "RadWindow");
RadWindow1.setUrl(RadWindow1.get_navigateUrl());
RadWindow1.set_visibleStatusbar(true);
RadWindow1._showContentDuringLoad = false;
RadWindow1.maximize();
//TimeOut Function
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'mousemove', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'keydown', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'click', resetTimer);
return false;
}function resetTimer() {
var idleSeconds = 10;
var idleTimer;
clearTimeout(idleTimer);
idleTimer = setTimeout(whenUserIdle, idleSeconds * 1000);
}//TimeOut Function
attachEvent(window, 'load', function () {
attachEvent(document.body, 'mousemove', resetTimer);
attachEvent(document.body, 'keydown', resetTimer);
attachEvent(document.body, 'click', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'mousemove', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'keydown', resetTimer);
attachEvent(RadWindow1.GetContentFrame().contentWindow, 'click', resetTimer);
resetTimer(); // Start the timer when the page loads
});function whenUserIdle() {
if (window.location.pathname.search("Login.aspx") == -1) {
alert("Your Current Session Is Over");
window.location = window.location.protocol + "//" + window.location.host + "/" + window.location.pathname.split('/')[1] + "/Account/Login.aspx?logout=";
}
}function attachEvent(obj, evt, fnc, useCapture) {
if (obj.addEventListener) {
obj.addEventListener(evt, fnc, !!useCapture);
return true;
} else if (obj.attachEvent) {
return obj.attachEvent("on" + evt, fnc);
}
}
Raman
Top achievements
Rank 1
 asked on 21 Feb 2014
1 answer
341 views
I have a website that has a RadMultiPage control on the main page with 5
UserControls that wrap RadGrid's in each PageView.  Each RadGrid is set up almost identically to the rest, just with different data.  However, you can only successfully scroll the first grid vertically using the mouse scroll wheel.  The other grids have vertical scroll bars, but you can only drag their scroll bars, you can't use the scroll wheel.

Using Firebug to look into this further, it turns out that the scroll bar that works with the mouse wheel is a "VirtualScroll" scroll bar, shown here:
<div id="ctl00_MainContent_TrafficSignalsGridUserControl_RadGridTrafficSignals_GridData" class="rgDataDiv" style="overflow-x: auto; overflow-y: scroll; width: 100%; height: 474px;">
 
<div id="ctl00_MainContent_TrafficSignalsGridUserControl_RadGridTrafficSignals_ctl00_VirtualScroll" style="overflow-y: scroll; position: absolute; right: 0px; top: 0px; width: 18px; height: 458px;">

The first div tag is the RadGrid itself, and the second is the "VirtualScroll" scroll bar.  What's interesting about this is that I don't set the EnableVirtualScrollPaging
 attribute to true on any of the Grids.  The other RadGrids have a scroll bar that is inside the outer RadGrid div and is not an external div as shown above.  Here is the markup for the first grid that scrolls successfully using the VirtualScroll scrollbar and the scroll wheel:

<telerik:RadGrid ID="RadGridTrafficSignals" runat="server" 
        CssClass="gridClass"
        GridLines="None"
        AutoGenerateColumns="False"
        AllowSorting="True"
        EnableHeaderContextMenu="True"
        Width="98%" Height="636px"
        OnNeedDataSource="RadGridTrafficSignals_NeedDataSource"
        OnUpdateCommand="RadGridTrafficSignals_OnUpdateCommand"
        OnItemUpdated="RadGridTrafficSignals_ItemUpdated"
        OnDataBound="RadGridTrafficSignals_DataBound"
        OnItemCommand="RadGridTrafficSignals_ItemCommand"
        OnItemCreated="RadGridTrafficSignals_OnItemCreated"
        CellSpacing="0"
        AllowFilteringByColumn="True"
        ShowGroupPanel="True"
        ShowStatusBar="False">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">
            <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" OnCommand="GridCommand"></ClientEvents>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" EnableVirtualScrollPaging SaveScrollPosition="True" ScrollHeight="458px"></Scrolling>
    <Virtualization
        EnableVirtualization="true"
        ItemsPerView="100"
        LoadingPanelID="RadAjaxLoadingPanel1" />
        </ClientSettings>
...
</telerik:RadGrid>

 And here is the markup for one of the RadGrid's on which vertical scrolling with the scroll wheel doesn't work:

<telerik:RadGrid ID="RadGridDetectors" runat="server"
        CssClass="gridClass"
        GridLines="None"
        AutoGenerateColumns="False"
        AllowSorting="True"
        EnableHeaderContextMenu="True"
        Width="98%" Height="636px"
        OnNeedDataSource="RadGridDetectors_NeedDataSource"
        OnUpdateCommand="RadGridDetectors_OnUpdateCommand"
        OnItemUpdated="RadGridDetectors_ItemUpdated"
        OnDataBound="RadGridDetectors_DataBound"
        OnItemCommand="RadGridDetectors_ItemCommand"
        OnItemCreated="RadGridDetectors_OnItemCreated"
        CellSpacing="0"
        AllowFilteringByColumn="True"
        ShowGroupPanel="True"
        ShowStatusBar="False">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" ReorderColumnsOnClient="True">        
          <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" OnCommand="GridCommand" />
          <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="458px" />
              <Virtualization
                EnableVirtualization="true"
                ItemsPerView="100"
                LoadingPanelID="RadAjaxLoadingPanel1" />
</ClientSettings>

I'm stuck on what to do to resolve this, any help you can provide would be greatly appreciated!

-Chris
Galin
Telerik team
 answered on 21 Feb 2014
4 answers
124 views
I upgraded to the latest Telerik UI version, Q3 2013 SP2 (2013.3.1324), and now all the scheduler items have two resize handles, one on the left and another on the right. The element is a div of class "rsAptResize rsAptResizeStart" and "rsAptResize rsAptResizeEnd".

Is there a setting to turn these off, rather than do it with styles?


Thanks,
Robert
Robert Helm
Top achievements
Rank 1
 answered on 21 Feb 2014
2 answers
81 views
Dear,

We use the rad grid with a context menu (which works fine). Now we should be
able to make the context menu dependable on the clicked row. Fe, we have a
status field in the grid. If the status field equals 'pending' we should see 3
options. If the status filed equals completed we should see 4 menu options, if
the status field is null we should see one option.

Is this achievable with the context menu? If yes, how can we do this?

Thx!

MDS
Top achievements
Rank 1
 answered on 21 Feb 2014
10 answers
335 views
Hi,

I have been using Twitter Bootstrap 2.3.2 and 3.0  on one of the  asp.net web application. Are Telerik controls
responsive to different devices from Mobile, Tablet?  



My company owns Telerik
AJAX UI controls which they just renewed and wondering if using Telerik control
will work with Bootstrap and be responsive to different devices?



Thanks

Ivan Zhekov
Telerik team
 answered on 21 Feb 2014
4 answers
251 views
Hi,

I have a RadGrid in batch mode that contains a RadComboBox inside the EditTemplate.  If I change the options checked inside the ComboBox, in the first row,  those changes persist in the following rows in editmode, even when I´m assigning different checks inside each of the rows in client side scripts.  SO for example if I uncheck the option for XML, PDF and HTM in the combobox in the first row, and then I try to edit the second row, those options are uncheck, when they should be check, since is a new row, and I'm initializing the combobox values with a hiddenfield.

Grid
<telerik:GridTemplateColumn HeaderText="File Prefix" HeaderStyle-Width="280px" UniqueName="Fileprefix">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbChapterFilePrefix">Prefix</asp:Label>
                                    (<asp:Label runat="server" ID="lblFileTypeXML">xml</asp:Label>,
                                    <asp:Label runat="server" ID="lblFileTypePDF">pdf</asp:Label>,
                                    <asp:Label runat="server" ID="lblFileTypeHTM">html</asp:Label>)
                                    <asp:HiddenField runat="server" ID="hdCurrentFileTypes" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Label runat="server" ID="lbFilePrefix">prefix</asp:Label>
                                    <telerik:RadComboBox Skin="Outlook" runat="server" ID="cbFileType" CheckBoxes="true"
                                        AllowCustomText="false" CheckedItemsTexts="DisplayAllInInput" >
                                        <Items>
                                            <telerik:RadComboBoxItem Text="xml" Value="xml" />
                                            <telerik:RadComboBoxItem Text="pdf" Value="pdf" />
                                            <telerik:RadComboBoxItem Text="htm" Value="htm" />
                                        </Items>
                                    </telerik:RadComboBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>

JS

<script type="text/javascript" language="javascript">
 
    function SaveGridChanges(sender, args) {
        var grid = $find("<%= rgBookManagement.ClientID  %>");
        grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());
    }
 
    function GetCellValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
            args.set_cancel(true);
            var container = args.get_container();
            //debugger;
            var chapterPrefix = $telerik.findElement(container, "lbChapterFilePrefix").innerHTML;
            var isFileTypeXML = ($telerik.findElementcontainer, "hdCurrentFileTypes").value.toLowerCase().indexOf("xml") >= 0 ? true : false);
            var isFileTypePDF = ($telerik.findElement(container, "hdCurrentFileTypes").value.toLowerCase().indexOf("pdf") >= 0 ? true : false);
            var isFileTypeHTM = ($telerik.findElement(container, "hdCurrentFileTypes").value.toLowerCase().indexOf("htm") >= 0 ? true : false);
            args.set_value(new Prefix(chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM));
        }
    }
 
    function SetCellValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
              args.set_cancel(true);
              var container = args.get_container();
              value = args.get_value(),
              isFileTypeXML = value.isFileTypeXML,
              isFileTypePDF = value.isFileTypePDF
              isFileTypeHTM = value.isFileTypeHTM;
              //debugger;
              $telerik.findElement(container, "lblFileTypeXML").style.color = (isFileTypeXML == true ? 'black' : 'red');
              $telerik.findElement(container, "lblFileTypePDF").style.color = (isFileTypePDF == true ? 'black' : 'red');
              $telerik.findElement(container, "lblFileTypeHTM").style.color = (isFileTypeHTM == true ? 'black' : 'red');
        }
    }
 
    function GetEditorValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
              args.set_cancel(true);
              var container = args.get_container();
              var combo = $telerik.findControl(container, "cbFileType");
 
              isFileTypeXML = combo.get_items().getItem(0).get_checked();
              isFileTypePDF = combo.get_items().getItem(1).get_checked();
              isFileTypeHTM = combo.get_items().getItem(2).get_checked();
              //debugger;
              chapterPrefix = $telerik.findElement(container, "lbFilePrefix").innerHTML;
              args.set_value(new Prefix(chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM));
        }
    }
 
    function SetEditorValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
            args.set_cancel(true);
            var container = args.get_container();
            var value = args.get_value();
            chapterPrefix = value.chapterPrefix,
            isFileTypeXML = value.isFileTypeXML,
            isFileTypePDF = value.isFileTypePDF,
            isFileTypeHTM = value.isFileTypeHTM;
 
            $telerik.findElement(container, "lbFilePrefix").innerHTML = chapterPrefix;
            var combo = $telerik.findControl(args.get_container(), "cbFileType");
 
            combo.trackChanges();
            //debugger;
            //Check Fields
            combo.get_items().getItem(0).set_checked(isFileTypeXML == true);
            combo.get_items().getItem(1).set_checked(isFileTypePDF == true);
            combo.get_items().getItem(2).set_checked(isFileTypeHTM == true);
 
            combo.commitChanges();
        }
    }
 
    var Prefix = function (chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM) {
        this.chapterPrefix = chapterPrefix;
        this.isFileTypeXML = isFileTypeXML;
        this.isFileTypePDF = isFileTypePDF;
        this.isFileTypeHTM = isFileTypeHTM;
    }
 
</script>



<ClientSettings><ClientEvents OnBatchEditGetCellValue="GetCellValue" OnBatchEditGetEditorValue="GetEditorValue"                            OnBatchEditSetCellValue="SetCellValue" OnBatchEditSetEditorValue="SetEditorValue" />                 
<ClientSettings><ClientEvents OnBatchEditGetCellValue="GetCellValue" OnBatchEditGetEditorValue="GetEditorValue"                            OnBatchEditSetCellValue="SetCellValue" OnBatchEditSetEditorValue="SetEditorValue" />                 
Viktor Tachev
Telerik team
 answered on 21 Feb 2014
1 answer
125 views

We have recently implemented the latest version of the RadControls to address issues using the Editor in Chrome. We are using the RadControls in DotNetNuke 7. For the most part, everything seems to be working okay now, however we are having an issue when selecting images in the Image Manager to insert into the Editor. When we click on the image, the Image Manager window closes but the selected image doesn't appear in the Editor. We are seeing a JavaScript error: 

Uncaught TypeError: Object [object Array] has no method 'cloneNode'  - jquery.js:9597

CloneNode seems to be called in the following method:

  case "ImageManager":
            var callbackFunction = function (sender, args) {
                //result holds the image element   
                var result = Telerik.Web.UI.Editor.Utils.getOuterHtml(args.get_value());
                var div = document.createElement("DIV");
                Telerik.Web.UI.Editor.Utils.setElementInnerHtml(div, result);

                //First child must be the image!    
                var img = div.firstChild;
                div.style.overflow = "hidden";
                div.style.width = "1px";
                div.style.height = "1px";

                document.body.appendChild(div);
                //GET THE INSERTED IMAGE WIDTH AND HEIGHT    
                //alert(img.offsetWidth + " -- " + img.offsetHeight);
                img.width = img.offsetWidth;
                img.height = img.offsetHeight;

                editor.pasteHtml(div.innerHTML, "ImageManager");
            };

Any ideas what might be causing this issue? Should the full RadControls work properly in the DNN environment?  












jquery.js:9597
jquery.js:9597
jquery.js:9597
Ianko
Telerik team
 answered on 21 Feb 2014
3 answers
195 views
I have a RadGrid and I want to trigger the OnRowSelected ClientEvent if ther is only one row in the result set after the client side grid data bind.
The following code was working before upgrading to version 2013.3.1324.45

    var resultTable = $('div[id$=RadGrid1]').find('tbody');
    var hasSingleRecord = $('tr', resultTable).length == 2;
    if (hasSingleRecord) {
        resultTable.find('tr:last').click();
    }
Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Feb 2014
3 answers
338 views
Hi.

I am trying to get my x-Axis such that it skips a few days on the labels, such as on RadHTMLChart demo page.  Please advise on how I can achieve this.  Below is a snippet of my code currently.

I get the data from a list containing values and dates.

chrtPerformance.PlotArea.Series.Clear();
chrtPerformance.PlotArea.XAxis.Type = AxisType.Date;
chrtPerformance.PlotArea.XAxis.BaseUnit = DateTimeBaseUnit.Months;
chrtPerformance.PlotArea.XAxis.LabelsAppearance.DataFormatString = "m";
chrtPerformance.PlotArea.XAxis.LabelsAppearance.RotationAngle = 270;
chrtPerformance.PlotArea.XAxis.DataLabelsField = "BatchDate";
 
string type = Settings[NTConstants.CONST_CHART_TYPE].ToString();
if (type == "Area")
{
    var seriesA = new AreaSeries();
    var seriesB = new AreaSeries();
    seriesA.DataFieldY = "CashValue";
    seriesB.DataFieldY = "InstrumentValue";
    seriesA.TooltipsAppearance.ClientTemplate = "#=dataItem.CashValue#, Cash Value";
    seriesB.TooltipsAppearance.ClientTemplate = "#=dataItem.InstrumentValue#, Instrument Value, #=dataItem.BatchDate#";
    seriesA.LabelsAppearance.Visible = false;
    seriesB.LabelsAppearance.Visible = false;
    seriesA.MissingValues = MissingValuesBehavior.Interpolate;
    seriesB.MissingValues = MissingValuesBehavior.Interpolate;
    chrtPerformance.PlotArea.Series.Add(seriesA);
    chrtPerformance.PlotArea.Series.Add(seriesB);
}

Any and all help will be greatly appreciated.

Kind regards.
Leon
Danail Vasilev
Telerik team
 answered on 21 Feb 2014
3 answers
126 views
Hello Friends,

In File Explorer control Grid i go from main directory to sub directory from there i go another directory of sub directory
Like Main directory => Sub Directory => another directory of Sub Directory

When i press back button it go back to Sub Directory
Now i press back button second time it not go back to main directory it remain on same directory


///////////code.cs/////////


        FileExpDocument.ToolBar.Items[0].Visible = true;
        FileExpDocument.ToolBar.Items[1].Visible = false;
        FileExpDocument.ToolBar.Items[2].Visible = false;
        FileExpDocument.ToolBar.Items[9].Visible = false;
        FileExpDocument.ToolBar.Items[6].Visible = false;

       FileExpDocument.ToolBar.OnClientButtonClicked = "OnClientButtonClieck";


///////end///////////////

Here is only Toolbar control related code
in this "OnClientButtonClieck" just set the height of grid and div

when i click first time back button the page_init and Page_load all event fire
But when i click second time no event fire nothing happen


Please help me it is very urgent 
Vessy
Telerik team
 answered on 21 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?