Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
101 views
Hi,
I found a forgotten localization in the file "RadEditor.Dialogs.fr-FR.resx" in the RadControls for ASP.NET AJAX Q2 2010.
At line [ImageEditor_Save] the value was "Save" instead of "Enregistrer".

That's all, great work anyway.
Rumen
Telerik team
 answered on 28 Jan 2011
10 answers
1.4K+ views
Before upgrading to ASP.NET AJAX  from ASP.NET the rad grid grouping worked. Since upgrading however, as soon as a drag and drop grouping is preformed we are greeted with this error:

Unable to cast object of type 'Telerik.Web.UI.RadGrid' to type 'Telerik.Web.UI.GridTableView'.

I created a test page where I bound test data to a newly add rad grid and enabled grouping and it still blows up. 

I tried looking through the examples, but they either leave much to be desired or I followed them correctly and something is still not quiet right. Any ideas?

Thenmozhi
Top achievements
Rank 1
 answered on 28 Jan 2011
1 answer
364 views
Dear Telerik Team,

First, I would like to point out that the support job you do all over the year is great, and I think that plenty of developpers are really thankfull but don't say it (enough). Your job is really helpfull for us poor developpers trying to use your controls.

This said, let's process my problem :)

I have something really similar to the following code. I would like to change the title of the RadWindow "FollowUpDialog" from FollowUp.aspx. I would like to do this depeding on a server-side checked condition.

Software.aspx
<%@ Page Language="C#" MasterPageFile="~/Pages/Master/MasterPage.master" AutoEventWireup="true"
    CodeFile="Software.aspx.cs" Inherits="Pages_Projects_Software" Title="Software" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadScriptBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
         
            function ShowFolloUpForm(id) {
                window.radopen("FollowUp.aspx?IdProject=" + id, "FollowUpDialog");
                return false;
            }
  
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadAjaxManager ID="RessourceManager" runat="server" OnAjaxRequest="RessourceManager_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RessourceManager">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridSoftware" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGridSoftware">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridSoftware" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadWindowManager ID="RadWindowManagerSoftware" runat="server" EnableEmbeddedSkins="false">
        <Windows>
            <telerik:RadWindow ID="EditSoftware" runat="server" Title="" Height="500px" Width="650px"
                Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Behaviors="None"
                Modal="true" VisibleStatusbar="false" />
        <telerik:RadWindow ID="FollowUpDialog" runat="server" Title="THIS IS A BAD TITLE"
                Height="300px" Width="500px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                Behaviors="None" Modal="true" VisibleStatusbar="false" />
        </Windows>
    </telerik:RadWindowManager>
    <fieldset>
        <legend>Liste des Softwares</legend>
         
        <telerik:RadGrid ID="RadGridSoftware" runat="server" AutoGenerateColumns="False"
            DataSourceID="SqlDataSourceSoftware" GridLines="None" ShowFooter="True" AllowSorting="True"
            EnableLinqExpressions="False" OnItemCreated="RadGridSoftware_ItemCreated" OnItemCommand="RadGridSoftware_ItemCommand"
            EnableEmbeddedSkins="false">
            <MasterTableView DataKeyNames="IdSoftware" DataSourceID="SqlDataSourceSoftware"
                ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" NoMasterRecordsText="Pas de Software"
                HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top" Name="Master">
                <CommandItemTemplate>
                    <a href="#" onclick="return ShowSoftwareInsertForm();">
                        <img alt="add" src="../../Images/add.gif" />Ajouter un Software</a>
                </CommandItemTemplate>
                [... NestedViewTemplate with another RadGrid on it but it's not important ...]
                <ExpandCollapseColumn Visible="True">
                </ExpandCollapseColumn>
                <Columns>
                <telerik:GridTemplateColumn UniqueName="pTemplateFollowUpColumn">
                  <ItemStyle Width="20px" />
                                        <ItemTemplate>
                                            <asp:ImageButton ID="btnFollowUp" CssClass="cmdCursor" runat="server" ImageUrl="~/Images/note_accept.gif"
                                                AlternateText='Follow Up / View Follow Up'
                                                Text="Follow Up" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </fieldset>
    <asp:SqlDataSource ID="SqlDataSourceSoftware" runat="server" ConnectionString="..."
        SelectCommand="LIST_Software" SelectCommandType="StoredProcedure">
    </asp:SqlDataSource>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" EnableEmbeddedSkins="false">
    </telerik:RadAjaxLoadingPanel>
</asp:Content>

Software.aspx.cs
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
public partial class Pages_Projects_Software : Page
{
    #region Private et Public Properties, Enum et Constantes
 
    /// <summary>
    /// Gets or sets the id Project.
    /// </summary>
    /// <value>The id Project.</value>
    protected Int32 IdProject { get; set; }
   
    #endregion 

    #region Cycle de vie et Evenements 
 
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e)
    {

    } 
 
    /// <summary>
    /// Handles the ItemDataBound event of the RadGridProjectNested control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
    protected void RadGridProjectNested_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem) e.Item;
            IdProject = (int)item.OwnerTableView.DataKeyValues[item.ItemIndex]["IdProject"];
            ImageButton FollowUp = (ImageButton)item.FindControl("btnFollowUp");
            FollowUp.Attributes["onclick"] = String.Format("return ShowFollowUpForm('{0}');", IdProject);
            [...]
        }
    }
    #endregion 
}

FollowUp.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Master/MasterPage2.master"
    AutoEventWireup="true" CodeFile="FollowUp.aspx.cs" Inherits="Pages_Projects_FollowUp" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow)
                    oWindow = window.radWindow;
                else if (window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;
                return oWindow;
            }
 
            function CloseWindow() {
                GetRadWindow().Close();
            }
 
        </script>
 
    </telerik:RadCodeBlock>
    <p>POC</p>
    <asp:Button ID="btnClose runat="server" Text="Close the window" OnClientClick="CloseWindow();" />
</asp:Content>

FollowUp.aspx.cs
using System;
using System.Linq;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
/// <summary>
///
/// </summary>
public partial class Pages_Projects_FollowUp : System.Web.UI.Page
{
 
 
    #region Cycle de vie et Evenements
 
        /// <summary>
        /// Déclenche l'événement <see cref="E:System.Web.UI.Control.Init"/> pour initialiser la page.
        /// </summary>
        /// <param name="e"><see cref="T:System.EventArgs"/> qui contient les données d'événement.</param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
 
            // >>> Let's change the RadWindow title. In my exemple, I check if there is a QueryString particular value. If it's true, then I change the RadWindow Title.
            // FollowUpDialog.Title = "This is a good title";
 
        }
 
 
    #endregion
     
}
Sébastien
Top achievements
Rank 2
 answered on 28 Jan 2011
1 answer
146 views
Hi all!

I found a strange behavior here in IE (Works fine with Chrome). When putting a table inside a LinkButton, the row selection doesn't work inside the table("inside table"), but clicking outside the table works ("outside table")..

Code in ItemTemplate:
<asp:LinkButton ID="LinkButton3" D="SelectButton" runat="server" CommandName="Select" CausesValidation="False">
    outside table
    <table>
        <tr>
            <td>inside</td>
            <td>table </td>
        </tr>
    </table>
</asp:LinkButton>
Does anybody have a solution or a workaround?

Thanks!
Greetings, Matthias

Radoslav
Telerik team
 answered on 28 Jan 2011
1 answer
156 views
I have a grid with an edit form that has a radpanelbar implemented.  When I go into edit mode, I am trying to set the data in a textbox to its proper value.

Here is the code I am using (found this while searching):

 

 

protected void EmpGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
  
if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
   {
     
GridEditFormItem gditem = e.Item as GridEditFormItem;
     
RadPanelBar RadPanelBar1 = gditem.FindControl("RadPanelBar1") as RadPanelBar;
     
RadPanelItem panelItem1 = (RadPanelItem)RadPanelBar1.FindItemByText("Forwarding Info");
     
TextBox txtForwardCompany = panelItem1.FindControl("txtForwardCompany") as TextBox;
      txtForwardCompany.Text = (gditem.DataItem
as DataRowView)["EmpForwardCompany"].ToString();
  
}
}

 

The problem is that (gditem.DataItem as DataRowView) returns null.  The gditem.DataItem object is populated, it apparently can't be cast to a DataRowView.  Any thoughts on what I'm doing wrong here?

Thanks in advance

Iana Tsolova
Telerik team
 answered on 28 Jan 2011
1 answer
65 views
Hi,
I Have a radgrid with master and detail table.
Each table has sqldatasource populating data from stored procedure.
A note with sqlprofiler that when I expand first time 1 row from master table
the stored procedure that populate details grid is called n times that n is number of rows in master table.
After that everything is OK. When I expand one row, stored procedure is called once. The master  and details grid has 1 column with Aggregate="Sum".
My question is how can i prevent this first load time madness? 
Marin
Telerik team
 answered on 28 Jan 2011
3 answers
102 views
I have an AjaManager in a master page and a content web form that has an AjaxManagerProxy,
i set the AjaxManagerProxy to AJAXify the RadGrid, but it still causing postback in every action.

Could something make the AjaxManager not work correctly that i should check?

Thank you.
George
Top achievements
Rank 1
 answered on 28 Jan 2011
9 answers
194 views
How do I define a dropdown column for a RadGrid where I just have a predefined set of values (ideally just in the aspx page).

eg. I have a dataField = "Type" and it only the following possible values
"General" = 0
"Special" = 1
"Other" = 2

So I want a ddl that shows the text of those three options with the value linked to the Type field in my underlying datasource
Veli
Telerik team
 answered on 28 Jan 2011
3 answers
128 views
Hi

I'm working with the scheduler and the advanced insert edit form.

I have the need to customize the Sql DataSource INSERT statement attached to my scheduler named RadScheduler1

First up I located the RadScheduler1_AppointmentInsert event.

In there I am able to set the data source InsertCommand like this.

SqlDataSource1.InsertCommand = @"INSERT INTO [Activity] (

etc..

And then execute

SqlDataSource1.Insert();

So far so good.

However, I found that I now need to manually read all of the Advanced Form input boxes to satisfy the insert statement. That is, they are not longer collected for me. A hassle but not a show stopper.

Problem is how to I read the inputs on the advanced form from the code behind?

For example. Using Firebug, I could see that the Start Date text box is named...

RadScheduler1_Form_StartDate_dateInput_text

This object does not exist in the code behind.  How do I read it?
Peter
Telerik team
 answered on 28 Jan 2011
1 answer
85 views
Hi,

I have a repeater list with two links in each row.

I have a radwindow manager.

If I click on one of the links, the rad window pops up as per normal.
Without closing the current popup, if I then click on another link, the new window opens but the position defaults to top left (0,0) and the window loses it offset element.

Please could you advise - I have included the javascript which gets called below. The a href links which call this code are:
<a href="#" onclick="openRadWindow('11', 'Mr. Benjamin White', '1', ' ', ' ', ' ', ' ', '1/MzOBjfbqkF-6dOtzU4dnlVCR3DkkRp0XvTyoiwwKljQ','9','19/01/2011,21/01/2011,22/01/2011','crewbook@gcdemos3.co.uk','07983633674','2'); return false;">Edit</a>
<a href="#" onclick="openQVWindow('11'); return false;">Mr. Benjamin White</a>

There can be any number of these hrefs, each time one is clicked I wish the contents of the pop up window to be refreshed and the position to stay in the same place.

I have two javascript functions as I need to open the windows in two different sizes.

Thanks.

<script type="text/javascript">
            function openRadWindow(EngID, EngName, EngJobSkillID, ClientInviteSentOn, ClientConfirmationSentOn, EngineerInviteResponseOn, EngineerConfirmationResponseOn, GoogleSessionToken, JobID, BookedDatesString, EngEmailAddress, EngMobile, SubscriptionType) {
                var InternalJobRef = $("[id$='_lblJobTitle_Ref']").html();
                var JobTitle = $("[id$='_lblJobTitle']").html();
                var oWnda = radopen("DialogEditResourceBooking.aspx?engID=" + EngID + "&EngName=" + EngName + "&EngJobSkillID=" + EngJobSkillID + "&ClientInviteSentOn=" + ClientInviteSentOn + "&ClientConfirmationSentOn=" + ClientConfirmationSentOn + "&EngineerInviteResponseOn=" + EngineerInviteResponseOn + "&EngineerConfirmationResponseOn=" + EngineerConfirmationResponseOn + "&GoogleSessionToken=" + GoogleSessionToken + "&JobID=" + JobID + "&BookedDates=" + BookedDatesString + "&JobTitle=" + JobTitle + "&InternalJobRef=" + InternalJobRef + "&EngEmailAddress=" + EngEmailAddress + "&EngMobile=" + EngMobile + "&SubscriptionType=" + SubscriptionType, "RadWindow1");
                oWnda.setSize(430, 400);
                oWnda.set_offsetElementID($("#<%=refreshResultsGrid.ClientID %>").attr('id'));
            }
            function openQVWindow(EngID) {
                var oWndb = radopen("DialogQuickViewEngineer.aspx?engID=" + EngID, "RadWindow1");
                oWndb.setSize(550, 650);
                oWndb.set_offsetElementID($("#<%=refreshResultsGrid.ClientID %>").attr('id'));
            }
        </script>
Georgi Tunev
Telerik team
 answered on 28 Jan 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?