This is a migrated thread and some comments may be shown as answers.

Blocking panel appears over upload control

1 Answer 34 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Larkin
Top achievements
Rank 1
Larkin asked on 23 Nov 2011, 09:04 AM
I am using the RadUpload Silverlight control in a SharePoint web part, and it seems that when the control initially loads on the page, there is a sem-transparent blocking panel that appears in front of the control. If you wait for 3 seconds or so, it disappears, and it also disappears if you click on the control. Can anyone explain why this is happening? I have attached a couple screenshots to demonstrate what is happening.

Blocking Panel on initial load
Blocking panel disappeared

Here is my SL user control code:

<UserControl x:Class="AttachmentUploader.MainPage"
    mc:Ignorable="d" Height="300" Width="400">
 
    <Grid x:Name="LayoutRoot" Background="White" Height="Auto">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition Height="200"></RowDefinition>
        </Grid.RowDefinitions>
        <telerik:RadUploadDropPanel telerik:StyleManager.Theme="Windows7" BorderThickness="1" Grid.Row="0" BorderBrush="#FFA7A7A7" Background="White" VerticalAlignment="Stretch"
                                        HorizontalAlignment="Stretch" DragEnter="AttachmentDropPanel_DragEnter" 
                                        DragLeave="AttachmentDropPanel_DragLeave" x:Name="AttachmentDropPanel" RadUpload="{Binding ElementName=FileAttachmentUpload}" Height="100">
            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center"
                               Text="Drag and drop files here." TextWrapping="Wrap" Margin="10"/>
        </telerik:RadUploadDropPanel>
        <telerik:RadUpload x:Name="FileAttachmentUpload"
                           telerik:StyleManager.Theme="Windows7"
                           HorizontalAlignment="Left"
                           Grid.Row="1"
                           VerticalAlignment="Top"                          
                           IsAppendFilesEnabled="True"
                           IsAutomaticUpload="True"
                           MaxFileCount="10"
                           MaxFileSize="100000000"
                           MaxUploadSize="200000000"
                           UploadServiceUrl="_layouts/eo-cms/AttachmentUploadHandler.ashx" FileUploaded="FileAttachmentUpload_FileUploaded" FileUploadStarting="FileAttachmentUpload_FileUploadStarting" Height="200" />
    </Grid>
</UserControl>

Codebehind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Browser;
 
namespace AttachmentUploader
{
    public partial class MainPage : UserControl
    {
        private string _trackingFileInputId = "";
        List<RecordAttachment> _attachments = new List<RecordAttachment>();
 
        public MainPage()
        {
            InitializeComponent();
        }
 
        public MainPage(IDictionary<string, string> initParams)
        {
            InitializeComponent();
 
            if (initParams.Keys.Contains("TrackFilesInput"))
            {
                _trackingFileInputId = initParams["TrackFilesInput"];
            }
        }
 
        private void AttachmentDropPanel_DragEnter(object sender, DragEventArgs e)
        {
            Color backgroundColor = new Color();
            backgroundColor.R = 208;
            backgroundColor.G = 232;
            backgroundColor.B = 254;
            this.FileAttachmentUpload.Background = new SolidColorBrush(backgroundColor);
        }
 
        private void AttachmentDropPanel_DragLeave(object sender, DragEventArgs e)
        {
            this.FileAttachmentUpload.Background = new SolidColorBrush(Colors.White);
        }
 
        private void FileAttachmentUpload_FileUploaded(object sender, Telerik.Windows.Controls.FileUploadedEventArgs e)
        {
            var fileId = e.HandlerData.CustomData["FileItemId"];
            var fileName = e.SelectedFile.Name;
            _attachments.Add(new RecordAttachment() { Id = Convert.ToInt32(fileId), FileName = fileName, Type = 0 });
            HtmlDocument doc = HtmlPage.Document;
            HtmlElement uploadedFilesElem = doc.GetElementById(_trackingFileInputId);
            uploadedFilesElem.SetAttribute("value", SerializationHelper.JsonSerialize(_attachments));
        }
 
        private void FileAttachmentUpload_FileUploadStarting(object sender, Telerik.Windows.Controls.FileUploadStartingEventArgs e)
        {
 
        }
    }
}


Any help would be appreciated.

Thanks,
Larkin

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 23 Nov 2011, 11:18 AM
Hi Larkin,

When you're using the trial version of our controls in your SharePoint application notification message is displayed causing this blocking panel. If this is the case, switching to the developer licensed version of the RadControls for Silverlight should fix it.

Please let me know if it doesn't.

Greetings,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Upload
Asked by
Larkin
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or