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

Drag in a upload window

1 Answer 65 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Tarcisis
Top achievements
Rank 1
Tarcisis asked on 24 Nov 2010, 05:23 PM
I must do a dialog window to upload files in silverlight!

My page(.xaml) is:
UserControl xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"  x:Class="SilverlightApplication1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
    xmlns:telerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"
    d:DesignHeight="300" d:DesignWidth="400">


    
        <Grid x:Name="LayoutRoot" Width="320" Height="140">
        <Canvas Margin="8,8,0,0" Background="AliceBlue" Height="120" VerticalAlignment="Top" HorizontalAlignment="Left" Width="300">
            <Button Width="75" Canvas.Left="170" Canvas.Top="43" Content="Browse" x:Name="btnBrowse"  Click="btnBrowse_Click" />
            <TextBox Canvas.Left="25" IsReadOnly="True"  Canvas.Top="43" Text="TextBox" TextWrapping="Wrap" Width="145"   Name="txtFileName" />
            <ProgressBar Height="10" Width="220" Canvas.Left="25" Canvas.Top="89" x:Name="prgUpload" />
            
            <my:Label Content="Please select a file to upload"  Name="lblError" Canvas.Left="25" Canvas.Top="23" RenderTransformOrigin="0.133,-0.063" Width="220"/>
            <my:Label x:Name="lblProgress" Canvas.Left="25" Canvas.Top="69" RenderTransformOrigin="0.133,-0.063" Width="220"/>
            <Button Width="75" Canvas.Left="170" Canvas.Top="100" Content="Close" x:Name="close"  Click="close_Click" />
        </Canvas>
       
    </Grid>
</UserControl>

And i use a web service to upload the file.
So far, so good...it works perfectly!!

But now i want to add the functionality of drag(instead of click in button Browser to select the file), like the telerikInput:RadUploadDropPanel.



The problem is: if i choose the <telerikInput:RadUploadDropPanel  to add this functionality, i must use the <telerikInput:RadUpload to upload the file, and the <telerikInput:RadUpload must use a Handler to upload the file, and i can´t use a handler.I must use a web service.
There´s anybody knows something about this?!?Can i use a web service instead of a handle in telerikInput:RadUpload?and how?

I tried to do something like this:

    <telerikInput:RadUploadDropPanel  DragEnter="RadUploadDropPanel1_DragEnter" DragLeave="RadUploadDropPanel_DragLeave" x:Name="RadUploadDropPanel1" RadUpload="{Binding ElementName=btnBrowse}">
       
       <Grid x:Name="LayoutRoot" Width="320" Height="140">
        <Canvas Margin="8,8,0,0" Background="AliceBlue" Height="120" VerticalAlignment="Top" HorizontalAlignment="Left" Width="300">
            <Button Width="75" Canvas.Left="170" Canvas.Top="43" Content="Browse" x:Name="btnBrowse"  Click="btnBrowse_Click" />
            <TextBox Canvas.Left="25" IsReadOnly="True"  Canvas.Top="43" Text="TextBox" TextWrapping="Wrap" Width="145"   Name="txtFileName" />
            <ProgressBar Height="10" Width="220" Canvas.Left="25" Canvas.Top="89" x:Name="prgUpload" />
            
            <my:Label Content="Please select a file to upload"  Name="lblError" Canvas.Left="25" Canvas.Top="23" RenderTransformOrigin="0.133,-0.063" Width="220"/>
            <my:Label x:Name="lblProgress" Canvas.Left="25" Canvas.Top="69" RenderTransformOrigin="0.133,-0.063" Width="220"/>
            <Button Width="75" Canvas.Left="170" Canvas.Top="100" Content="Close" x:Name="close"  Click="close_Click" />
        </Canvas>
    </Grid>
    
   </telerikInput:RadUploadDropPanel>

but of course, it doesnt work.

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 25 Nov 2010, 09:57 AM
Hi Tarcisis,

I have replied to the same forum post here.

Best wishes,
Alex Fidanov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
DragAndDrop
Asked by
Tarcisis
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or