Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
85 views
Hi, I used RadUpload tool to upload image file and I want to show it when I select an image file on Dialog window. So I search on google and I found this page http://www.telerik.com/help/silverlight/radupload-events-overview.html with info of "FilesSelectedEventArgs"

  • FilesSelected - occurs when files have been selected from the browse dialog window. The event handler receives two arguments:
    • The sender argument contains the RadUpload. This argument is of type object, but can be cast to the RadUpload type.
    • A FilesSelectedEventArgs object.
But when I code, I can't find this. It's just have FileUploadedEventArgs . Please help me! Thanks

protected void UploadImage(object sender, FilesSelectedEventArgs e)
    {

        int counter = 1;
        UploadedFile file;
        file = e.File;
       
        string targetFolder = Server.MapPath(RadUpload1.TargetFolder);

        string targetFileName = Path.Combine(targetFolder,
            file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());

        while (System.IO.File.Exists(targetFileName))
        {
            counter++;
            targetFileName = Path.Combine(targetFolder,
                file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension());
        }
        Image1.ImageUrl = targetFileName;
        upload_image_handle(sender, e);// call FilesSelectedEventhandle
    }
Shinu
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
145 views
Hi Telerik Team, I have this webpart:

protected override void CreateChildControls()
{
      ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
      if (scriptManager == null)
      {
        scriptManager = new RadScriptManager();
        this.Page.Form.Controls.AddAt(0, scriptManager);
      }
}

protected override void OnLoad(EventArgs e)
{
      base.OnLoad(e);

      Panel panel = new Panel();
      panel.ID = "Panel1";
      this.Controls.Add(panel);   

      RadButton button = new RadButton();
      button.Height = 20;
      button.Width = 100;
      button.Text = "Click to update";
      button.ID = "ConfigureButton";
      button.OnClientClicked = "configureGauge";
      button.AutoPostBack = false;
      panel.Controls.Add(button); 

      radNumTextBox = new RadNumericTextBox();
      radNumTextBox.Height = 20;
      radNumTextBox.Width = 100;
      radNumTextBox.ID = "NewValueNumericBox";
      radNumTextBox.AllowOutOfRangeAutoCorrect = true;
      panel.Controls.Add(radNumTextBox);

      script = new Literal();
      script.ID = "scriptLiteral";
      script.Text = "<script type=\"text/javascript\">";
      script.Text += "function configureGauge() {";
      script.Text += "var value = $find('<%=NewValueNumericBox.ClientID %>');";
      script.Text += "alert(value);  }";
      script.Text += "</script>";
      this.Controls.Add(script);
}

When the configureGauge() function is called it returns null.
Do you know why this is happening?

Thanks,
Gustavo
Iana Tsolova
Telerik team
 answered on 20 Dec 2012
2 answers
98 views
Hi,

Please give me sample code that how to show LoadingPanel when switching between multiple pages in Tabstrip ?

Thank you
Madhu Palakurthi
Top achievements
Rank 1
 answered on 20 Dec 2012
3 answers
85 views
Hi,
I would like to modify the edges of radtextbox that make them rounder, how can I do?
Fabio Cirillo
Top achievements
Rank 1
 answered on 20 Dec 2012
2 answers
361 views
I have a search RadToolBar control:
<telerik:RadToolBar ID="RadToolBar2" runat="server" Width="100%" OnClientButtonClicking="OnClientButtonClicking">
   <Items>
       <telerik:RadToolBarButton runat="server" Text="Button 0">
           <ItemTemplate>
               <asp:Label ID="Label1" runat="server" Text="Name:"></asp:Label>
               <telerik:RadTextBox ID="RadTextBox1" runat="server" Width="70" />
               <asp:Label ID="Label2" runat="server" Text="Surname:"></asp:Label>
               <telerik:RadTextBox ID="RadTextBox2" runat="server" Width="70" />
               <asp:Label ID="Label3" runat="server" Text="Age:"></asp:Label>
               <telerik:RadTextBox ID="RadTextBox3" runat="server" Width="70" />
           </ItemTemplate>
       </telerik:RadToolBarButton>
       <telerik:RadToolBarButton runat="server" CommandName="NewSearch">
       </telerik:RadToolBarButton>
       <telerik:RadToolBarButton runat="server" CommandName="SearchGrid">
       </telerik:RadToolBarButton>
   </Items>
</telerik:RadToolBar>

I want to get/set the value of any RadTextBox controls on the toolbar, using Javascript.

I have this function:

function OnClientButtonClicking(sender, args) {
   var button = args.get_item();
   if (button.get_commandName() == "NewSearch") {
       //Here is where I want to clear the content of all the RadTextBox controls on the toolbar
   }
   if (button.get_commandName() == "SearchGrid") {
       //Here is where I want to get the content of a RadTextBox control from the toolbar
   }
}

Thank you!
Emil
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
81 views
HI,
When i add more than 6 records in the grid, i am getting the below error:

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near ' Thank you for using'. "

I am not using the trial version and below is the aspx code for the radajax and radgrid added. This error is shown in the scriptresource.axd file.

<div class="Table">
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="radgrid1">
                        <UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radgrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="hdnRowsCount" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
                Width="75px" Transparency="25">
                <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
                    style="border: 0;" /></telerik:RadAjaxLoadingPanel>
            <asp:HiddenField ID="hdnRowsCount" runat="server" Value="0" />
              
<telerik:RadGrid ID="radgrid1" runat="server" ShowStatusBar="True" ShowFooter="True"
                OnItemCommand="radgrid1_ItemCommand" OnDeleteCommand="radgrid1_DeleteCommand"
                OnInsertCommand="radgrid1_InsertCommand" OnUpdateCommand="radgrid1_UpdateCommand"
                OnNeedDataSource="radgrid1_NeedDataSource" OnItemDataBound="radgrid1_ItemDataBound"
                CellSpacing="0" GridLines="None">
                <MasterTableView DataKeyNames="ProductNumber" AutoGenerateColumns="false" EditMode="InPlace"
                    CommandItemDisplay="TopAndBottom" CommandItemSettings-AddNewRecordText="Add New Order">
                    <Columns>


How to fix this?

Thanks
Radoslav
Telerik team
 answered on 20 Dec 2012
4 answers
272 views

Hi,

I used the code in your demo page but the progress bar is not showing even if the browser is IE and i uploaded large file. Did i missed code or something? I traced the code but it doesnt fall in function onClientProgressBarUpdating

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="EgsUploadDbase.WebForm1" %> 
<%@ 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"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
     <form runat="server" id="mainForm" method="post">  
 
        <script type="text/javascript">  
            function onClientProgressBarUpdating(progressArea, args) {  
                progressArea.updateVerticalProgressBar(args.get_progressBarElement(), args.get_progressValue());  
                args.set_cancel(true);  
            }  
 
        </script> 
 
        <telerik:RadScriptManager id="ScriptManager1" runat="server" /> 
          
        <table width="754">  
            <tr> 
                <td colspan="2">  
                    To see the progress area, please upload a large file.   
                </td> 
            </tr> 
              
            <tr> 
                <td style="vertical-align: top;">  
                    <telerik:radupload id="Radupload1" runat="server" initialfileinputscount="2" /> 
<asp:button id="buttonSubmit" runat="server" text="Submit" onclick="buttonSubmit_Click" 
cssclass="RadUploadSubmit" /> 
                </td> 
                <td style="vertical-align: top;">  
              
                    <div class="smallModule">  
                        <div class="rc1"><div class="rc2"><div class="rc3" style="width:240px">  
                              
                            <asp:Label id="labelNoResults" runat="server" visible="True">No uploaded files yet</asp:Label> 
                            <asp:Repeater id="reportResults" runat="server" visible="False">  
                                <HeaderTemplate> 
                                    <span>Uploaded files:</span><br /> 
                                </HeaderTemplate> 
                                <ItemTemplate> 
                                    '<%#DataBinder.Eval(Container.DataItem, "FileName")%>' (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>)<br /> 
                                </ItemTemplate> 
                            </asp:Repeater> 
                              
                        </div></div></div> 
                    </div> 
                </td> 
            </tr> 
        </table> 
          
        <telerik:RadProgressManager id="Radprogressmanager1" runat="server" /> 
          
        <telerik:RadProgressArea id="RadProgressArea1" runat="server" onClientProgressBarUpdating="onClientProgressBarUpdating" > 
        
 
        </telerik:RadProgressArea> 
        <br /> 
        <br /> 
    </form> 
 
</body> 
</html> 
 

Public Class WebForm1  
    Inherits System.Web.UI.Page  
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
 
    End Sub 
    Protected Sub buttonSubmit_Click(ByVal sender As ObjectByVal e As System.EventArgs)  
        BindResults()  
    End Sub 
    Private Sub BindResults()  
        If Radupload1.UploadedFiles.Count > 0 Then 
            labelNoResults.Visible = False 
            reportResults.Visible = True 
            reportResults.DataSource = Radupload1.UploadedFiles  
            reportResults.DataBind()  
        Else 
            labelNoResults.Visible = True 
            reportResults.Visible = False 
        End If 
    End Sub 
 
End Class 
Plamen
Telerik team
 answered on 20 Dec 2012
1 answer
136 views
Hi,

I want total of a column in footer but i am creating my columns dynamically and it is asp label type and i need Total of that column in footer

I am using this code. But it returning a error page with error

Sum is not supported for type "System.Object".

but when i comment line denoted with * than page works fine but not able to display total. Please help


  templateColumn = new GridTemplateColumn();
  controlID = "lbl_Total" + colCounter.ToString();
   templateColumn.ItemTemplate = new CreateItemTemplate("Label", this, controlID, null, 27, "16px", colCounter, dtSchedule.Rows.Count);
  templateColumn.HeaderText = dtGetColumnsNameForGrid.Rows[colCounter - 1]["HeaderText"].ToString();
  templateColumn.UniqueName = dtGetColumnsNameForGrid.Rows[colCounter - 1]["UniqueName"].ToString();
  templateColumn.DataField = dtGetColumnsNameForGrid.Rows[colCounter - 1]["UniqueName"].ToString();
 templateColumn.FooterText = "Total: ";
*****  templateColumn.Aggregate = GridAggregateFunction.Sum;



Princy
Top achievements
Rank 2
 answered on 20 Dec 2012
3 answers
150 views
I am creating a User Control for SharePoint 2010 using the Telerik RadGrid. I am getting an error "Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified."

Here is my web.config entries for the Telerik controls on the server.

<SafeControl Assembly="Telerik.Web.UI, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="True" />
      <SafeControl Assembly="Telerik.Web.UI.Skins, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI.Skins" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="True" />
      <SafeControl Assembly="Telerik.Web.Design, Version=2012.3.1205.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.Design" TypeName="*" Safe="True" AllowRemoteDesigner="True" SafeAgainstScript="True" />

Here is my code in the User Control:
protected void Page_Load(object sender, EventArgs e)
        {
            SPSite site = new SPSite("http://abcdev");
            using (SPWeb web = site.OpenWeb())
            {
                SPList clientlist = web.Lists.TryGetList("clientmatter");
            }
        }
 
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            SPSite site = new SPSite("http://abcdev");
            using (SPWeb web = site.OpenWeb())
            {
                SPList clientlist = web.Lists.TryGetList("clientmatter");
 
                //if (clientlist != null)
                //{
                //    SPListItemCollection clientitems = clientlist.Items;
                //    DataGrid dg = new DataGrid();
                //    dg.DataSource = clientlist.Items.GetDataTable();
 
        //            foreach (SPListItem clientitem in clientitems)
        //            {
        //                string clientddlvalue = clientitem["clientid"].ToString();
        //            }
                //}
            }
        }

This is quite frustrating! :(
What steps must be performed for these errors not to be thrown?
Venkatesh
Top achievements
Rank 1
 answered on 20 Dec 2012
4 answers
516 views
Hi,

I am building a scheduling system using Quartz.Net ( http://quartznet.sourceforge.net/) and would like to use the RecurrenceEditor to create  the schedule.
Quartz.net uses Cron expression to fire jobs and I saw in an old post (http://www.telerik.com/community/forums/silverlight/scheduler/radscheduler-recurrence-to-cron-expression.aspx) that the scheduler does not support cron expressions and to use the recurrence pattern to translate to cron expression.

Was wondering if it is possible to use the recurrence editor without the scheduler. 


Thanks
Lindsay
Top achievements
Rank 1
 answered on 20 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?