Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
90 views
Is there any way to replace a text box in edit mode with a drop down list?

Thanks,
Mark
Princy
Top achievements
Rank 2
 answered on 05 Dec 2013
6 answers
241 views
Hi Team,


       I'm facing with user control edit form js call to parent page js function and ajax error. I'm try to do the sample like User Control Edit Form. I wrote the js function in user control and attach to button onclientclick. When i click the button on user control error said function is not have. And then i move my js function to default.aspx and click it work. At the same time i put ajax manager on my user control, when i click cancel button it show error "Error: Sys.WebForms.PageRequestManagerServerErrorException: A control with ID 'RadGrid1$ctl00$ctl24$EditFormControl$_radAjManagers' could not be found for the trigger in UpdatePanel 'RadGrid1$ctl00$ctl24$EditFormControl$_lblstatusPanel'." But cancel button is not fire to any ajax event. I did simple rad grid edit form and call to user control. I can't understand what wrong my code.

      So i tried to look live demo sample and i modified code at "C:\Program Files\Telerik\RadControls for ASP.NET AJAX Q3 2011 SP1\Live Demos\Grid\Examples\DataEditing\UserControlEditForm". If i comment this

protected void RadGrid1_PreRender(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.RadGrid1.MasterTableView.Items[1].Edit = true;
                this.RadGrid1.MasterTableView.Rebind();
            }
        }
does not work and same as my sample code.

          I hope someone can help to me this problem.

Sample Code.

Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<!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>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form runat="server" id="mainForm" method="post">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            //Put your JavaScript code here.
            function fnUpdate() {
                alert('Default.aspx');
                return false;
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
     //If i didn't comment this one when i click cancel i got error
      <
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AllowPaging="True"
        CssClass="RadGrid" AutoGenerateColumns="False" ShowStatusBar="True" OnNeedDataSource="RadGrid1_NeedDataSource"
        PageSize="10" CellSpacing="0">
        <MasterTableView DataKeyNames="row_id" EditMode="PopUp" HorizontalAlign="Left">
            <CommandItemSettings />
            <Columns>
                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn DataField="row_id" DataType="System.Int32" FilterControlAltText="Filter row_id column"
                    HeaderText="Row" ReadOnly="True" SortExpression="row_id" UniqueName="row_id">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="description" FilterControlAltText="Filter description column"
                    HeaderText="Description" SortExpression="description" UniqueName="description">
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn DataField="status" DataType="System.Boolean" FilterControlAltText="Filter status column"
                    HeaderText="Status" SortExpression="status" UniqueName="status">
                </telerik:GridCheckBoxColumn>
            </Columns>
            <EditFormSettings UserControlName="control/WebUserControl.ascx" EditFormType="WebUserControl"
                PopUpSettings-Modal="true" CaptionFormatString="Current Editing row no. {0}"
                CaptionDataField="row_id">
                <EditColumn UniqueName="EditCommandColumn">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="SELECT [row_id], [description], [status] FROM [tbl_sample]"></asp:SqlDataSource>
    </form>
</body>
</html>

Default.cs

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
using System.Data.SqlClient;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
 
    private static DataTable GetDataTable(string queryString)
    {
        String ConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection MySqlConnection = new SqlConnection(ConnString);
        SqlDataAdapter MySqlDataAdapter = new SqlDataAdapter();
        MySqlDataAdapter.SelectCommand = new SqlCommand(queryString, MySqlConnection);
 
        DataTable myDataTable = new DataTable();
        MySqlConnection.Open();
        try
        {
            MySqlDataAdapter.Fill(myDataTable);
        }
        finally
        {
            MySqlConnection.Close();
        }
 
        return myDataTable;
    }
 
    private DataTable Employees
    {
        get
        {
            object obj = this.Session["_tbl"];
            if ((!(obj == null)))
            {
                return ((DataTable)(obj));
            }
            DataTable myDataTable = new DataTable();
            myDataTable = GetDataTable("SELECT * FROM tbl_sample");
            this.Session["_tbl"] = myDataTable;
            return myDataTable;
        }
    }
 
    protected void RadGrid1_PreRender(object sender, System.EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.RadGrid1.MasterTableView.Items[1].Edit = true;
            this.RadGrid1.MasterTableView.Rebind();
        }
    }
 
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        this.RadGrid1.DataSource = this.Employees;
        this.Employees.PrimaryKey = new DataColumn[] { this.Employees.Columns["row_id"] };
    }
 
    protected void RadGrid1_EditCommand(object sender, GridCommandEventArgs e)
    {       
    }
}

User Control.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs"
    Inherits="control_WebUserControl" %>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript" language="javascript">
        //Put your JavaScript code here.
        function fnUpdate() {
            alert('Control');// should be call this function
        }
    </script>
</telerik:RadCodeBlock>
 
<telerik:RadAjaxManager ID="_radAjManagers" runat="server" OnAjaxRequest="_radAjManager_AjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="_radAjManagers" EventName="OnAjaxRequest">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="_lblstatus" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<div>
    <asp:Label runat="server" ID="_lblstatus"></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Description" ) %>'></asp:TextBox>
    <br />
    <asp:Button ID="btnInsert" Text="Insert" runat="server" OnClientClick="javascript:fnUpdate();return false;">
    </asp:Button>
    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
        CommandName="Cancel"></asp:Button>
</div>

User Control.ascx.cs

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
 
public partial class control_WebUserControl : System.Web.UI.UserControl
{
    private object _dataItem = null;
 
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    //protected void Button1_Command(object sender, CommandEventArgs e)
    //{
    //    //
    //}
 
    protected void _radAjManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        _lblstatus.Text = "Done....";
    }
 
    public object DataItem
    {
        get
        {
            return this._dataItem;
        }
        set
        {
            this._dataItem = value;
        }
    }
}

Sample Code Link : Sample
Regards,
Alex
Eric
Top achievements
Rank 1
 answered on 04 Dec 2013
2 answers
136 views
Hello All

I am trying to get the event TreeView1_NodeClick to fire.  When I click to select a single node there is no problem, but when I intend to select multiple nodes by clicking and holding ctrl or shift keys the event won't fire!

Is there any other event similar to achieve this?

Regards
nfigueroa
Top achievements
Rank 1
 answered on 04 Dec 2013
3 answers
81 views
Hi,

Is it possible to navigate a Multi Month View Calendar without doing a postback?

Best Regards,
Christian
Viktor Tachev
Telerik team
 answered on 04 Dec 2013
1 answer
60 views
radwindow hangs in the radajaxmanag, radajaxmanager hangs

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" CssClass="ajaxloader" runat="server" InitialDelayTime="0" Transparency="25" MinDisplayTime="0" BackColor="#474747" Skin="Metro">
</telerik:RadAjaxLoadingPanel>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <AjaxSettings
       
          <telerik:AjaxSetting AjaxControlID="txtMiktar">
              <UpdatedControls>
                  <telerik:AjaxUpdatedControl ControlID="txtTutar" LoadingPanelID="RadAjaxLoadingPanel1" />
              </UpdatedControls>
          </telerik:AjaxSetting>
 
          <telerik:AjaxSetting AjaxControlID="txtBirimFiyat">
              <UpdatedControls>
                  <telerik:AjaxUpdatedControl ControlID="txtTutar" LoadingPanelID="RadAjaxLoadingPanel1" />
              </UpdatedControls>
          </telerik:AjaxSetting>
 
         <telerik:AjaxSetting AjaxControlID="txtTutar">
              <UpdatedControls>
                  <telerik:AjaxUpdatedControl ControlID="txtBirimFiyat" LoadingPanelID="RadAjaxLoadingPanel1" />
              </UpdatedControls>
          </telerik:AjaxSetting>          
  
   </AjaxSettings>
  </telerik:RadAjaxManager>

img : radajaxmanager hangs

<td>
                       <span>
                           <telerik:RadNumericTextBox ID="txtMiktar" runat="server" NumberFormat-DecimalDigits="3" AutoPostBack="true" OnTextChanged="txtMiktar_TextChanged" Culture="Turkish (Turkey)" MinValue="0" LabelCssClass="" Width="70px" Value="0"></telerik:RadNumericTextBox>
                       </span>
                   </td>
                   <td>
                       <span>
                           <telerik:RadTextBox ID="txtBirimKod" runat="server" Enabled="false" Width="80px"></telerik:RadTextBox>
                       </span>
                   </td>
 
                   <td>
                       <span>
                           <telerik:RadNumericTextBox ID="txtBirimFiyat" NumberFormat-DecimalDigits="4" AutoPostBack="true" OnTextChanged="txtBirimFiyat_TextChanged" runat="server" Culture="Turkish (Turkey)" MinValue="0" LabelCssClass="" Width="70px" Value="0"></telerik:RadNumericTextBox>
                       </span>
                   </td>
                   <td>
                       <span>
                           <telerik:RadNumericTextBox ID="txtTutar" NumberFormat-DecimalDigits="4" AutoPostBack="true" OnTextChanged="txtTutar_TextChanged" runat="server" Culture="Turkish (Turkey)" MinValue="0" LabelCssClass="" Width="70px" Value="0"></telerik:RadNumericTextBox>
                           <telerik:RadTextBox ID="txtGuncelleId" runat="server" Visible="false" Text=""></telerik:RadTextBox>
 
 
                       </span>
                   </td>



What is the problem here









Viktor Tachev
Telerik team
 answered on 04 Dec 2013
6 answers
144 views

I tried to open RadWindow from RadTileList in OnClientTileClicked event.

RadWindow is opening, however, then it is closed and result shows in same window as RadTileList

 

function OnClientTileClicked(tileList, args) {
            var tile = args.get_tile();
            var url = args.get_oldValue();
 
            //confirm navigation if url has been specified
            if (url !== "") {
                var oManager = GetRadWindowManager();
                var oWnd = oManager.getWindowByName("RadWindow1");
                if (oWnd === null) {
                    oWnd = oManager.open(url, "RadWindow1");
                }
                else
                {
                    oWnd.setUrl(url);
                }
                args.set_cancel(true);
            }
            //request navigation url to be set
            else {
                tile.set_navigateUrl(prompt("No url specified. Please enter a navigation url:"));
            }
        }
 
        function RadWindowOnClientClose(sender, args) {
            if (args.get_argument() !== null) {
            }
        }

 

 

   <telerik:RadTileList ID="RadTileList1" runat="server" Skin="Office2007" Width="930px" Height="500px" OnClientTileClicked="OnClientTileClicked" AutoPostBack="false" SelectionMode="Single" ScrollingMode="Auto">
        <Groups>
            <telerik:TileGroup>
                <telerik:RadTextTile runat="server" NavigateUrl="/Kodes/Algemeen/Komplexen.aspx" Target="_self"
                    Title-ImageUrl="/images/filetypes/access.gif"
                    Title-Text="Wat is gewijzigd" Text="Hier komen de wijzigingen. Dit is een test van een heel lange omschrijving." Shape="Wide">
                    <Badge Value="22" />
                </telerik:RadTextTile>
                <telerik:RadImageAndTextTile runat="server"
                    ImageUrl="~/Images/FileTypes/Powerpoint24.png"
                    Title-ImageUrl="/images/filetypes/access.gif"
                    Title-Text="Gewijzigde prioriteiten kandidaat-huurders" Text="27 aanpassingen" Shape="Wide">
                </telerik:RadImageAndTextTile>
                <telerik:RadTextTile ID="RadTextTile1" runat="server"
                    Title-Text="Gewijzigde prioriteiten kandidaat-huurders" Text="27 aanpassingen">
                </telerik:RadTextTile>
</telerik:TileGroup>
        </Groups>
         
    </telerik:RadTileList>


Any idea ?

Best regards,
Guy Van Dyck
Guynius Software

 

 

Guy
Top achievements
Rank 1
 answered on 04 Dec 2013
2 answers
106 views

This article describes what to do to fix IE11 when you use the RadCompression and .browser file implementation of Hidden field viewstate compression. When we were fixing this issue we found that the solution doesn't work for certain builds/versions of IE11, specifically the version shipped on touch devices. The userAgent string has additional attributes that interrupt the string from matching the RegEx in the IE11 browser node. We modified the expression to the following and it successfully corrected our issue on touch and non-touch versions of IE:

<browser id="IE11" parentID="Mozilla">

<identification>

<userAgent match="Trident\/7.0;(?:(?: Touch;)?(?: \w*;)?)? rv:(?:(?'major'\d+)(\.(?'minor'\d+)?)(?'letters'\w*))(?'extra'[^)]*)" />

<userAgent nonMatch="IEMobile" />

</identification>

Hope this helps anyone that may run into that scenario.

Misho
Telerik team
 answered on 04 Dec 2013
4 answers
129 views
Hi,

I am working on Telerik AJAX 2009 Q1.
I  Need to hide Week No. in RadDatePicker.
Can any one pls suggest me.
Its urgent.
Thanks in Advance.

Natarajan N
Sam
Top achievements
Rank 1
 answered on 04 Dec 2013
9 answers
403 views
With IE9's "Disable script debugging" options unticked (e.g., debugging enabled), I'm getting "SCRIPT16385: Not implemented" and "SCRIPT5009: 'Telerik' is undefined" after upgrading to 2013.3.1114.40. I even did a small test site that only had one basic RadGrid and got the same errors (I tested on multiple IE9 workstations with the same results. So, from the same workstations/IE9 browsers I went to Telerik's demo site (http://demos.telerik.com/aspnet-ajax/) and was riddled with bunch of similar errors.

Is anyone else experiencing this? Any insight on this would be appreciated.
Kostadin
Telerik team
 answered on 04 Dec 2013
1 answer
108 views
hi.
I want the sorting to sort in descending order first rather than ascending which is the default behaviour.
Princy
Top achievements
Rank 2
 answered on 04 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?