Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
756 views
Hi,

A very simple page with a repeater control. each row in the repeater has a button, clicking the button will change the button text to current time. But get js error when click the button after ajaxified the button. the error says "Uncaught TypeError: Cannot read property 'id' of undefined". the full set of code is attached below. can anyone help to have a look? Thanks in advance.

<%@ 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 id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <asp:Repeater ID="rptItems" runat="server">
            <ItemTemplate>
                <asp:Button runat="server" ID="btnButton" Text="show time" OnClick="btnButton_Click" />
            </ItemTemplate>
        </asp:Repeater>
    </div>
    </form>
</body>
</html>

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;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int[] data = { 1, 2 };
            rptItems.DataSource = data;
            rptItems.DataBind();
        }
 
    }
 
    protected void Page_PreRender(object sender, EventArgs e)
    {
        foreach (RepeaterItem item in rptItems.Items)
        {
            var control = (Button)item.FindControl("btnButton");
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(control, control);
        }
    }
 
    protected void btnButton_Click(object sender, EventArgs e)
    {
        (sender as Button).Text = DateTime.Now.ToString();
    }
 
}
Jason Li
Top achievements
Rank 1
 answered on 11 Jun 2013
1 answer
97 views
Let's say I have a column in my grid, "Comments." This is usually a very large string, let's say hundreds of characters. Obviously this doesn't look very good in the grid.

It would be nice to only show the first few characters, and when the user clicks on the cell, a dialog or window would quickly pop up next to the cell, with the contents of the clicked Comments cell displayed inside.

Is there any kind of built-in functionality for this already? If not, is there a solution for this anybody has come up with?

Any help would be appreciated - thank you.
A2H
Top achievements
Rank 1
 answered on 10 Jun 2013
2 answers
165 views
hi telerik,

I want to build a PanelBar with only one vertical scrollbar across the entire bar whenever the total size of content exceeds the height limit. So I just set the ChildGroupHeight property of the root panel item and it works fine. But when clicking one child item which also contains child items, the vertical scrollbar disappears after the child item is expanded. I'm just wondering is this a bug or corrected behavior by design?  if it's by design, how can i build this except using FullExpandedItem ExpandMode approach?

thanks,

roger
roger
Top achievements
Rank 1
 answered on 10 Jun 2013
1 answer
53 views
Attached are two screenshots using the RadGauge and RadChart. When in compatibility mode the gauge is offset but the chart is not effected in the same way. Is this a known issue and is there a way to keep this from happening?
John
Top achievements
Rank 1
 answered on 10 Jun 2013
1 answer
272 views
Hi, I am using load on demand with radcombobox. I have my OnItemsRequest handler and everything fine except for one little detail that I dont know how to overcome. When there is a postback to the server, the radcombobox items are lost which might make sense as they are kept in client side to improve performance, as it is stated here (from the following link)
http://www.telerik.com/community/forums/aspnet-ajax/combobox/radcombobox-items-disappearing-after-postback.aspx

"Hi Rajeev,

Is it possible that you are loading the items on demand (via callback, in the ItemsRequested event). If this is the case, then you should keep into account that the items added this way persist only at the client-side. This is done for a better performance. These items will disappear after postback. If you need the items to persist at the server, you need to add them outside the ItemsRequested event.  "

I would like to know how I could persist these items so that after the postback they are still there.
msigman
Top achievements
Rank 2
 answered on 10 Jun 2013
2 answers
175 views
Trying to move rows between two grids all client-side.

This is what I've been trying. I get the correct number of rows in the second grid, but no data.

function onMoveAssets() {

    var radGrid = $find('<%= AssetGrid.ClientID %>');

    var grid2 = $find('<%= SelectedAssets.ClientID %>').get_masterTableView();

    var selectedItems = radGrid.get_masterTableView().get_selectedItems();

    grid2.set_dataSource(selectedItems);

    grid2.dataBind();

}

George Handlin
Top achievements
Rank 1
 answered on 10 Jun 2013
6 answers
386 views
Hi friends, I am having different user controls that load up grid views form SPes on the dashboard. I am using this control to display all such widgets on the dashboard page. Now (most likely) as this control has been built with this scenario in mind, would it be possible to load each widget asynchronously on the dashboard ?

Thanks,
-Aarsh
Slav
Telerik team
 answered on 10 Jun 2013
1 answer
129 views
I'm working on a Dot Net 4.0 C# web app.  I already have a RadEditor in there with a keydown event handler to detect text changes (for queries when I hit the cancel button.)  Everything is working fine.  

I'm thinking about adding a mouseover event handler as well but I'm looking at your documentation here (http://www.telerik.com/help/aspnet-ajax/editor-attacheventhandler.html).

I was wondering what you meant by 'depending on the browser'?  Is this page up to date?  (Just tried.  Can't seem to get it to work.)

(I should also mention that my current declaration looks like this:     editor.attachEventHandler("keydown", function (sender, e)
keydown, not onkeydown, yet this part seems to be working perfectly.)
Ivaylo
Telerik team
 answered on 10 Jun 2013
0 answers
330 views
Hi All,

We are using a telerik datepicker control, we have got a "Stack overflow" issue  when setting the date with "set_selectedDate"  in IE8.

Is there any other way to fix this issue. Here, is my javascript code.

And, please help me out over this

var expiraryDateToSet = new Date(Date.parse(formatedEffectiveDate));
expiraryDateToSet.setFullYear(expiraryDateToSet.getFullYear() + parseFloat(durationYear.value));
durationYearsHidden.value = durationYear.value;                           
datePickerExpirary.set_selectedDate(expiraryDateToSet);
durationMonthsHidden.value = '';

Vinay
Top achievements
Rank 1
 asked on 10 Jun 2013
1 answer
126 views
Hi there,

I am using the RadTreeView for a vertical navigation (similar to the one on http://demos.telerik.com/aspnet-ajax/treeview/examples/overview/defaultcs.aspx). I notice that on that page the current page continues to be selected when you traverse through the Tree. I am trying to achieve the same result, but currently when I traverse my tree, it deselects my current node.

Is there a setting I have missed?

<telerik:RadTreeView ID="RadTreeView1" runat="server" DataSourceID="menu" Skin="custom" OnClientNodeClicked="ClientNodeClicked" MultipleSelect="true" OnClientLoad="ParentHighlight"></telerik:RadTreeView>
<telerik:RadSiteMapDataSource ID="menu" runat="server" SiteMapFile="site.sitemap" ShowStartingNode="false" />

Boyan Dimitrov
Telerik team
 answered on 10 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?