Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
116 views
Hello,
I have a RadGrid with an Edit/Insert popup form based on a template. The RadGrid is AJAX enabled programmatically in the Page_Load() method.

RadAjaxManager ram = RadAjaxManager.GetCurrent(Page);
ram.AjaxSettings.AddAjaxSetting(RadGrid1, RadGrid1, RadAjaxLoadingPanel1);
<telerik:RadScriptManager id="ScriptManager" runat="server"
  EnableScriptCombine="true" EnablePageMethods="false" EnablePartialRendering="true"
  EnableScriptGlobalization="false" EnableScriptLocalization="true">
  <Scripts>
    <asp:scriptreference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:scriptreference>
    <asp:scriptreference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:scriptreference>
    <asp:scriptreference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:scriptreference>
  </Scripts>
</telerik:RadScriptManager>
protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
    // Add an RadAjaxManager to the page.
    SetUpAjaxManagerOnPage();
    // Create child controls (if necessary).
    EnsureChildControls();
}
protected void SetUpAjaxManagerOnPage()
{
    // Check if there is already an Ajax Manager somewhere on the page.
    RadAjaxManager currentAjaxManager = RadAjaxManager.GetCurrent(Page);
    if (currentAjaxManager == null)
    {
        Page.Form.Controls.AddAt(0, AjaxManager);
        Page.Items.Add(typeof(RadAjaxManager), AjaxManager);
    }
}
protected virtual RadAjaxManager AjaxManager
{
    get
    {
        if (_ajaxManager == null)
        {
            _ajaxManager = RadAjaxManager.GetCurrent(Page);
            if (_ajaxManager == null)
            {
                _ajaxManager = new RadAjaxManager() { ID = "RadAjaxManager1" };
            }
        }
        return _ajaxManager;
    }
}


In the template there is a RadListBox.

<telerik:RadListBox runat="server"
  ID="RadListBoxCharacteristicValues"
  DataValueField="CharacteristicValuedID"
  DataTextField="CharacteristicVal"
  AllowReorder="true"
  AllowDelete="true"
  EnableDragAndDrop="true"
  Height="150px" Width="240px" />

When I click on the Edit or Add buttons nothing happens but a Javascript exception is thrown:

Uncaught Sys.ArgumentUndefinedException: Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: type
  1. Error$create ScriptResource.axd:222
    Error$argumentUndefined ScriptResource.axd:346
    Function$_validateParameterType         ScriptResource.axd:130
    Function$_validateParameter ScriptResource.axd:99
    Function$_validateParams ScriptResource.axd:67
    Sys$Component$create ScriptResource.axd:2698
    (anonymous function) TechnicalData.aspx:7
    Sys$_Application$add_init ScriptResource.axd:3991
    (anonymous function) TechnicalData.aspx:1
    ...


I spent some time debugging the client code to find out what was causing such exception and it seemed that Javascript had no knowledge of the RadListBox (type undefined).

I found a temporary workaround by placing a dummy empty RadListBox in another place of the page.

This is not peculiar to RadListBox controls as it happens also with all other RadControls.

My conclusion is that if the edit form template contains RadControls which are nowhere else defined on the page, the associated client scripts and definitions are not properly loaded when using AJAX. Without enabling AJAX behavior everything works fine.

What am I doing wrong? Is there a solution?

Thanks in advance,

Mauro

Telerik version: 2013.1.220.35
Language: C#
Platform: Sharepoint Server 2010

Mauro
Top achievements
Rank 1
 answered on 19 Jun 2013
5 answers
366 views
Hello,

OK, so I have a page that has a radgrid and a form.  When creating a new record via the form and rebinding the grid, it works fine.  When initially binding the grid, it works fine.  Only when clicking a delete button in the grid, handling the custom command, and rebinding, do I get this error.

On the form, there are radtextbox, radcombobox, radspell, and other controls.  I noticed the RadSpell.CreateChildCOntrols in the stacktrace... does that mean that's where the error is?  I also see a reference to ASP.views_shared_header_ascx.__Render__control1, which is a user control and has some controls/AJAX in it.

Also, I'm binding on PreRender - this is not an issue for the rest of the app that does the same thing; and in this page, it only happens on this one spot, not in the other two spots, which are bound on prerender...

Why would this error be happening?

Thanks.


at System.Web.UI.ScriptControlManager.RegisterScriptControl[TScriptControl](TScriptControl scriptControl)
at Telerik.Web.UI.RadWebControl.RegisterScriptControl()
at Telerik.Web.UI.RadWebControl.ControlPreRender()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at Telerik.Web.UI.RadSpell.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.Control.FindControl(String id, Int32 pathOffset)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.ChildControlHelper.FindControlRecursive(String ID, Control root)
at Telerik.Web.UI.RadScriptBlock.GetAjaxSettingForCurrentInitiator(RadAjaxManager currentAjaxManager)
at Telerik.Web.UI.RadScriptBlock.IsForCurrrentInitiator(Control controlToCheck, RadAjaxManager currentAjaxManager)
at Telerik.Web.UI.RadScriptBlock.IsInUpdatedControls(Control controlToCheck, RadAjaxManager currentAjaxManager)
at Telerik.Web.UI.RadScriptBlock.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at ASP.views_shared_header_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\hbweb\538e2744\52ba1acc\App_Web_header.ascx.639c3968.q1sqgwkt.0.cs:line 0
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at Telerik.Web.UI.RadAjaxPanel.RenderChildren(HtmlTextWriter writer)
at Telerik.Web.UI.RadAjaxPanel.RenderContents(HtmlTextWriter writer)
at Telerik.Web.UI.RadAjaxPanel.Render(HtmlTextWriter writer)
at Telerik.Web.UI.ControlRenderer.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer)
at Telerik.Web.UI.OurUpdatePanel.Render(HtmlTextWriter writer)
at System.Web.UI.PageRequestManager.RenderFormCallback(HtmlTextWriter writer, Control containerControl)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.HtmlFormWrapper.System.Web.UI.IHtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.PageRequestManager.RenderPageCallback(HtmlTextWriter writer, Control pageControl)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Page.Render(HtmlTextWriter writer)   
Radoslav
Telerik team
 answered on 19 Jun 2013
1 answer
197 views
Dear All,

How can I get radfilter selected expression as a string so that I can filter datasource and rebind the grid.

Thank you

Best Regards,

Kiran
Shinu
Top achievements
Rank 2
 answered on 19 Jun 2013
2 answers
150 views
Hi,
     We are using RadGrid like this: Using default skin


         <telerik:RadGrid ID="rgdAccts" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None"
            AllowSorting="True" AllowMultiRowEdit="True"
            OnItemDataBound="rgdAccts_ItemDataBound" OnBiffExporting="rgdAccts_BiffExporting" >
        <ClientSettings AllowExpandCollapse="false" AllowGroupExpandCollapse="false">
            <Selecting EnableDragToSelectRows="false" />
            <Scrolling AllowScroll="true" />
            <Resizing AllowColumnResize="true" AllowResizeToFit="true" ShowRowIndicatorColumn="false" />
        </ClientSettings>
        <MasterTableView DataKeyNames="AcctID">
           .........
              grid bound columns....
              <telerik:GridTemplateColumn DataField="PermissionID" UniqueName="PermissionID">
                    <EditItemTemplate>
                        <asp:RadioButtonList ID="rblPermission" runat="server" DataValueField="Custom"
                            DataTextField="ValueCustom" OnLoad="rblPermission_Load" RepeatDirection="Horizontal"
                            CssClass="grid-radiobuttonlist" />
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
 
          When the page is loaded and look into html, all the rows are getting displayed as 'rgEditRow'. No alternate row is Shown. So, alternate row colors are not displayed. Entire grid (all rows) are of same color. We need to apply alternate row color style to this grid. When I looked into default skin, I see styles only for rgRow, rgAltRow and rgEditRow. So, how can I apply different colors to alter rows. I prefer to do it in skin rather than doing in the grid locally. Because we have similar requirements on many asp.net pages.

Thanks,
Prathiba
Shinu
Top achievements
Rank 2
 answered on 19 Jun 2013
3 answers
2.2K+ views
I have spent the couple days researching my issue and have not been able to get it to work correctly.  There are a few topics on StackOverflow that are related to this issue and reading them has helped me but I'm at a bit of a roadblock and would appreciate a push in the right direction.

I wrote a small .NET 3.5 VB.NET web application for a client that allows users to maintain some data.  I'm using the RadGrid and RadComboBox controls and it consists of 3 pages.  One requirement I was not completely fond of was that the user wanted to make all of her changes then hit a save button at the end instead of saving back to the DB each time she applied her changes to the grid.  

I'm using an session object to store a collection of objects on each page and want to prompt the user with a dialog if they attempt to change the value of a dropdown or leave the page when there are pending actions.  After a lot of research here and in other places, I decided to create a hidden field on the page and update its value each time the action collection is updated on the server side.  Then I want to evaluate that value and if it's greater than 0, I want to prompt the user to save changes.

My function:

    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"><br>
        <script type="text/javascript"><br>
            window.onbeforeunload = confirmExit;<br>
            function confirmExit()<br>
            {<br>
                var actionCount = $get('<%=ActionCounterField.ClientID %>').value;<br>
                if (actionCount > 0) {<br>
                    alert("Pending Changes!");<br>
                      }<br>
                }<br>
    <br>
            </script><br>
        </telerik:RadCodeBlock>



My hidden field declaration:

    <asp:HiddenField id="ActionCounterField" runat="server" />


My server side code:
<br>
    Protected Sub UpdateActionCount()<br>
<br>
        ActionCounterField.Value = GoalCategoryActionList.Count<br>
<br>
    End Sub<br>


When I debug the application and add a record to my grid, the server side code is executed correctly.  I have also verified that the hidden control is found by the javascript function.  What I haven't been able to figure out, though, is why the hidden field value is not found by the function.

Any help is greatly appreciated.  Thank you!

Craig
Top achievements
Rank 1
 answered on 18 Jun 2013
0 answers
120 views
i need to show or hide radlistbox title depending on radgrid.selectedvalue is null or not i can show or hide the radlistbox but when i do that the title stills there even if radlistbox is hidden, may i have to activate any option on listbox?
Troika
Top achievements
Rank 1
 asked on 18 Jun 2013
2 answers
805 views
I am trying to replace the arrow image on the ComboBox control to match the rest of the page I am working on.  I am able to do this for the most part.  However, it appears as though the original white triangle remains no matter what.  I have tried the following CSS rules, and have not had any success.  I have attached both an image of the problem and the original image I am using for the background.  I need to get rid of the extraneous white arrow.  Any help would be appreciated.!
Here are the CSS rules I have tried:

div.RadComboBox_SST_Touch .rcbArrowCell {
    width: 26px!important;
    min-width: 26px!important;
    height: 100%!important;
    min-height: 100%!important;
    background: url('ComboBox/bc-arrow.gif')!important;
    background-image: url('ComboBox/bc-arrow.gif')!important;
    background-color: #ffffff;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    background-size: cover!important;
    background-repeat: no-repeat;
    background-position: left;
    background-position-x: center;
    background-position-y: center;
}
 
 div.RadComboBox_SST_Touch table td.rcbArrowCell {
    width: 26px!important;
    min-width: 26px!important;
    height: 100%!important;
    min-height: 100%!important;
    background: url('ComboBox/bc-arrow.gif')!important;
    background-image: url('ComboBox/bc-arrow.gif')!important;
    background-color: #ffffff;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    background-size: cover!important;
    background-repeat: no-repeat;
    background-position: left;
    background-position-x: center;
    background-position-y: center;
}
 
 div.RadComboBox_SST_Touch table td.rcbArrowCellRight {
    width: 26px!important;
    min-width: 26px!important;
    height: 100%!important;
    min-height: 100%!important;
    background: url('ComboBox/bc-arrow.gif')!important;
    background-image: url('ComboBox/bc-arrow.gif')!important;
    background-color: #ffffff;
    color: #000000;
    font-family: Arial, Helvetica, sans-serif;
    background-size: cover!important;
    background-repeat: no-repeat;
    background-position: left;
    background-position-x: center;
    background-position-y: center;
}
Brian
Top achievements
Rank 1
 answered on 18 Jun 2013
6 answers
608 views

In asp.net Telerik ,Is it possible multiple selection of RadListBoxItem using clicking and dragging the Mouse only .only its possible when we press 'shif' or 'ctrl' key and try to click and dragging using mouse.

sample code for Multiple selection:

<telerik:RadListBox SelectionMode="Multiple" ID="RadListBox1" runat="server">

<Items>

<telerik:RadListBoxItem runat="server" Value="Sample1" Text="Sample1" />

<telerik:RadListBoxItem runat="server" Value="Sample2" Text="Sample2" />

<telerik:RadListBoxItem runat="server" Value="Sample3" Text="Sample3" />

</Items>

</telerik:RadListBox>


Please suggest  some solution or  work around  for this issue  along with providing some sample code also.
Any help will be great appreaciated.

EZECHIAS
Top achievements
Rank 1
 answered on 18 Jun 2013
4 answers
1.1K+ views
I know this is probably a very basic question but I am fairly new to asp.net and very new to the Telerik controls.

I have a basic page with a text box and button and I want to fill a RadGrid with data from a sql query when the button is clicked using the data that is typed into the textbox as a variable for my query. When I put my query into the form load event and prepopulate the textbox the query works and the grid is populated. When I try the same code in the click event of the button I don't get any data in the grid. Do I need to call a refresh of the control or something? 
Jason
Top achievements
Rank 1
 answered on 18 Jun 2013
5 answers
237 views
Hello,
I'm using radEditor in my ASP.net application but i want to set view path of ImageManager runtime.
My Images directory is on differnt server so I created virtual directory in my application which is pointing to that server,
I have differnt images for each user so there are one folder per user. so i want to display user specific images to particular user. As do not want to see all images uploaded by  other user.

Can anybody help me to find solution for this issue.

Thanks in Advance,
Sandeep
 
Ivaylo
Telerik team
 answered on 18 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?