Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
269 views
I have a web page containing a user control which itself contains another user control.  The page contains an Ajax Manager and both user controls define their own Ajax Manager Proxies.

The top level user control shows or hides the nested user control based on the value of a combo box.  The nested user control also shows or hides a text box based on the value of a combo box.  When I select the option in the combo box of the root user control to display the nested user control and then select the value of the combo box in the nested user control to display the text box in the nested user control I get a javascript "'Undifined' is null or not an object" error and I don't know why.

Here's the contents of the page (nothing in the code behind):
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Src="WebUserControl1.ascx" TagName="uc1" TagPrefix="top" %> 
 
<!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>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
      
    <top:uc1 ID="UserControl1" runat="server" /> 
      
    <telerik:RadAjaxManager ID="DefaultRadAjaxManager" runat="server" />      
    </form> 
</body> 
</html> 

Here's the contents of the UserControl1:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication1.WebUserControl1" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Src="WebUserControl2.ascx" TagName="uc2" TagPrefix="nested" %> 
 
This controls visibility of nested user control.<br /> 
<telerik:RadComboBox ID="name" runat="server" AutoPostBack="true" OnSelectedIndexChanged="name_SelectedIndexChanged">  
    <Items> 
        <telerik:RadComboBoxItem Text="Hide nested control" Value="1" Selected="true" /> 
        <telerik:RadComboBoxItem Text="Show nested control" Value="2" /> 
    </Items> 
</telerik:RadComboBox> 
                          
<asp:Panel ID="somePnl" runat="server" style="display:none;">  
    <nested:uc2 ID="UserControl2" runat="server" /> 
</asp:Panel> 
 
<telerik:RadAjaxManagerProxy ID="uc1Proxy" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="name">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="somePnl" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
Here's the code behind file for the above user control:
using System;  
using System.Web;  
using Telerik.Web.UI;  
 
namespace WebApplication1  
{  
    public partial class WebUserControl1 : System.Web.UI.UserControl  
    {  
        protected void name_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)  
        {  
            if (name.SelectedValue=="1")  
                somePnl.Style["display"] = "none";  
            else 
                somePnl.Style["display"] = "block";  
        }  
    }  

Here's the nested user control and code behind:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl2.ascx.cs" Inherits="WebApplication1.WebUserControl2" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<br /> 
This controls visibility of text box.<br /> 
<telerik:RadComboBox ID="phoneSelect" runat="server" AutoPostBack="true" onselectedindexchanged="phoneSelect_SelectedIndexChanged">  
    <Items> 
        <telerik:RadComboBoxItem Text="Show text box" Value="-1" /> 
        <telerik:RadComboBoxItem Text="" Value="" Selected="true" /> 
        <telerik:RadComboBoxItem Text="(123)555-1234" Value="(123)555-1234" /> 
    </Items> 
</telerik:RadComboBox> 
 
<asp:Panel ID="phoneNumberPnl" runat="server" style="display:none;">  
    <telerik:RadNumericTextBox ID="phoneNumber" runat="server" 
        MaxLength="20" 
        Width="160" /> 
</asp:Panel> 
 
<telerik:RadAjaxManagerProxy ID="uc2Proxy" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="phoneSelect">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="phoneNumberPnl" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
using System;  
using System.Web;  
using System.Web.UI;  
 
namespace WebApplication1  
{  
    public partial class WebUserControl2 : System.Web.UI.UserControl  
    {  
        protected void phoneSelect_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
        {  
            if (phoneSelect.SelectedValue != "-1")  
                phoneNumberPnl.Style["display"] = "none";  
            else 
                phoneNumberPnl.Style["display"] = "block";  
        }  
    }  

 

Note that I'm using ASP Panels and setting style attributes to show and hide because the actual app needs all the controls to be actually present on the form.

Am I doing something wrong or is this a bug?

Maria Ilieva
Telerik team
 answered on 29 Dec 2008
1 answer
108 views
Is it possible to capture the resources' selectedindexchanged event in the advanced insert form (i don't have a custom insert form)?. I have two resources and I want the 2nd resource's values to change when the 1st resource's selected index is changed.Please help.
Peter
Telerik team
 answered on 29 Dec 2008
1 answer
97 views
In the old RadControls (2008 Q1).   I had code to add ajax settings from within a usercontrol to the ajaxmanager on the containing page. (Senario is I have a set of dynamically created controls for different cultures, and one field for each culture does apostback to check the value is unique in database).

When I upgraded to AJAX controls (2008 Q3), this no longer works as it used to, it does the Ajax Postback and displays the loading bar as expected, but after the ajax call has finished the field disappears, any reason why?


This is where the AjaxSetting is added in the Page_Load of my User Control, If i comment this out the ajax of the outer containing panel handles the ajax call and everything is fine, but this is added in the page not the user control?

 

 

 

Dim oAjaxManager As Telerik.Web.UI.RadAjaxManager

 

oAjaxManager = RadAjaxManager.GetCurrent(Page)

 

 

Dim oAjaxLoadingBar As Telerik.Web.UI.RadAjaxLoadingPanel

 

oAjaxLoadingBar = Page.FindControl(

"AjaxLoadingBar")

 


If Not IsNothing(oFriendlyURL) And Not IsNothing(oFriendlyURLError) Then  
     oAjaxManager.AjaxSettings.AddAjaxSetting(oFriendlyURL, oFriendlyURL, Nothing)  
     oAjaxManager.AjaxSettings.AddAjaxSetting(oFriendlyURL, oFriendlyURLError, oAjaxLoadingBar)  
End If 


 

Maria Ilieva
Telerik team
 answered on 29 Dec 2008
1 answer
38 views
I'm working with gantt chart. With a column which display during time of a working . I want to write time start at button of this column and time to stop at top of this column. But i don't know to how to do this ? Can't you give me a solution for this problem ?
Thanks!
Giuseppe
Telerik team
 answered on 29 Dec 2008
1 answer
64 views
Our application which supports both IE 6 and IE 7 is experiencing some problems with IE 6...

Please see this video ( http://uk.youtube.com/watch?v=x_jaqKbSwLA ) of the behaviour experienced. If you pay particular attention to the bottom right of the screen. to the circular icons appearing on our page. these icons are wrapped in a div tag which is set to float:right, position:absolute; you'll notice that when we resize the window the icons jump all over the place,

This seems to be a problem with the RadSplitter as when we extracted out the HTML being used within this radpane we arent experiencing this problem. the same goes for running the whole thing in IE7, we arent seeing this problem.

Any help would be most appreciate, i can provide you with sample code if required.
Cheers
Svetlina Anati
Telerik team
 answered on 29 Dec 2008
3 answers
128 views

I think this behavior is a bug. Try to do the same to replicate it. 

<telerik:RadGrid ID="RadGrid1" runat="server" 
            onneeddatasource="RadGrid1_NeedDataSource"   
        Skin="Office2007" AllowFilteringByColumn="True" AllowPaging="True"   
        AllowCustomPaging="True" VirtualItemCount="10000" 
        AllowSorting="True" GridLines="None" oncolumncreated="RadGrid1_ColumnCreated"   
        ShowFooter="True" onsortcommand="RadGrid1_SortCommand"   
        onitemdatabound="RadGrid1_ItemDataBound"   
        onitemcommand="RadGrid1_ItemCommand"  EnableLinqExpressions="false">  
          
<HeaderContextMenu Skin="Office2007" EnableTheming="True">  
<ExpandAnimation Type="None" Duration="0" /> 
<CollapseAnimation Type="None" Duration="0" /> 
</HeaderContextMenu> 
 
        <PagerStyle Mode="NextPrevNumericAndAdvanced" /> 
 
<MasterTableView EnableHeaderContextMenu="true" AllowMultiColumnSorting="True" AllowCustomSorting="true" ClientDataKeyNames="n_id,n_code_name,n_nug_typ_id" > 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
</MasterTableView> 
 
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowRowsDragDrop="true" EnableRowHoverStyle="true" > 
            <Selecting AllowRowSelect="True" /><ClientEvents OnRowDblClick="RowDblClick" /> 
            <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
            <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="True"></Resizing> 
        </ClientSettings> 
 
<FilterMenu Skin="Office2007" EnableTheming="True">  
<ExpandAnimation Type="None" Duration="0" /> 
<CollapseAnimation Type="None" Duration="0" /> 
</FilterMenu> 
    </telerik:RadGrid> 
      
 

My dataset has 15 columns. Only the first 4 columns are displayed. The rest are available through client side header menu. (New feature of you 3q 2008 grid). The fourth column (last visible) has a name n_date_created. When I click the img of calendar (filter row), nothing happens. But this happens only when my datasource is implicitly sorted by this column! When this column is not participate in multicolumn sorting, calendar popups.

My code (only interesting parts) :

During NeedDataSource this code does nothing interesting from your point of view:
        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            int dbAttributesCount, i, j;  
            DataTable dtMetadata;  
 
            // získání dat  
            this.ReadQueryAndRun();  
 
            dbAttributesCount = this.dsTranslatedAttributes.Tables[0].Rows.Count;  
            dtMetadata = this.dsTranslatedAttributes.Tables[0];  
            DataColumn dataColumn;  
 
            i = 0;  
            while (i < this.dsData.Tables[0].Columns.Count)  
            {  
                dataColumn = this.dsData.Tables[0].Columns[i];  
 
                for (j = 0; j < dbAttributesCount; j++)  
                {  
                    if (dataColumn.ColumnName == (string)dtMetadata.Rows[j]["code_name"])  
                        break;  
                }  
 
                if ((j == dbAttributesCount) && (this.dsData.Tables[0].Columns[i].ColumnName != "renderStatus"))  
                    this.dsData.Tables[0].Columns.Remove(dataColumn);  
                else  
                    i++;  
            }  
 
            thisthis.RadGrid1.DataSource = this.dsData.Tables[0];  
        } 

I am hiding some columns and not displaying another columns according to the definition from elsewhere during columCreated event:
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)  
        {  
            // zkusí se dohledat pÅ™ekládaná popiska sloupce  
              
            DataRow[] foundRows;  
            XmlNode xnColumn;  
 
            string columnUniqueName;  
 
            columnUniqueName = e.Column.UniqueName;  
 
            if (columnUniqueName != "ExpandColumn")  
            {  
                // nastavení pÅ™ekládaného záhlaví sloupce  
                if (this.dsTranslatedAttributes != null)  
                {  
                    foundRows = this.dsTranslatedAttributes.Tables[0].Select("code_name = '" + columnUniqueName + "'");  
                    if (foundRows.Length > 0)  
                    {  
                        e.Column.HeaderText = (string)foundRows[0]["name"];  
                    }  
 
                    // skrytí sloupce, který není tÅ™eba ukazovat  
                    if (columnUniqueName == "renderStatus")  
                        e.Column.Visible = false;  
 
                    // nastavení viditelnosti jednotlivých sloupců dle definice v dotazu  
                    e.Column.Display = false;  
 
                    if (columnUniqueName != null && columnUniqueName != "")  
                    {  
                        xnColumn = this.xdQuery.SelectSingleNode("//list/grid[@type='nuggets']/columns/col[@name='" + columnUniqueName + "']");  
                        if (xnColumn != null)  
                        {  
                            // nastavení viditelnosti jednotlivých sloupců dle definice v dotazu  
                            if (xnColumn.Attributes["state"] != null && xnColumn.Attributes["state"].Value == "1")  
                                e.Column.Display = true;  
                            else  
                                e.Column.Display = false;  
                        }  
                    }  
                }  
            }  
        } 

I am replacing some columns of some rows when the user has not enough rights during ItemDataBound event:

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            GridDataItem dataItem;  
            long nuggetId;  
            string attCodeName;  
              
            if (this.gnl.containsNuggetsWithAPActivated)  
            {  
                if (e.Item is GridDataItem)  
                {  
                    dataItem = (GridDataItem)e.Item;  
                    nuggetId = long.Parse(dataItem["n_id"].Text);  
 
                      
 
                    this.gnl.alNuggetsWithAPActivated.Contains(nuggetId.ToString());  
                    {  
                        // vÅ¡echna metadata musí být dohledána v dsCheckedAttributes, jinak je nutné je vyeliminovat  
 
                        int attributeCount = this.dsTranslatedAttributes.Tables[0].Rows.Count;  
                        for (int i = 0; i < attributeCount; i++)  
                        {  
 
                            // nÄ›které atributy jsou viditelné vždy  
                            attCodeName = (string)this.dsTranslatedAttributes.Tables[0].Rows[i]["code_name"];  
                            if (attCodeName != "n_id" && attCodeName != "n_nug_typ_id" && attCodeName != "renderStatus")   
                            {  
                                if (!(this.dsCheckedAttributes.Tables[0].Select("id = " + nuggetId.ToString() + " and code_name='" + attCodeName + "'").Length > 0))  
                                {  
                                    if (dataItem[attCodeName] != null)  
                                        dataItem[attCodeName].Text = "~RR~";  
                                }  
                            }  
 
                        }  
                    }  
                }  
            }  
        } 

When the grid is loaded for the first time, I do this (In my case, I am sorting by the n_date_created column): Little triangle appears in the right column of the grid (calendar column):
if (gnp.sortedColumn != null)  
                    {  
                        se = new GridSortExpression();  
                        se.FieldName = gnp.sortedColumn;  
                        if (gnp.sortedOrder == "asc")  
                            se.SortOrder = GridSortOrder.Ascending;  
                        else  
                            se.SortOrder = GridSortOrder.Descending;  
                        this.RadGrid1.MasterTableView.SortExpressions.Add(se);  
                    } 
Calendar filter column will NOT popup!!!!!!!!!!!!!!!!!!!!!!!!!!!!

HELP!

Thank you very much.

TOm
Rosen
Telerik team
 answered on 29 Dec 2008
1 answer
103 views
Hi,

I want to align all of the the toolbars on the editor towards the center. How can I do that?

I have a call out for the background color change here:

<script type="text/javascript">  
   function OnClientLoad(editor, args)  
   {  
      var style = editor.get_contentArea().style;  
      style.backgroundImage = "none";  
      style.backgroundColor = "white";  
   }  
    </script>  

Or do I make the change in the toolsfile.xml?

Thanks, Cam
Tervel
Telerik team
 answered on 29 Dec 2008
2 answers
143 views
Hi there -

I have a RADGrid in which I use GridTemplateColumns.  In one of these templates I have an EditItemTemplate that contains a RadComboBox, and RequiredFieldValidator and and ValidatorCalloutExetension.  The validator and callout work as expected when the grid is in edit mode until I add a RadAjaxManager to the page. 

With the RadAjaxManager the validator by itself works correctly, however, when I add the ValidatorCalloutExtension back in I start receiving a JavaScript error: Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: id

The problem seems to lie with the ValidatorCalloutExtension and the RadAjaxManager - is this anyone else is aware of, is there a "trick" I've missed anywhere? 

I will try and put together a simplified code example to add to the post.

Many thanks,
Simon

Simon
Top achievements
Rank 1
 answered on 29 Dec 2008
9 answers
401 views
We've recently upgraded our RadEditor For SharePoint 2007 (Lite Version) from 4.3.1.0 to 4.5.4.0.  Everything went well for the most part except for the styles from within the rich text editor.  The editor is not displaying our custom CSS.

I did some tinkering and got it to work with Firefox and IE7.  However I was unsuccessful in correcting this issue in IE6.  Could you recommend a solution?

Here's an example of some of our CSS from the EditorContentArea.css:

(inserted at the bottom of file)
------

body {
    font: 10pt tahoma, arial, sans-serif;
    line-height: 14pt;
}


/* heading styles */
h1 {
    font: 20pt georgia, serif;
    margin: 10px 0 20px;
    padding: 0;
    letter-spacing: -1px;
    white-space: nowrap;
}

h2 {
    font: bold 12pt tahoma, arial, sans-serif;
    margin: 30px 0 0;
    padding-bottom: 3px;
    border-bottom: solid 1px #cacaca;
}
Stanimir
Telerik team
 answered on 29 Dec 2008
5 answers
157 views
We recently migrated our MOSS 2007 site to a new server. We had been using RadEditor Lite successfully on the site and it was being extensively in Wikis (lists). We installed the RadEditor on the new server as well.

Since moving our site to the new server the RadEditor has stopped working in the Wikis - both old and newly created ones. We have activated it to operate as the default editor in lists but it seems that the default is still the standard MOSS editor. I've checked the forum and help files and it was mentioned that you should look for the radeditorlist.ascx in the ControlTemplates folder. It's there.

Does anyone have any ideas? It seems to be the same installation on the new server but it isn't working.

Thanks,
Sam Gliksman
sgliksman@faculty.ncjhs.org
Stanimir
Telerik team
 answered on 29 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?