Telerik Forums
UI for ASP.NET AJAX Forum
65 answers
1.5K+ views
Looks like this is a bug in RADAjaxManager and I havent been able to find a suitable workaround

1. I have a page with a button and a asp panel control.
2. The page has been Ajaxified using the RADPrometheus Ajax Manager.
3. Click of button triggers dynamic load of a user control into the panel
4. The user control includes webusercontrol.js file via Script Manager Proxy.
5. User control has a button and a text box
6. Button click has been wired to call a setTest() js function defined in webusercontrol.js
7. When the page renders, I click the button to dynamically load the user control into the panel.
8. Clicking the button on the user control to set the text results in "Object required" error. What is happening is that the setText() function defined in the included script file is not visible.

//// Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TelerikAjaxTest._Default" EnableEventValidation="false" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Telerik Prometheus RADAjaxManager Text</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"
        EnablePartialRendering="true"
        EnablePageMethods="true"
        LoadScriptsBeforeUI="true">
        <Scripts></Scripts>
    </asp:ScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnLoadControl">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlContent" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
       
    </telerik:RadAjaxManager>
    <div>
        <asp:Button ID="btnLoadControl" runat="server" Text="Load Control" />
    </div>
    <div>
        <asp:Panel ID="pnlContent" runat="server"></asp:Panel>
    </div>
    </form>
</body>
</html>

////// Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace TelerikAjaxTest {
    public partial class _Default:System.Web.UI.Page {
        protected void Page_Load(object sender, EventArgs e) {
            this.btnLoadControl.Click += new EventHandler(btnLoadControl_Click);
        }

        void btnLoadControl_Click(object sender, EventArgs e) {
            this.pnlContent.Controls.Clear();
            UserControl uc;
            uc = Page.LoadControl("WebUserControl1.ascx") as UserControl;

            if (uc != null) {
                this.pnlContent.Controls.Add(uc);
            }

        }
    }
}

//// WebUserControl1.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="TelerikAjaxTest.WebUserControl1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    <Scripts>
        <asp:ScriptReference Path="WebUserControl.js" NotifyScriptLoaded="true" />
    </Scripts>
</asp:ScriptManagerProxy>
<div>
    Web User Control with Script Manager Proxy
    This controls is loaded dynamically via the click of the button on
    the main page
</div>
<div>
    <button id="btnAddText" runat="server" onclick="setText">Set Text</button>
</div>
<div>
    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</div>
<script type="text/javascript">
    var txtNameId=<%= txtName.ClientID %>;
   
    alert('WebUserControl1.ascx');
</script>

////// WebUserControl.js
// WebUserControl.js

function setText(){
    var oTxt=$get(txtNameId);
    if((oTxt!=null)&&(typeof(oTxt)!='undefined')){
        oTxt.value=oTxt.value+'Some Text';
    }
}

// Notify the AJAX framework that this script has completed loading.
// Making this the last line in the file ensures that this is executed
// last
if(typeof(Sys) !== "undefined")Sys.Application.notifyScriptLoaded();





Any feed back appreciated

thanks
zaphod
Maria Ilieva
Telerik team
 answered on 31 Mar 2014
3 answers
270 views
Here is my code.     

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="pagerMetadata">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rlvMetadata" UpdatePanelRenderMode="Inline" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>

but I lost css in aspx side. I tried add UpdatePanelsRenderMode="Inline" propert but nothing changed. how can I do that using c#?
Maria Ilieva
Telerik team
 answered on 31 Mar 2014
1 answer
76 views
We have a custom class OurGrid that inherits from Telerik.Web.UI.RadGrid. We do some initial setup of the RadGrid options when a grid is added to a page using our custom type so we do not have to re-run the initialization in various places. 

In attempting to persist this using the persistence manager it appears it's grabbing the type of the object and in this case is seeing our custom type rather than RadGrid.

The error message is:
The control of CustomTelerikObjects.OurGrid could not be persisted. Please review the online documetation for the supported controls.

Is there a way around this that anyone has used?
Kostadin
Telerik team
 answered on 31 Mar 2014
2 answers
104 views
Hi Devoloper Friends;

I'm using a radgird and entry in the properties rowselected feature is activated, 
At the same time, right-click the 'Menu' open. 
I click on the DataKeyNames property value of the row you want to get mss. 
If more than one row is selected, it brings me the value of the first selected row.

Example;

http://elbisemoda.com/Bilgi/RadGridRightClick.png


JavaScript;

function RowContextMenu(sender, eventArgs) {
           var menu = $find("<%=RadMenu1.ClientID %>");
           var evt = eventArgs.get_domEvent();
 
           var index = eventArgs.get_itemIndexHierarchical();
           sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);

           menu.show(evt);
 
           evt.cancelBubble = true;
           evt.returnValue = false;
 
           if (evt.stopPropagation) {
               evt.stopPropagation();
               evt.preventDefault();
           }
 
 
       }


RadGird;
<telerik:RadGrid ID="grdVeresiyeFisList" AllowFilteringByColumn="false" Height="445px" AutoGenerateColumns="false" runat="server" AllowMultiRowSelection="True" EnableAjaxSkinRendering="True" Culture="tr-TR"
                    GridLines="None" EnableLinqExpressions="False" Skin="Metro" PagerStyle-Visible="false" OnItemCommand="grdVeresiyeFisList_ItemCommand" OnItemDataBound="grdVeresiyeFisList_ItemDataBound"
                    OnNeedDataSource="grdVeresiyeFisList_NeedDataSource" OnDetailTableDataBind="grdVeresiyeFisList_DetailTableDataBind" ShowStatusBar="True" EnableHeaderContextMenu="True" CellPadding="0" CellSpacing="0" ShowFooter="true">
 
                    <HeaderStyle Width="150px" CssClass="cagdasGridHeader"></HeaderStyle>
                    <MasterTableView DataKeyNames="VeresiyeMasterID" NoMasterRecordsText="Kayıt bulunamadı." AllowSorting="True" TableLayout="Auto">
                         
                        <Columns>                          
                            <telerik:GridClientSelectColumn UniqueName="chkSelectColumn" HeaderStyle-Width="30px"></telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn DataField="VeresiyeMasterID" HeaderText="VeresiyeMasterID" ShowFilterIcon="false" Display="false" UniqueName="VeresiyeMasterID" AllowFiltering="false"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FisAdi" HeaderText="Fis Adı" UniqueName="FisAdi" HeaderStyle-Width="100px" AllowFiltering="false"></telerik:GridBoundColumn>
                          .......
                          ........
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" AllowKeyboardNavigation="True"
                        AllowDragToGroup="True" ReorderColumnsOnClient="True" EnableRowHoverStyle="True">
                        <ClientEvents OnRowContextMenu="RowContextMenu" />
                        <Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="200" />
 
                        <Selecting AllowRowSelect="true"></Selecting>
 
                        <Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>
                        <Resizing AllowColumnResize="True" AllowRowResize="false" ClipCellContentOnResize="True"
                            EnableRealTimeResize="True" AllowResizeToFit="True"></Resizing>
                    </ClientSettings>
 
                </telerik:RadGrid>
Viktor Tachev
Telerik team
 answered on 31 Mar 2014
16 answers
131 views
In our project, we use Rad Panel Bar and Rad Panel Item to hold labels, check box and radio button with expand and collapse feature.

When a panel gets expanded, labels and controls are missing most of the times and if we collapse and expand then it appears.

Please advise how to make the appearance consistent always.

Thanks
Sudhakar
Plamen
Telerik team
 answered on 31 Mar 2014
4 answers
199 views
I am trying to load a RadGrid based on the value inside the RadComboBox. I have tried a few things but can't quite get it to work. The user is supposed to select a value("email") from the RadComboBox and a RadGrid should be loaded onto the page. At the moment one of the PROCs have an email hard-coded so a grid is loaded onto the page which contains the data for that specific user. I also have a variation of that PROC that is supposed to change the RadGrid whenever the user selects a different email, but I can't get it to work. Once the user selects an email they will see a grid which contains the Customer Number, if they click the Customer Number they will see a drop down which contains the number along with an error message.

I have attached the aspx, .cs, PROCs, and a photo of what the page looks like with one hard-coded existing email from the RadComboBox.

Pavlina
Telerik team
 answered on 31 Mar 2014
6 answers
331 views
Is it possible to add the current record data into ConfirmText message? The code below does not work. I know that it can be done in the code behind but I look for simpler solution. 
<telerik:GridButtonColumn UniqueName="DeleteColumn"
    ButtonType="ImageButton"
    CommandName="Delete"
    ConfirmText='Are you sure you want to delete this record with id: <%# Eval("ID")%> ?'
    ConfirmTitle="Delete Record"
    ConfirmDialogType="RadWindow"
    Text="Delete" >
    <ItemStyle HorizontalAlign="Center" Width="20px" />
</telerik:GridButtonColumn>
Eyup
Telerik team
 answered on 31 Mar 2014
4 answers
135 views
I am attempting to upgrade a .Net web app with Telerik RadControls Q3 2011 to Q3 2013 and have run into skinning issues with the RadSlidingZone.  The browser is also being upgraded from IE8 running in Compatibility View to IE11 in Edge Mode.

​Attached (IE8_RadSlidingZone.jpg) is what the RadSlidingZones on the far left used to look like and needs to maintain its appearance.

Attached (IE11_RadSlidingZone.jpg) is what the RadSlidingZones look like after upgrading the Telerik .dll's and running in IE11. 

The issue is the size/height of each sliding zone has shrunk down so that the text is unreadable.

<telerik:RadPane runat="server" ID="pNav" SkinID="pLNav" Height="100%" OnClientExpanded="pNav_ClientExpanded">
    <div id="DivSLZone" runat="server" style="float: left; clear: none; width: 22px;
        height: 100%;" class="tabsContainer">
        <telerik:RadSlidingZone ID="slZone" runat="server" SlideDirection="Right" ClickToOpen="true"
            Width="22">
            <telerik:RadSlidingPane ID="slPane1" Title="Tab 1 Title" runat="server" Width="275"
                EnableDock="false" Height="100px">
                <div runat="server" id="divSlPane1">
                </div>
            </telerik:RadSlidingPane>
            <telerik:RadSlidingPane ID="slPane2" Title="Tab 2 Title" runat="server" Width="275"
                EnableDock="false" Height="100%">
                <div runat="server" id="divSlPane2">
                </div>
            </telerik:RadSlidingPane>
            <telerik:RadSlidingPane ID="slPane3" Title="Tab 3 Title" runat="server" Width="275"
                EnableDock="false" Height="100%" OnClientExpanded="slPane3_ClientExpanded" OnClientCollapsed="slPane3_ClientCollapsed">
                <div runat="server" id="divSlPane3">
                </div>
            </telerik:RadSlidingPane>
        </telerik:RadSlidingZone>
    </div>
    <div style="height: 100%;">
        <asp:PlaceHolder runat="server" ID="phLeft" />
    </div>
</telerik:RadPane>

.tabsContainer, .rspTabsContainer {
    background: #B0C4DE !important;
    border-right: #336699 1px solid !important;
}

Any suggestions?

Thanks,

Rob
Bozhidar
Telerik team
 answered on 31 Mar 2014
6 answers
532 views
Hi,

I am trying to implement a row total function in Javascript for a RadGrid. Searching the help and forums I have managed to set up a function that is called by onBlur for each of my numeric columns, but cannot seem to get the value of the fields held in the template columns.

The definition of the columns (14 in total) is:


<telerik:GridTemplateColumn UniqueName="colTime1" AllowFiltering="False" HeaderText="1" FooterStyle-Width="50" HeaderStyle-Width="50" ItemStyle-Width="50">
                        <ItemTemplate>
                            <asp:TextBox ID="editTime1" runat="server" Width="40px"></asp:TextBox>
                        </ItemTemplate>
                        <FooterStyle Width="50px" />
                        <HeaderStyle Width="50px" />
                        <ItemStyle Width="50px" />
                    </telerik:GridTemplateColumn>
 
And the javascript functin is:

function valueChanged(totalTime, textbox, c, r) {
                   var grid = $find("<%=RadGrid1.ClientID %>");
                   var MasterTable = grid.get_masterTableView();
                   var Rows = MasterTable.get_dataItems();
                   var valnow = textbox.value;
                   var total = valnow;
                   for (col = 1; col < 15; col++) {
                       if (col != c) {
                           var row = Rows[r - 1];
                           var columnName = "EditTime".concat(col);
                           var textTime = row.findControl(columnName);
                           var colVal = textTime.get_value();
                           if (!isNan(colVal)) {
                               total += colVal;
                           }
                           else {
                               textTime.set_value("");
                           }
                       }
                   }
                   totalTime.set_value(total);
               }

Everything is getting called OK but the lines:

var row = Rows[r - 1];
var columnName = "EditTime".concat(col);
var textTime = row.findControl(columnName);
var colVal = textTime.get_value();

Always returns null for textTime. The examples on the forum here seem to indicate the syntax is correct.

Am I implementing this wrong, or is there a better way of obtaining the values?

David Penny
David Penny
Top achievements
Rank 2
 answered on 31 Mar 2014
1 answer
86 views
Hello,

I am dynamically adding a GridTemplateColumn to the grid. The column is added as required the first page load but on each following postback I am getting a new empty columm with header "Action". Any Idea?

 protected void Page_Init(object sender, EventArgs e)
        {
   
              var col = this.requestGrid.MasterTableView.Columns.FindByUniqueNameSafe("ActionId");
               
                GridTemplateColumn actionColumn = new GridTemplateColumn();
                this.requestGrid.MasterTableView.Columns.Add(actionColumn);
                actionColumn.ItemTemplate = new ActionTemplate("actionID");                
                
                actionColumn.DataField = "ActionID";
                
                actionColumn.HeaderText = "Action";
               
        }
Shinu
Top achievements
Rank 2
 answered on 31 Mar 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?