Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
148 views
I'm Customizing Group Header expression like this demo page:

http://demos.telerik.com/aspnet-ajax/grid/examples/groupby/expressions/defaultcs.aspx

I have a TotalCharge field which shown its Sum in footer, I also want when I make this field grouped, Sum of group also shown in Header text.

The problem is I use drag and drop columns to do the grouping so don't know how to make it works.

I think I should do it some how with GroupChanging event. Could you please help me make this works?

Regards
Mazdak
Tamkeen
Top achievements
Rank 2
 answered on 30 Jun 2011
5 answers
77 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
87 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
116 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
416 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
174 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
269 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
214 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
80 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
160 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
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?