Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
61 views
Hello,

I have a website in root folder of a (development)web server and the skins of radcontrols works just fine.

When i publish the mentioned website to a production server, and the structure of folders of the server has a virtual directory in the root forlder to a subdomain.

Any configuration of radcontrols to publish in this scenario?

Thanks
Georgi Tunev
Telerik team
 answered on 30 Jun 2011
3 answers
78 views
is there a way to replace the ... in the numeric buttons to an image like < and >?
Pavlina
Telerik team
 answered on 30 Jun 2011
1 answer
96 views
I'd really like to use the File Explorer to allow user's to access and modify files in the home directory when they are off site. However, it appears that the File Explorer only allows you to view files and folders that are a part of your web application. Is it possible to get the File Explorer to access files outside of the web application and through a UNC path?
Marin Bratanov
Telerik team
 answered on 30 Jun 2011
1 answer
392 views

I have a radgrid control (with detail tables) on an aspx page . I have button column on the parent and  the child(detail

tables) as well.

Based on some criteria I have to disable/enable the button column on parent and/or the child.
what is the best way to do it?

To explain further, the parent display the order  and when click on the order it shows the order items for the order.
the button column is to duplicate an order. the button on the parent duplicates the whole order. the button on the child

(order items) duplicates an order with that particular order item.
Please advise the best solution,
Thanks

Shinu
Top achievements
Rank 2
 answered on 30 Jun 2011
5 answers
152 views
Hi,

I have one situation where i want to find the header of Grid and apply the custom css. In grid I have following column and want to get the header of this column in code
            <ExpandCollapseColumn Visible="True">
            </ExpandCollapseColumn>
                <telerik:GridTemplateColumn UniqueName="AssociateColumn">
                    <ItemTemplate>
                        <asp:HyperLink ID="Lnktest" runat="server" Text="test"></asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>

I have follwoing code to get the header and i am able to get that for other columns but not for this above column.

if (e.Item is GridHeaderItem)
            {
                GridHeaderItem item = (GridHeaderItem)e.Item;
                foreach (GridColumn col in GridAttorney.MasterTableView.Columns)
                {
                    if (col is GridEditCommandColumn || col is GridButtonColumn)
                    {
                        item[col.UniqueName].CssClass = "gridsBlankheadercolumn";
                    }
                }
            }

Can anyone tell me How to get this Column header in this above code ? Also please see the attached screenshot for better understanding.

Thanks,
--Jai
Iana Tsolova
Telerik team
 answered on 30 Jun 2011
1 answer
242 views
hi,

I have a project that has been build on asp.net 2008 (based on vb.net)  and microsoft ajax, now I want to add telerik tree view to the project,
when I have added the component I got too many errors 'ScriptManager' is ambiguous in the namespace 'System.Web.UI'

so any idea how to solve this problem?
Peter
Telerik team
 answered on 30 Jun 2011
4 answers
194 views
Dear Sir:

I want the grid to be 100% height for my web page and my page is resizable. i tried to set 100% height for my grid but it is not working. is there any solution for my simple case?

From CH





CH
Top achievements
Rank 1
 answered on 30 Jun 2011
1 answer
74 views
hi,
i'm wanting to use the multiple file upload feature, but instead of the uploadprogress showing above the "input" button. I'd like to move it inside a listbox item row.

ideally if i added multiple files, i'd like to see each progress for each file show up in its own listbox row.

is this possible, and if so can someone give me some guidance?

thanks
Peter Filipov
Telerik team
 answered on 30 Jun 2011
2 answers
141 views
When using the RadTreeList in the DynamicData ManyToMany_Edit.ascx control, I am getting the following null ref error:

[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.UI.TreeListItemDecorator.PrepareDataItemsServiceCells(RadTreeList owner) +534 Telerik.Web.UI.RadTreeList.PrepareRows() +215 Telerik.Web.UI.RadTreeList.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8 System.Web.UI.Control.Render(HtmlTextWriter writer) +10 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8 System.Web.DynamicData.DynamicControl.Render(HtmlTextWriter writer) +154 ...

Here is the code:

 

<%@ Control Language="C#" CodeBehind="ManyToMany_Edit.ascx.cs" Inherits="Ctp.U.Web.ResidentPortal.Forms.ManyToMany_EditField" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadTreeList ID="_radTreeList1" runat="server" OnDataBound="_radTreeList1_DataBound">
</telerik:RadTreeList>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Web.DynamicData;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace Ctp.U.Web.ResidentPortal.Forms
{
    public partial class ManyToMany_EditField : System.Web.DynamicData.FieldTemplateUserControl
    {
        public void Page_Load(object sender, EventArgs e)
        {
            // Register for the DataSource's updating event
            EntityDataSource ds = (EntityDataSource)this.FindDataSourceControl();
 
            // This field template is used both for Editing and Inserting
            ds.Updating += new EventHandler<EntityDataSourceChangingEventArgs>(DataSource_UpdatingOrInserting);
            ds.Inserting += new EventHandler<EntityDataSourceChangingEventArgs>(DataSource_UpdatingOrInserting);
        }
 
        void DataSource_UpdatingOrInserting(object sender, EntityDataSourceChangingEventArgs e)
        {
            MetaTable childTable = ChildrenColumn.ChildTable;
 
            // Comments assume employee/territory for illustration, but the code is generic
 
            // Get the collection of territories for this employee
            RelatedEnd entityCollection = (RelatedEnd)Column.EntityTypeProperty.GetValue(e.Entity, null);
 
            // In Edit mode, make sure it's loaded (doesn't make sense in Insert mode)
            if (Mode == DataBoundControlMode.Edit && !entityCollection.IsLoaded)
            {
                entityCollection.Load();
            }
 
            // Get an IList from it (i.e. the list of territories for the current employee)
            // REVIEW: we should be using EntityCollection directly, but EF doesn't have a
            // non generic type for it. They will add this in vnext
            IList entityList = ((IListSource)entityCollection).GetList();
 
            // Go through all the territories (not just those for this employee)
            foreach (object childEntity in childTable.GetQuery(e.Context))
            {
 
                // Check if the employee currently has this territory
                bool isCurrentlyInList = entityList.Contains(childEntity);
 
                // Find the checkbox for this territory, which gives us the new state
                string pkString = childTable.GetPrimaryKeyString(childEntity);
                //ListItem listItem = CheckBoxList1.Items.FindByValue(pkString);
                TreeListDataItem radItem = null;
 
                foreach (TreeListDataItem item in _radTreeList1.Items)
                {
                    if (item["Id"].Text == pkString)
                        radItem = item;
                }
 
                if (radItem == null)
                    continue;
 
                // If the states differs, make the appropriate add/remove change
                if (radItem.Selected)
                {
                    if (!isCurrentlyInList)
                        entityList.Add(childEntity);
                }
                else
                {
                    if (isCurrentlyInList)
                        entityList.Remove(childEntity);
                }
            }
        }
 
        protected void DataBound()
        {
            MetaTable childTable = ChildrenColumn.ChildTable;
 
            // Comments assume employee/territory for illustration, but the code is generic
 
            IList entityList = null;
            ObjectContext objectContext = null;
 
            if (Mode == DataBoundControlMode.Edit)
            {
                object entity;
                ICustomTypeDescriptor rowDescriptor = Row as ICustomTypeDescriptor;
                if (rowDescriptor != null)
                {
                    // Get the real entity from the wrapper
                    entity = rowDescriptor.GetPropertyOwner(null);
                }
                else
                {
                    entity = Row;
                }
 
                // Get the collection of territories for this employee and make sure it's loaded
                RelatedEnd entityCollection = Column.EntityTypeProperty.GetValue(entity, null) as RelatedEnd;
                if (entityCollection == null)
                {
                    throw new InvalidOperationException(String.Format("The ManyToMany template does not support the collection type of the '{0}' column on the '{1}' table.", Column.Name, Table.Name));
                }
                if (!entityCollection.IsLoaded)
                {
                    entityCollection.Load();
                }
 
                // Get an IList from it (i.e. the list of territories for the current employee)
                // REVIEW: we should be using EntityCollection directly, but EF doesn't have a
                // non generic type for it. They will add this in vnext
                entityList = ((IListSource)entityCollection).GetList();
 
                // Get the current ObjectContext
                // REVIEW: this is quite a dirty way of doing this. Look for better alternative
                ObjectQuery objectQuery = (ObjectQuery)entityCollection.GetType().GetMethod(
                    "CreateSourceQuery").Invoke(entityCollection, null);
                objectContext = objectQuery.Context;
            }
 
            // Go through all the territories (not just those for this employee)
            foreach (object childEntity in childTable.GetQuery(objectContext))
            {
                _radTreeList1.DataKeyNames = new string[] { "Id" };
                _radTreeList1.ParentDataKeyNames = new string[] { "ParentId" };
 
                TreeListDataItem radItem = new TreeListDataItem(_radTreeList1
                    , TreeListItemType.Item
                    , _radTreeList1.Items.Count
                    , true);
 
                radItem.DataItem = childEntity;
 
                // Make it selected if the current employee has that territory
                if (Mode == DataBoundControlMode.Edit)
                {
                    radItem.Selected = entityList.Contains(childEntity);
                }
 
                _radTreeList1.Items.Add(radItem);
            }
        }
 
        protected void _radTreeList1_DataBound(object sender, EventArgs e)
        {
            DataBound();
        }
 
        public override Control DataControl
        {
            get
            {
                return _radTreeList1;
            }
        }
 
    }
}
Radoslav
Telerik team
 answered on 30 Jun 2011
1 answer
34 views
Hi,
I am facing issues while converting my application from classic RadControl to ASP.NET AJAX radcontrol.
My requirement is that on row click of one grid (dgProductGroup in the below code snippet, I need to update dgProduct).
Earliler I was using the below code in my ASPX page:

<radA:RadAjaxManager 
            ID="RadAjaxManager1" 
            runat="server">
        <AjaxSettings>
            <radA:AjaxSetting AjaxControlID="dgproductGroups">
                <UpdatedControls>
                    <radA:AjaxUpdatedControl ControlID="dgProducts" LoadingPanelID = "loadProducts" />
                    <radA:AjaxUpdatedControl ControlID="dgFileList" LoadingPanelID = "loadFileDetails" />
                </UpdatedControls>
            </radA:AjaxSetting>
            <radA:AjaxSetting AjaxControlID="dgProducts">
                <UpdatedControls>
                    <radA:AjaxUpdatedControl ControlID="dgFileList" LoadingPanelID = "loadFileDetails" />
                </UpdatedControls>
            </radA:AjaxSetting>
            <radA:AjaxSetting AjaxControlID="dgFileList">
                <UpdatedControls>
                    <radA:AjaxUpdatedControl ControlID="dgFileList" LoadingPanelID = "loadFileDetails" />
                </UpdatedControls>
            </radA:AjaxSetting>
            <radA:AjaxSetting AjaxControlID="btnShowObsolete">
                <UpdatedControls>
                    <radA:AjaxUpdatedControl ControlID="dgFileList" LoadingPanelID = "loadFileDetails" />
                </UpdatedControls>
            </radA:AjaxSetting>
            <radA:AjaxSetting AjaxControlID="btnObsolete">
                <UpdatedControls>
                    <radA:AjaxUpdatedControl ControlID="dgFileList" LoadingPanelID = "loadFileDetails" />
                </UpdatedControls>
            </radA:AjaxSetting>
        </AjaxSettings>
        <ClientEvents OnResponseReceived = "OnAjaxDataReceived" OnRequestStart = "OnAjaxDataSentStart"/>
    </radA:RadAjaxManager>
    <radA:AjaxLoadingPanel 
            id="loadProducts" 
            style="width:320px;padding-top:30px;" 
            runat="server">
        <asp:Image 
            ID="Image2" 
            ImageUrl="~/RadControls/AJAX/Skins/Default/MSN_Blue.gif" 
            AlternateText="Loading" 
            BorderWidth="0px" 
            Runat="server">
        </asp:Image>
    </rada:AjaxLoadingPanel>
    <radA:AjaxLoadingPanel 
            id="loadFileDetails" 
            style="width:320px;padding-top:130px;" 
            runat="server">
        <asp:Image 
            ID="Image3" 
            ImageUrl="~/RadControls/AJAX/Skins/Default/MSN_Blue.gif" 
            AlternateText="Loading" 
            BorderWidth="0px" 
            Runat="server">
        </asp:Image>
    </rada:AjaxLoadingPanel>


And this was the javascript part.

function OnAjaxDataReceived()
    {
        if(dgProductsDisabled = true)
        {
            EnableGrid('ctl00_CntPlHolder_dgProducts');
            dgProductsDisabled = false;
        }
          
        EnableGrid('ctl00_CntPlHolder_dgproductGroups');
    }
  
function OnAjaxDataSentStart()
    {
        //PRODUCTS DATAGRID WILL NOT BE DISABLED WHEN THE PRODUCT GROUPS GRID's ROW IS SELECTED 
        if(dgProductsDisabled = true)
        {
            DisableGrid('ctl00_CntPlHolder_dgProducts');
        }
          
        //DISABLING THE PRODUCT GROUPS DATAGRID UNTIL THE DATA IS RECIEVED FROM THE SERVER THROUGH RAD AJAX
        DisableGrid('ctl00_CntPlHolder_dgproductGroups');
    }
  
function EnableGrid(gridClientID)
    {
        window[gridClientID].AjaxRequest("dgproductGroups", "");
    }
      
    function DisableGrid(gridClientID)
    {
        try
        {
            gridCtrl = window[gridClientID];
            gridCtrl.Control.disabled = "disabled";
            gridCtrl.ClientSettings.Selecting.AllowRowSelect = false;
            gridCtrl.ClientSettings.Resizing.AllowColumnResize = false;
            gridCtrl.ClientSettings.Resizing.AllowRowResize = false;
            gridCtrl.ClientSettings.AllowColumnsReorder = false;
            gridCtrl.ClientSettings.AllowDragToGroup = false;
            gridCtrl.ClientSettings.EnablePostBackOnRowClick = false;
  
            var links = gridCtrl.Control.getElementsByTagName("a");
            var images = gridCtrl.Control.getElementsByTagName("img");
            var inputs = gridCtrl.Control.getElementsByTagName("input");
            var sortButtons = gridCtrl.Control.getElementsByTagName("span");
  
            for(var i = 0; i < links.length; i++)
            {
                links[i].href = "";
                links[i].onclick = function()
                {
                    return false;
                }
            }
              
            for(var i = 0; i < images.length; i++)
            {
                images[i].onclick = function()
                    {
                        return false;
                    }
            }
            for(var i = 0; i < sortButtons.length; i++)
            {
                sortButtons[i].onclick = function()
                {
                    return false;
                }
            }
              
            for(var i = 0; i < inputs.length; i++)
            {
                switch(inputs[i]. type)
                {
                    case "button":
                        inputs[i].onclick = function()
                        {
                            return false;
                        }
                        break;
                      
                    case "checkbox":
                        inputs[i].disabled = "disabled";
                        break;
                    case "radio":
                        inputs[i].disabled = "disabled";
                        break;
                    case "text":
                        inputs[i].disabled = "disabled";
                        break;
                    case "password":
                        inputs[i].disabled = "disabled";
                        break;
                    case "image":
                        inputs[i].onclick = function()
                        {
                            return false;
                        }
                        break;
                    case "file":
                        inputs[i].disabled = "disabled";
                        break;
                          
                    default:
                    break;
                }   
            }
              
            var scrollArea = document.getElementById(gridCtrl.ClientID + "_GridData");
  
            if(scrollArea)
            {
                scrollArea.disabled = "disabled";
            }
        }
        catch(e)
        {
            alert(e);
        
    }

With the new Rad Ajax, I either get error that object does not support the method (in javascript EnableGrid function) or the grid fails to load and I only see the loading image.
Can you please help me in this upgrade.

Thanks,
Ripunjay
Sebastian
Telerik team
 answered on 30 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?