Telerik Forums
UI for ASP.NET AJAX Forum
15 answers
975 views

Telerik.Web.UI.dll version:2010.1.415.35

1. First you need to install Telerik.Web.UI.dll in the GAC

2. Next you should tell SharePoint that the controls from the Telerik.Web.UI.dll is safe to use.

To do so you should add a few <SafeControl> entries within the <SafeControls> section in your web.config:

<SafeControl Assembly="Telerik.Web.UI, Version=2010.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"

Namespace="Telerik.Web.UI" TypeName="*" Safe="True" />

 

3. You need to register their handlers in the respective section in the web.config:

[web.config] IIS 5.x/6.x/7.x

 

<httpHandlers>

<add verb="*" path="Telerik.Web.UI.DialogHandler.aspx"

type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />

<add verb="*" path="Telerik.Web.UI.SpellCheckHandler.axd"

type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />

<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" />

</httpHandlers>

 

 

<handlers>

.................

<add name="Telerik.Web.UI.SpellCheckHandler.axd_*" path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*"

type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Version=2010.1.415.35, Culture=neutral,

PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode,runtimeVersionv2.0" />

<add name="Telerik.Web.UI.DialogHandler.aspx_*" path="Telerik.Web.UI.DialogHandler.aspx" verb="*"

type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Version=2010.1.415.35, Culture=neutral,

PublicKeyToken=121fae78165ba3d4" preCondition="integratedMode,runtimeVersionv2.0" />

<add name="Telerik.Web.UI.WebResource.axd_*" path="Telerik.Web.UI.WebResource.axd" verb="*"

type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode,runtimeVersionv2.0" />

.............

</handlers>

Thanks Vinh

Stanimir
Telerik team
 answered on 13 Apr 2011
2 answers
178 views
Hi,

I have a page in which there is a TabStrip with five multipages. In 2 multipages, there are radgrids.

Can you please help with setting Ajax in following scenarios;
How do I do the AjaxSetting for a CheckBox which is inside the radgrid to update some content in the database and refresh the radgrid or is it possible to do an Ajax setting to just update one particular column of the same radgrid when the checkedchanged event is fired?

For fourth multipage there are more than 4 comboboxes and I have to update the content of 3 comboboxes when the selected value of first combobox is changed. What will be the Ajax setting in this case?

Currently I have all the content in the same page but if I want to move the content of 5 multipages to 5  usercontrols , how can I do the  Ajax settings?

Please let me know how to do the Ajax setting in all these different scenarios.

Thanks.
Dimitar Terziev
Telerik team
 answered on 13 Apr 2011
2 answers
132 views
I am using the Editor and all of my applications of it contain a large empty space below the actual Editor window.  The attached screen capture contains an image of the Editor with this specific space colored "yellow".  If I look at the area in the "MS developer tool" (refer to the other screen capture), it is assigned to a css class of "reToolZone".

Can you tell me:

(1) What this space is intended for (that I am apparently not using)?
(2) How can I get rid of this wasteful empty space?  If I'm not using it for anything, there must be some way to eliminated it.

Thanks in advance for the assist!

Lynn
Lynn
Top achievements
Rank 2
 answered on 13 Apr 2011
5 answers
138 views
Hi there.

I have a grid with sorting, filtering, grouping and exporting to excel (html format) enabled. Everything works fine but I can only export to excel if i have not done any sorting, filtering or grouping.

When I try to export, the command bar and filter bar disappear and the last column loses some of its formatting but no exceptions seem to be thrown. I'm using 2010.2.929.35 in DotNetnuke 5.6.1.

Thanks in advance for any suggestions.
Cheers
Chris

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CompanyReports_Scoreboard.ascx.cs" Inherits="Revd.Modules.Managers.CompanyReports_Scoreboard" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
<table class="FFTableView100pc">
    <tr>
        <td class="FFTableHeader">
            Scoreboard
        </td>
    </tr>
    <tr>
        <td class="FFGeneral">
            The Scoreboard shows all participants and their scores.
        </td>
    </tr>
    <tr>
        <td>
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" OnItemCommand="RadGrid1_ItemCommand" AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource1" GridLines="None" ShowGroupPanel="True" OnGridExporting="RadGrid1_Exporting" OnItemDataBound="RadGrid1_ItemDataBound" PageSize="20">
                <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
                </HeaderContextMenu>
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="TenantID" DataSourceID="SqlDataSource1" CommandItemDisplay="Bottom">
                    <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true" ExportToExcelText="Export to Excel" ShowRefreshButton="true" RefreshText="Refresh this view" />
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="TenantID" DataType="System.Int32" HeaderText="TenantID" ReadOnly="True" SortExpression="TenantID" UniqueName="TenantID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn Groupable="false" DataField="TenantName" HeaderText="Customer Name" SortExpression="TenantName" UniqueName="TenantName">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="PartnerID" DataType="System.Int32" HeaderText="PartnerID" SortExpression="PartnerID" UniqueName="PartnerID" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="TenantClassification1" HeaderText="Company Size" SortExpression="TenantClassification1" UniqueName="TenantClassification1">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="TenantClassification2" HeaderText="Industry Sector" SortExpression="TenantClassification2" UniqueName="TenantClassification2">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="TenantClassification3" HeaderText="Location" SortExpression="TenantClassification3" UniqueName="TenantClassification3">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ReportStatus" DataType="System.Byte" HeaderText="Status" SortExpression="ReportStatus" UniqueName="ReportStatus" AllowFiltering="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridNumericColumn Groupable="false" NumericType="Percent" DataFormatString="{0:#%}" DataField="Score" DataType="System.Decimal" HeaderText="Score" SortExpression="Score" UniqueName="Score" ItemStyle-Width="70px" FilterControlWidth="22px">
                        </telerik:GridNumericColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowDragToGroup="True" EnableAlternatingItems="false" EnableRowHoverStyle="true">
                </ClientSettings>
                <ExportSettings ExportOnlyData="true" FileName="MyFile" Excel-Format="Html" OpenInNewWindow="true" HideStructureColumns="true" IgnorePaging="true" />
            </telerik:RadGrid>
 
            <script type="text/javascript">
                function onRequestStart(sender, args) {
                    if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                            args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                            args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                        args.set_enableAjax(false);
                    }
                }
            </script>
 
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>" SelectCommand="SELECT dbo.__FFTenant.TenantID, dbo.__FFTenant.TenantName, dbo.__FFTenant.PartnerID, dbo.__FFTenant.TenantClassification1, dbo.__FFTenant.TenantClassification2, dbo.__FFTenant.TenantClassification3, dbo._FFFrameworkReport.ReportStatus, dbo._FFFrameworkReport.Score FROM dbo._FFFrameworkReport INNER JOIN dbo.__FFTenant ON dbo._FFFrameworkReport.TenantID = dbo.__FFTenant.TenantID WHERE (dbo.__FFTenant.PartnerID = @UserIsPartnerTenantID) ORDER BY dbo.__FFTenant.TenantName">
                <SelectParameters>
                    <asp:SessionParameter Name="UserIsPartnerTenantID" SessionField="UserIsPartnerTenantID" />
                </SelectParameters>
            </asp:SqlDataSource>
        </td>
    </tr>
    <tr>
        <td>
            <asp:HyperLink ID="lnkCompanyReports" CssClass="FFLinkCommand" runat="server"><img src="<%= skinpath %>images/_FFgoback.png" class="FFImgCommand" />Go to the Company Reports Page</asp:HyperLink>
        </td>
    </tr>
</table>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke.Entities.Modules;
using Telerik.Web.UI;
using Revd.Common.Utilities;
using Revd.DataAccess;
 
namespace RevolutionId.Modules.Managers
{
    public partial class CompanyReports_Scoreboard : PortalModuleBase
    {
        public static string skinpath = "";
        protected void Page_Load(object sender, EventArgs e)
        {
           if (!IsPostBack)
           {
               SessionService.UserIsPartnerTenantID = 30;
               skinpath = base.PortalSettings.ActiveTab.SkinPath;
               lnkCompanyReports.NavigateUrl = _DataUtilities.GetURL_General("", "", 0, _DataUtilities.PageNames.CompanyReports);
           }
        }
 
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem gridItem = (GridDataItem)e.Item;
                if (!e.Item.IsInEditMode)
                {
                    int myValue = Convert.ToInt32(DataBinder.Eval(gridItem.DataItem, "ReportStatus"));
                    if (myValue == 0)
                    {
                        gridItem["ReportStatus"].Text = "Work in Progress";
                    }
                    else if (myValue == 1)
                    {
                        gridItem["ReportStatus"].Text = "Completed";
                    }
                    else
                    {
                        gridItem["ReportStatus"].Text = "Don't know";
                    }
                }
            }
        }
 
        protected void RadGrid1_Exporting(object source, Telerik.Web.UI.GridExportingArgs e)
        {
            try
            {
            }
            catch (Exception ex)
            {
                DisplayMessage("Problem occurred. Reason: " + ex.Message);
            }
        }
 
        protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "PerformInsert")
                {
                }
            }
            catch (Exception ex)
            {
                DisplayMessage("Problem occurred. Reason: " + ex.Message);
            }
        }
 
        private void DisplayMessage(string text)
        {
            RadGrid1.Controls.Add(new LiteralControl(text));
        }
    }
}
Daniel
Telerik team
 answered on 12 Apr 2011
1 answer
899 views

I have a data bound radscheduler. For which I have created a timeslotcontextmenu eg. Add Appointment and set to postback.

However, everytime I click on the context menu I get the above error with the following stack trace :
 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: key

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: key]
   System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +44
   System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +7457569
   System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) +16
   Telerik.Web.UI.RadScheduler.ProcessTimeSlotContextMenuItemCommand(SchedulerPostBackEvent postBack) +106
   Telerik.Web.UI.RadScheduler.ProcessPostBackCommand(SchedulerPostBackEvent postBack) +4638
   Telerik.Web.UI.RadScheduler.RaisePostBackEvent(String eventArgument) +108
   Telerik.Web.UI.RadScheduler.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +39
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


All other changes to the schedule work fine (moving dates etc.) but the context menu click just comes up with thie error everytime and I cannot understand why.

Please help!
Toxic
Top achievements
Rank 1
 answered on 12 Apr 2011
6 answers
226 views
Hi,

I want to enable DragToGroup option of Radgrid from Context menu. For this i have added new option in HeaderContextmenu's prerender event. My grid is in UserControl so cant use OnPreRenderComplete page event. 

I have added HeaderContextMenu onitemClick handler to enable DragToGroup option of radGrid, but its not firing. 

protected

 

void HeaderContextMenu_PreRender(object sender, EventArgs e)

 

{

 

RadContextMenu menu = wgEntityList.HeaderContextMenu;

 

 

RadMenuItem item = new RadMenuItem();

 

item.Text =

"Group by text";

 

menu.Items.Add(item);

}

protected

 

void HeaderContextMenu_ItemClick(object sender, RadMenuEventArgs e)

 

{

wgEntityList.ClientSettings.AllowDragToGroup =

true;

 

}


Please help me to get this event fire.

Regards
Devanand Jha




Erik
Top achievements
Rank 2
 answered on 12 Apr 2011
3 answers
318 views
I have a RadGrid with an EditForm (MasterTableView EditMode="EditForms"), whose layout is defined in a FormTemplate under the EditFormSettings tag.  I would like to do some client side processing of data for one of the fields in that FormTemplate, and am trying to figure out how to access the EditForm's data most easily.

Specifically, I have a TextBox that I may append tokenized values to  - so inside the EditForm, there's MyTextField (which is bound to the underlying DataSource for the RadGrid), plus AddToken button and Token dropdown, which are not databound.  User picks a value from the Token dropdown, clicks AddToken, and the text of the selected item in the dropdown is appended to the value in MyTextField.  

I'm trying to figure out what my button and javascript function should look like - I'm figuring it would be easiest to get access to the EditForm's data if there's a client-side RadGrid event I could hook into.  If none is available on click of my custom "Add Token", then maybe at least there's an event available when Edit is clicked to expand my EditForm, so I can get ahold at that time of the item being edited?... Any thoughts?

Thanks!
Shira
Top achievements
Rank 1
 answered on 12 Apr 2011
3 answers
117 views
I am currently working on an ASP.NET AJAX page that is fairly sophisticated (VS 2010 and .NET 4.0 w/ VB.NET).  After several initial criteria are entered on the page and submitted back to the database via AJAX, I then dynamically create sixteen RAD controls in individual PlaceHolders.  Each control might be a RadTextBox, RadComboBox, RadNumericTextBox or a RadDatePicker - depending on what the database tells me to display.  I have this all working fine - initially.  I collect the initial data, hand it back and then display the dynamic fields - very cool through AJAX.

However this page then continues to make several AJAX round trips after these dynamic controls are generated, and the user can enter or select values in these custom controls at any point between these subsequent round trips.  The user can also change the initial data parameters which will then potentially recreate all new and different custom controls.  The only commonality is that there are 16 of these custom fields....

After much reading it appears that my dynamic controls are not surviving the AJAX postbacks, and must be recreated and reset each time.  I believe I may need to store the Control Type, ID and SelectedValue (or Text, or Date) in the ViewState and reinitialize them on each Page_Load, but I am not sure how to go about this.  Specifically:

1) How do I save the value on each control before an AJAX PostBack?
2) Are there best practices to follow for this type of interaction to optimize performance?
3) Any specific examples of this kind of interaction with the Telerik AJAX controls?

Any help or pointers appreciated.
lakshmi
Top achievements
Rank 1
 answered on 12 Apr 2011
9 answers
358 views
I used an example I found in these forums to show the # of files in a directory beside the name of the directory. The example seems to work fine but once I tried to change it around to suit my exact needs, I found some issues.

I wanted the following changes
1. All directories to show # of files within it including subdirectories (no problem, easily done)
2. Setting the paths in the code behind rather than within the html
3. Any change to the files (i.e. upload new file, delete file, move file) will automatically refresh the treeview

Here are the problems I experienced:
- if you set the path in the code behind, the refresh button will not update the # of files in the treeview (but will work if path are set within the html code)
- I tried to use RadFileExplorer1.TreeView.Nodes.Clear(); in the page_load to force a refresh of the treeview (which works) but this had an adverse side effect. After a file delete or file move, the changed file still appears in the grid as if the file wasn't deleted or moved until I pressed the refresh button.

Help?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using Telerik.Web.UI.Widgets;
using System.IO;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //RadFileExplorer1.TreeView.Nodes.Clear();
 
        RadFileExplorer1.Configuration.ViewPaths = new string[] {@"~/Thumbs/"};
        RadFileExplorer1.Configuration.UploadPaths = new string[] { @"~/Thumbs/" };
        RadFileExplorer1.Configuration.DeletePaths = new string[] { @"~/Thumbs/" };
 
        RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(CustomProvider).AssemblyQualifiedName;
    }
 
    public class CustomProvider : FileSystemContentProvider
    {
        public CustomProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
            : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
        { }
 
 
        public override DirectoryItem ResolveRootDirectoryAsTree(string path)
        {
            DirectoryItem originalDir = base.ResolveRootDirectoryAsTree(path);
            string physicalPath = Context.Server.MapPath(path);
 
            List<DirectoryItem> childDirItems = new List<DirectoryItem>();
            foreach (DirectoryItem currentDir in originalDir.Directories)
            {
                string physicalPathChildFile = Context.Server.MapPath(currentDir.FullPath);
                DirectoryItem childDirItem = new DirectoryItem(currentDir.Name + "(" + Directory.GetFiles(physicalPathChildFile, "*.*", SearchOption.AllDirectories).Length + ")",
                                                                currentDir.Location,
                                                                currentDir.FullPath,
                                                                currentDir.Tag,
                                                                currentDir.Permissions,
                                                                currentDir.Files,
                                                                currentDir.Directories
                                                                  );
                childDirItems.Add(childDirItem);
            }
 
 
            DirectoryItem dirItem = new DirectoryItem(originalDir.Name + "(" + Directory.GetFiles(physicalPath, "*.*", SearchOption.AllDirectories).Length + ")",
                                                      originalDir.Location,
                                                      originalDir.FullPath,
                                                      originalDir.Tag,
                                                      originalDir.Permissions,
                                                      originalDir.Files,
                                                     childDirItems.ToArray()
                                                      );
            return dirItem;
        }
 
        public override DirectoryItem ResolveDirectory(string path)
        {
            DirectoryItem originalDir = base.ResolveDirectory(path);
            string physicalPath = Context.Server.MapPath(path);
 
            DirectoryItem dirItem = new DirectoryItem(originalDir.Name + "(" + Directory.GetFiles(physicalPath, "*.*", SearchOption.AllDirectories).Length + ")",
                                                      originalDir.Location,
                                                      originalDir.FullPath,
                                                      originalDir.Tag,
                                                      originalDir.Permissions,
                                                      originalDir.Files,
                                                      originalDir.Directories
                                                      );
            return dirItem;
        }
    }
}

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="Telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="Form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" Height="300px" Width="804px"
        Skin="Forest">
        <Configuration SearchPatterns="*.*"></Configuration>
    </telerik:RadFileExplorer>
    </form>
</body>
</html>
Ed
Top achievements
Rank 1
 answered on 12 Apr 2011
2 answers
169 views
I am building a row button that'll make a duplicate of the row the user clicked.  I want it to then let the user edit the row.  In my particular case I am using the built in popup form to edit the row.

So I have a GridButtonColumn, I catch it in the OnItemCommand event - but how do I initiate the edit on the new row?  Or, bring up the New Row form, loaded with the data from the row I'm copying?

Ron Michael Zettlemoyer
Top achievements
Rank 1
 answered on 12 Apr 2011
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?