Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
403 views

I am trying to to use the AsyncUpload so that when a user chooses a file to upload via ajax it is sent to the server and put into a collection object with existing attachments associated with my form. Using a sample from the demos and documentation I have it doing, this, but I have an issue that when it uploads I want to clear the pending upload screen. Essentially I want to clear the UploadedFiles items when it does the ajax routine. However no matter what I do it won't work. I get an enumeration error when I use the clear method. Any help on this would be appreciated. Again all I want is when the upload file is selected an ajax call posts it back, it's added to a collection and then upload control is cleared so they can add more.

ASP.NET

<telerik:RadAsyncUpload ID="rulAttachments" runat="server" RenderMode="Lightweight" AutoAddFileInputs="false" Localization-Select="" MaxFileSize="5000000" OnClientFilesUploaded="OnClientFilesUploaded" OnFileUploaded="rulAttachments_FileUploaded" ></telerik:RadAsyncUpload>

 

Javascript

function OnClientClickingUpload(sender) {
    //sender.set_autoPostBack(false);
    $telerik.$(".ruFileInput").click();
}
 
(function (global, undefined) {
    var demo = {};
 
    function OnClientFilesUploaded(sender, args) {
        $find(demo.ajaxManagerID).ajaxRequest();
    }
 
    function serverID(name, id) {
        demo[name] = id;
    }
 
    global.serverID = serverID;
 
    global.OnClientFilesUploaded = OnClientFilesUploaded;
})(window);
 
//<![CDATA[
serverID("ajaxManagerID", "<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
    //]]>

 

C#

protected void rulAttachments_FileUploaded(object sender, FileUploadedEventArgs e)
 {
     if (rulAttachments.UploadedFiles.Count > 0)
     {
         byte[] content;
             using (Stream str = e.File.InputStream)
             {
                 content = new byte[str.Length];
                 str.Read(content, 0, content.Length);
             }
             SelectedInventoryRequest.Attachments.Add(new BLL.FileAttachment { Id = "", Description = e.File.FileName, FileData = content, NewFile = true, FilePath = ConfigurationManager.AppSettings["DocumentumInProcessPath" + ConfigurationManager.AppSettings["CurrentRegion"]] + "/" + SelectedInventoryRequest.InventoryRequestID.ToString() });
 
         rulAttachments.UploadedFiles.RemoveAt(0);
 
         BindAttachments();
     }
 }

 

 

James Daresta
Top achievements
Rank 1
 answered on 02 Jan 2018
18 answers
944 views
I have a RadScheduler set like this:
<telerik:RadScheduler runat="server" DataEndField="EndDate"
        DataKeyField="TaskID" DataStartField="StartDate"
        DataSubjectField="Title" Skin="Web20" FirstDayOfWeek="Monday"
        LastDayOfWeek="Sunday" SelectedView="WeekView" OverflowBehavior="Expand"  
        DataSourceID="SqlDataSource1" ID="scheduler">

and on the web page when I double click and enter the all day event which is like more than 2 words long and click to save it, it shows but it's height stays the same i.e. it does not expand. If I enter the same text on any hour event it will properly expand.

Can somebody point me on what do I need to do to have the all day event expand so the user can see the whole text entered?

Thank you,
Dragan B.



Marin Bratanov
Telerik team
 answered on 02 Jan 2018
1 answer
149 views
I would like to save all the settings except "Filter Menu". Is it possible to enable/disable the particular settings to be saved?
Marin Bratanov
Telerik team
 answered on 02 Jan 2018
5 answers
279 views

How to set <telerik:EditorTool Name="InsertImage" Text="Insert Image Dialog"></telerik:EditorTool> to show all properties by default ?

Marin Bratanov
Telerik team
 answered on 01 Jan 2018
4 answers
495 views

Hello,

I have an issue accessing the control of a, code behind generated, GridTemplateColumn from a click event of a button outside of the RadGrid.

<telerik:RadGrid ID="MyGrid" runat="server" AutoGenerateColumns="true" AllowSorting="true" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" OnColumnCreated="Siblings_ColumnCreated">
    <GroupingSettings CaseSensitive="false" />
    <HeaderStyle HorizontalAlign="Center" BorderWidth="1" />
    <ClientSettings AllowColumnsReorder="false">
        <Selecting AllowRowSelect="false" />
    </ClientSettings>
    <MasterTableView AllowPaging="false" DataKeyNames="MyField" CommandItemDisplay="None" TableLayout="Fixed">
    </MasterTableView>
</telerik:RadGrid>

 

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        if (MyCondition)
        {
            MyGrid.MasterTableView.EditMode = GridEditMode.Batch;
            var MyTemplateColumn = new GridTemplateColumn();
            MyTemplateColumn.UniqueName = "MyTemplateColumn";
            MyTemplateColumn.HeaderText = "MyTemplateColumn";
            MyTemplateColumn.ItemTemplate = new MyTemplate();
            MyGrid.Columns.Add(MyTemplateColumn);
        }
        MyGrid.DataSource = MyDataTable;
        MyGrid.DataBind();
    }
}
 
public partial class MyTemplate : ITemplate
{
    public void InstantiateIn(Control container)
    {
        var cb = new RadComboBox();
        cb.ID = "MyComboBox";
        cb.AutoPostBack = false;
        container.Controls.Add(cb);
    }
}
 
protected void MyButton_Click(object sender, EventArgs e)
{
    foreach (GridDataItem item in MyGrids.Items)
    {
        //This works, I have access to all the autogenerated columns and their values
        string MyValue = item["MyField"].Text;
        //This works, I have access to the Template column
        TableCell MyTemplateColumn = item["MyTemplateColumn"];
         
        //doesn't work => Controls.Count = 0
        var MyColumnCombobox = MyTemplateColumn.Controls[0] as RadComboBox;
        //doesn't work
        var MyRowCombobox = item.FindControl("MyTemplateColumn") as RadComboBox;
    }
}

 

Anyone can help ?

Thank you.

Eyup
Telerik team
 answered on 01 Jan 2018
3 answers
2.2K+ views
Hello Guys

i have attached my screen shot 

i have done all thing that i have found here to solve the problem "RadAsyncUpload does not have permission to write files in the TemporaryFolder. In Medium Trust scenarios, the TemporaryFolder should be a subfolder of the Application Path."
but still i dont have any luck!

what else is needed to be done to solve the problem?
Dinesh
Top achievements
Rank 1
 answered on 30 Dec 2017
3 answers
206 views

Hello,

I am using a RadPrompt window to accept some basic information, which I then pass back to the server for a lengthy task. I am using the  __doPostBack method to post the RadPrompt results to the server. I want to invoke the RadAjaxLoadingPanel to show I am busy while the server task completes and posts the results. My code is not working - I do not see the "loading" panel. The RadPrompt works fine, passing the desired result to the server. How can I make the RadAjaxLoadingPanel appear?

I have attached an image of the ascx code. Note that RadAjaxLoadingPanel1 and RadAjaxPanel1 are defined in code behind of the parent web part and work when other controls are pressed.

Code that defines RadAjaxLoadingPanel1 and RadAjaxPanel1

01.RadAjaxLoadingPanel radAjaxLoadingPanel = new RadAjaxLoadingPanel();
02.radAjaxLoadingPanel.ID = "RadAjaxLoadingPanel1";
03.radAjaxLoadingPanel.Skin = "Windows7";
04.radAjaxLoadingPanel.MinDisplayTime = 500;
05.radAjaxLoadingPanel.Transparency = 30;
06. 
07.Controls.Add(radAjaxLoadingPanel);
08. 
09._radAjaxPanel = new RadAjaxPanel();
10._radAjaxPanel.ID = "RadAjaxPanel1";
11._radAjaxPanel.LoadingPanelID = "RadAjaxLoadingPanel1";
12. 
13.// load these controls
14._docSearchUserControl = Page.LoadControl(_ascxPath) as DocSearchUserControl;
15._docSearchUserControl.ID = "DocSearchUserControl";
16._docSearchUserControl.ParentWebPart = this; // add reference to this web part

 

 

JS code that calls RadPrompt and tries to show the RadAjaxLoadingPanel1 over RadAjaxPanel2 (see the attached image to see how RadAjaxPanel2 is defined)

    function ExportFilesRadButton_Clicked(sender, args) {
        //debugger;
        var path = document.getElementById(sender.get_id()).getAttribute("Path"); // Path is set on server
 
        if (path) {
            OpenFileExportPrompt(path);
        }
    }
 
    function OpenFileExportPrompt(path) {
        radprompt('Server Path:', FileExportPromptCallBackFn, 330, 100, null, 'Server Target Location', path);
    }
 
    function FileExportPromptCallBackFn(arg) {
        // alert ("Prompt returned the following result: " + arg); 
        //debugger;
 
        if (arg != null) {
            currentLoadingPanel = $telerik.$("[id$='RadAjaxLoadingPanel1']").get(0).control; // to avoid 'not found' error
            currentUpdatedControl = $find("<%= RadAjaxPanel2.ClientID %>");
             
            if (currentLoadingPanel && currentUpdatedControl) {
                //alert("controls found");
                //show the loading panel over the updated control
                currentLoadingPanel.show(currentUpdatedControl);
            }
            __doPostBack("FileExportPrompt", arg);
        }
    }
</script>
</telerik:RadCodeBlock>
Marcel
Top achievements
Rank 1
 answered on 29 Dec 2017
3 answers
155 views
Dear Support,

My application needs a recurring editor which will only show Monthly, Quarterly, Semi-Annual and Annual options for scheduling. I need to hide Hourly, Daily and Weekly recurrence rules in recurrence editor, and add Quarterly and Semi-Annual recurrence rules as per my application specs. Please advice what are my options.

Thank you,
Parvinder
Marin Bratanov
Telerik team
 answered on 29 Dec 2017
2 answers
148 views
Hi,
      I noticed a strange problem with ASP ListBox when RadFormDecorator is included in page. The multiple selection mode for ASP ListBox works fine when there is no RadFormDecorator in page. But when I included RadFormDecorator in page the ASP ListBox selection mode turns to Single mode though I have explicitly mentioned SelectionMode as Multiple. However, RadListBox works fine in both the cases.
      This is with respect to RadControls 2009 Q3 version.

      Please take a look at this issue and any solution would be very helpful to me.

The sample code and output snapshot are as follows:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DockTest.aspx.vb" Inherits="DockTest" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!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>Test Page</title> 
     
</head> 
<body> 
    <form id="form1" runat="server"
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"
        </telerik:RadStyleSheetManager> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" /> 
        <br /> 
        <br /> 
         
        <table> 
            <tr> 
                <td style="padding: 20px 0px 0px 40px;"
                    <table cellpadding="10" cellspacing="0" border="0"
                         
                        <tr> 
                            <td> 
                                <telerik:RadListBox ID="RadListBox1" runat="server" SelectionMode="Multiple" Height="160px" > 
                                    <Items> 
                                        <telerik:RadListBoxItem Text="Arts" Value="Arts" /> 
                                        <telerik:RadListBoxItem Text="Biographies" /> 
                                        <telerik:RadListBoxItem Text="Children's Books" /> 
                                        <telerik:RadListBoxItem Text="Computers &amp; Internet" /> 
                                        <telerik:RadListBoxItem Text="Cooking" /> 
                                        <telerik:RadListBoxItem Text="History" /> 
                                        <telerik:RadListBoxItem Text="Fiction" /> 
                                        <telerik:RadListBoxItem Text="Mystery" /> 
                                        <telerik:RadListBoxItem Text="Nonfiction" /> 
                                        <telerik:RadListBoxItem Text="Science Fiction" /> 
                                        <telerik:RadListBoxItem Text="Travel" /> 
                                    </Items> 
                                </telerik:RadListBox> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td> 
                                <asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple" > 
                                    <asp:ListItem Text="Arts"></asp:ListItem> 
                                    <asp:ListItem Text="Biographies"></asp:ListItem> 
                                    <asp:ListItem Text="Children's Books"></asp:ListItem> 
                                    <asp:ListItem Text="Computers &amp; Internet"></asp:ListItem> 
                                    <asp:ListItem Text="Cooking"></asp:ListItem> 
                                    <asp:ListItem Text="History"></asp:ListItem> 
                                    <asp:ListItem Text="Fiction"></asp:ListItem> 
                                    <asp:ListItem Text="Mystery"></asp:ListItem> 
                                    <asp:ListItem Text="Nonfiction"></asp:ListItem> 
                                    <asp:ListItem Text="Science Fiction "></asp:ListItem> 
                                    <asp:ListItem Text="Travel"></asp:ListItem> 
                                </asp:ListBox> 
                            </td> 
                        </tr> 
                         
                    </table> 
                </td> 
                <td> 
                                                  
                </td> 
            </tr> 
        </table> 
         
    </form> 
</body> 
</html> 
 

Output snapshot:  please find the attached file.


Thanks & Regards,
Amith V.A.


Luis
Top achievements
Rank 2
 answered on 28 Dec 2017
5 answers
244 views

Hi,

I am using asp.net and using a RadWindow for a modal popup. It works fine and i have tried the various animations provided (FlyIn, Fade, Resize, Slide).

However, my management prefers the Bootstrap open animation where the modal slides in from the top center of the window. Could you please tell me how i can do this type of animation with a RadWindow?

Thank you.

David

 

 

David
Top achievements
Rank 1
 answered on 28 Dec 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?