Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
281 views
Hi There,

I have a repeater control that outputs two RadDatePickers per row as shown below.

<asp:Repeater ID="rep_mediaassetbursts" runat="server" DataSourceID="ods_mediaassetbursts" OnItemDataBound="rep_mediaassetbursts_ItemDataBound"> 
            <HeaderTemplate> 
                <table> 
                <tr> 
                <th>Bursts</th> 
                <th>Value</th> 
                <th>Start Date</th> 
                <th>End Date</th> 
                </tr> 
            </HeaderTemplate> 
            <ItemTemplate> 
                <tr> 
                <td><asp:Label ID="burstNumber" runat="server" Visible='true' ></asp:Label></td> 
                <td><telerik:RadNumericTextBox ID="MediaAssetBurstValue" runat="server"  DbValue='<%# Bind("investment") %>'  MinValue='0' Width="75px" DataType="System.Int32" Type="Currency"  ><NumberFormat DecimalDigits="0"  /><EnabledStyle HorizontalAlign="Right" /></telerik:RadNumericTextBox></td> 
                <td><telerik:RadDatePicker ID="BurstStartDate" runat="server"> 
                    </telerik:RadDatePicker><asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="BurstStartDate" 
                ErrorMessage="Enter a date!" Display="Dynamic"></asp:RequiredFieldValidator></td> 
                <td><telerik:RadDatePicker ID="BurstEndDate" runat="server"   ></telerik:RadDatePicker><asp:RequiredFieldValidator runat="server" ID="Requiredfieldvalidator2" ControlToValidate="BurstEndDate" 
                ErrorMessage="Enter a date!" Display="Dynamic"></asp:RequiredFieldValidator><asp:CompareValidator ID="dateCompareValidator" runat="server" ControlToValidate="BurstEndDate" 
                ControlToCompare="BurstStartDate" Operator="GreaterThanEqual" Type="Date" ErrorMessage="The second date must be after the first one." Display="Dynamic"></asp:CompareValidator> 
                <asp:Label runat="server" ID="datevalue"></asp:Label> 
                </td> 
                </tr> 
            </ItemTemplate> 
            <FooterTemplate> 
                <tr> 
                <td></td> 
                <td> 
                <telerik:RadNumericTextBox ID="burstTotalValue" Type="Currency" runat="server"  Value='0'  MinValue='0' Width="75px" DataType="System.Int32" ReadOnly="true"  > 
                <NumberFormat DecimalDigits="0"  /> 
                <ReadOnlyStyle BorderStyle="none" HorizontalAlign="Right" /> 
                </telerik:RadNumericTextBox></td> 
                <td colspan="2"><asp:CompareValidator ID="burstTotalValueCheck" runat="server" 
                    ErrorMessage="Burst Totals must match the total investment for the assset" ControlToValidate="burstTotalValue" Type="Integer"></asp:CompareValidator></td> 
                </tr> 
                </table> 
            </FooterTemplate> 
            </asp:Repeater> 

I want to associate a javascript function to the OnDateSelected event for each of the RadDatePickers so that i can work out the number of weeks between the dates and display the value in the "datevalue" label. 

I am aware of the standard paramaters that get passed to the javascript function that you assign to the OnDataSelected property, but my problem is from within that function how can I access the other RadDatePicker and also the label.

If I was able to make OnDateSelected take extra paramaters i could pass into it the client id for the other RadDatePicker and the label.

I am looking for any suggested approaches.

Thanks in advance
Jason
Mahtab
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
124 views
I am using Telerik ajax controls in VS2010 asp.net web project.
I am only targetting IE v8 browser.

When I encounter server side code exception, I get an error dialog box "There was an error in the call back."

When I click okay, nothing happens at the server side and code stops executing.

In this web application, there is no try catch exception handling any where. All the exception bubble up to Application_Error in global.asax.
In this specific case, how can I bubble up the exception to Global.asax?

Please help.

Thanks
Slav
Telerik team
 answered on 07 Nov 2012
2 answers
244 views
Hi All,

After installing the new version of editor (Telerik.Web.UI, Version=2012.2.912.40) hoping to fix some of the formatting issues I seem to have introduced more formatting issues. The problem is that if I type some text and try to change the font it does not change at all. When switching to HTML view I see following which appears to be properly formatted and all:
<span style="font-family: Courier New;">dfasdf asdf asdf asdf</span>

I have defined the editor as following:
<telerik:RadEditor runat="server" ID="richText" EditModes="Design" ToolsFile="EditorTools.xml" ContentAreaMode="Div" ContentFilters="ConvertFontToSpan,ConvertToXhtml,ConvertCharactersToEntities,IndentHTMLContent" StripFormattingOptions="All" Width="935px">
</telerik:RadEditor>

When inspecting html code using F12 Developer Tools I noticed that the content is still using FONT tag:
<FONT face="Courier New">dfasdf asdf asdf asdf</FONT>

Can anyone advise on this behavior? Has anything changed or have I missed anything?

Thanks

PS: I am on Win7 and IE9. Also see code discrepancy in the screenshot of the F12 tools
Aleksey
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
67 views
Hi to all,
It's first time to use RadUpload control, I followed tutorial.
And now I would use this control in "insert form":

Insert several information and I attach 2 files (for example) then I submit my informations, it may be upload 2 files and then send my information.

How can I intercept "All Uploaded File event"?

Plamen
Telerik team
 answered on 07 Nov 2012
3 answers
72 views
Hi,

I use RadDock panels to give me a panel with a title bar.  Worked fine till Q3 now they all seem to float to the left.  Before they sat where they were put on the page.

Please could you advise me on any changes made between Q2 and Q3 so that I can get a work around for this problem.

Regards,

Jon
Jon
Top achievements
Rank 1
 answered on 07 Nov 2012
1 answer
103 views
 HI Support Team,

I Have Implemented The following gauge. I have Intialised the Gauge Ranges and there is no property to name the gauge range so that i can give from and to values from code behind. there is no online demo too for the alternative.


<div class="GuageBGImage">
                                                            <telerik:RadRadialGauge runat="server" ID="radTestDesign" CssClass="GuagePosition">
                                                                <Pointer Value="0" Color="#000000">
                                                                </Pointer>
                                                                <Scale Min="0" Max="100" MajorUnit="20" MinorUnit="5">
                                                                    <MajorTicks Size="5" Color="#777777" />
                                                                    <MinorTicks Size="2" Color="#777777" />
                                                                    <Labels Position="Outside" Color="#000000" Font="bold 11px Arial,Verdana,Tahoma" />
                                                                    <Ranges>
                                                                        <telerik:GaugeRange />
                                                                        <telerik:GaugeRange />
                                                                        <telerik:GaugeRange />
                                                                    </Ranges>
                                                                </Scale>
                                                            </telerik:RadRadialGauge>
                                                        </div>


I have set the values programatically as : 
GuageName.Scale.Ranges[GaugeRangeSeries].From  = value 

But as there are around 28 gauges its really difficult to maintain in that way. Please give me suggestion to name Scale Tag and Range Tag.

Thanks,
Mady.
Marin Bratanov
Telerik team
 answered on 07 Nov 2012
1 answer
197 views
Hi,

I have a user control with update panel, which I am opening in a popup from my page. This popup has a Rad grid which is again in another nested Update Panel. I have Edit Form in this grid.
Normal Scenario: The popup will open and on click of Add new record in the radgrid I am getting Edit form. In this scenario it works fine.

Second Scenario:  When the pop up is opened, it has values and the controls are  disabled, I have to enable the controls on server side side with the Asynch Postback. Now once i try to Click on Add new record button in the grid, it fires the event but does nothing but if we click the same button again, it will again fire the event and this time it will open the Edit form but closes the popup. I dont want the popup to be closed.
Please suggest.

Thanks,
Gagan
Marin
Telerik team
 answered on 07 Nov 2012
1 answer
103 views
I am trying to show a context menu on mouse over of an image control.

Below is my code

           
Dim ControlsContainer As New Panel
           Dim InfoIcon As New Image
           Dim InfoContextMenu As New RadContextMenu
           Dim mi As New RadMenuItem
 
 
 
 
 
 
           ControlsContainer.ID = "pnlInfoContainer"
 
 
 
 
           InfoIcon.ID = "InfoImageIcon"
           InfoIcon.ImageUrl = "/mb/admin/images/plus.png"
           InfoIcon.Attributes.Add("onmouseover", "ShowInfoMenuOnLeftClick();")
 
 
 
 
           InfoContextMenu.ID = "mb_InfoContents_ContentextMenu"
           InfoContextMenu.ClientIDMode = System.Web.UI.ClientIDMode.Static
 
 
 
 
           mi.Text = "Home"
           InfoContextMenu.Items.Add(mi)
 
 
 
 
           ControlsContainer.Controls.Add(InfoIcon)
           ControlsContainer.Controls.Add(InfoContextMenu)
 
 
 
 
           Dim script As String = "<script type=""text/javascript""> function ShowInfoMenuOnLeftClick(sender, args) {     var contextMenu = $find('mb_InfoContents_ContentextMenu'); console.log(contextMenu); contextMenu.show(args); } </script>"
           If Not Me.Page.ClientScript.IsStartupScriptRegistered("InfocontentsMenu") Then
               Me.Page.ClientScript.RegisterStartupScript(Me.Page.GetType, "InfocontentsMenu", script)
           End If
 
 
           Me.Controls.Add(ControlsContainer)
 
 
 
 
           Dim MenuTargetConfiguration As New ContextMenuControlTarget()
           MenuTargetConfiguration.ControlID = "InfoImageIcon"
           InfoContextMenu.Targets.Add(MenuTargetConfiguration)



I am getting a java script error with this code..

  1. Uncaught TypeError: Cannot read property 'target' of undefined Telerik.Web.UI.WebResource.axd:4660
    1. ShowInfoMenuOnLeftClickindex.aspx:560
    2. onmouseover

Can you help me!!
Boyan Dimitrov
Telerik team
 answered on 07 Nov 2012
1 answer
102 views
Scenario:

Grid in Conditional Update Panel
Within a UserControl
On a SiteFinity Page
Custom Export Buttons within the PagerTemplate.

Events are not firing on the server side as I cannot declaratively add the Event Triggers.
Cannot use script mananger as it's on the SiteFinity Page not in this control

Events fire on the Client Side but do nothing when executed.

Clinet code is straightforward enough but does not error or work

function onClientExcelExportCommand(sender, eventArgs) {

    var tableView = $find("<%= TransactionListGrid.ClientID %>").get_masterTableView();

     tableView.exportToExcel();

}

Help is required.

Many thanks

Kostadin
Telerik team
 answered on 07 Nov 2012
1 answer
96 views
Hello,

I have a RadGrid with 4 template columns.
1. ASP:TextBox
2. RadEditor
3. ASP:LinkButton (ADD)
4. ASP:LinkButton. (DELETE)

When we click on "ADD" button we are adding a new row next to the selected row. Same way we are deleting the selected row on click of "DELETE" button. This we are doing in postback by rebinding the RadGrid. We need to avoid the postback and Add/Delete rows dynamically in javascript. Please provide the solution. Please find herewith the sample code that we are doing in code behind.

FYI: we are using net framework 4.0 and the Telerik.Web.UI.dll version is v. 2011.2.915.40

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="RadGridTesting.WebForm1" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerikControls" %>
<!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>
    <link href="../../TelerikCSS_ETO/Grid.ETOGrid.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="scrpt1" runat="server"></asp:ScriptManager>
    <div>
        <telerikControls:RadGrid ID="gvTest" runat="server" GridLines="None"
            onitemcommand="gvTest_ItemCommand"
            onneeddatasource="gvTest_NeedDataSource">
            <MasterTableView AutoGenerateColumns="false" ShowFooter="true" Width="100%" TableLayout="Auto"
                HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Font-Bold="true"
                ViewStateMode="Enabled" ItemStyle-VerticalAlign="Middle" ExpandCollapseColumn-Display="false"
                ExpandCollapseColumn-Visible="false">
                <Columns>
                    <telerikControls:GridTemplateColumn>
                        <ItemTemplate>
                            <asp:TextBox ID="txtsno" MaxLength="3" runat="server" Width="25px" Text='<%# Eval("sno") %>'></asp:TextBox>
                        </ItemTemplate>
                    </telerikControls:GridTemplateColumn>
                    <telerikControls:GridTemplateColumn HeaderStyle-HorizontalAlign="Left">
                        <ItemTemplate>
                            <telerikControls:RadEditor ID="txt1" runat="server" Height="25px" ToolsWidth="130px"
                                Content='<%# DataBinder.Eval(Container.DataItem, "text") %>'
                                ToolbarMode="ShowOnFocus" EditModes="Design" ContentFilters="DefaultFilters" />
                        </ItemTemplate>
                    </telerikControls:GridTemplateColumn>
                    <telerikControls:GridTemplateColumn ItemStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtn1" CausesValidation="false" CommandName="DELETE" Text="Delete"
                                runat="server"></asp:LinkButton>
                        </ItemTemplate>
                    </telerikControls:GridTemplateColumn>
                    <telerikControls:GridTemplateColumn ItemStyle-VerticalAlign="Top">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtn2" CausesValidation="false" CommandName="ADD" Text="Add"
                                runat="server"></asp:LinkButton>
                        </ItemTemplate>
                    </telerikControls:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerikControls:RadGrid>
    </div>
    </form>
</body>
</html>

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;
 
namespace RadGridTesting
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        List<DataText> lstList = new List<DataText>();
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        /// <summary>
        /// Add and remove row
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gvTest_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "ADD")
            {
                GridDataItem item = (GridDataItem)((LinkButton)e.CommandSource).NamingContainer;
                lstList = BindGrid(item.ItemIndex, "Add");
                this.gvTest.Rebind();
            }
            else if (e.CommandName == "DELETE")
            {
                GridDataItem item = (GridDataItem)((LinkButton)e.CommandSource).NamingContainer;
                lstList = BindGrid(item.ItemIndex, "Delete");
                this.gvTest.Rebind();
            }
        }
 
        protected void gvTest_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (!IsPostBack)
            {
                lstList = new List<DataText> {
                                    new DataText{ sno = 1 , text = "A"},
                                    new DataText{ sno = 2 , text = "B"},
                                    new DataText{ sno = 3 , text = "C"},
                                    new DataText{ sno = 4 , text = "D"},
                                    new DataText{ sno = 5 , text = "E"}
                };
            }
            this.gvTest.DataSource = lstList;
        }
 
        private List<DataText> BindGrid(int _RowID, string opAddDelete)
        {
            lstList = new List<DataText>();
            int sno = 1;
 
            foreach (GridDataItem item in this.gvTest.Items)
            {
                RadEditor txt1 = (RadEditor)item.FindControl("txt1");
                DataText dt = new DataText();
 
                if (opAddDelete == "Delete" && item.ItemIndex == _RowID)
                {
                }
                else
                {
                    dt.sno = sno;
                    dt.text = txt1.Text;
                    lstList.Add(dt);
                    sno++;
                }
 
                if (opAddDelete == "Add" && item.ItemIndex == _RowID)
                {
                    dt = new DataText();
                    dt.sno = sno;
                    lstList.Add(dt);
                    sno++;
                }
            }
             
            return lstList;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
namespace RadGridTesting
{
    public class DataText
    {
        public int sno { get; set; }
 
        public string text { get; set; }
    }
}
Kostadin
Telerik team
 answered on 07 Nov 2012
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?