Hello,
I try to use the RadUpload control programaticaly.
Do you mind showing a detailed exemple of how to correctly achieve this?
Your help page does not tell much.
http://www.telerik.com/help/silverlight/radupload-features-programmatic-upload.html
(by the way, the page talks about HasItems that has beend removed in the latest builds)
My code is the following:
When I do that everything works fine the first file upload.
The second time I select a file I get the following exception:
System.NullReferenceException Telerik.Windows.Controls.RadUpload.ShowValidFiles()
This is not cool. I get stuck every here and there just because the doc does not tell much despite the component being excellent...
Thanks to that other thread:
http://www.telerik.com/community/forums/silverlight/upload/removing-files-from-items-array-doesn-t-work-properly.aspx
I had the intuition to clear the Items list. This does not seem logical to me or at least it should be made clear somewhere that tis is happening. Why is this needed? Because anyway I'll be unable to upload the same file twice. Right?
Here in that other thread:
http://www.telerik.com/community/forums/silverlight/upload/overwrite-upload-question.aspx
I see that the guys clears much more then I do:
1/ Is this needed for me? Should I clear all those lists when using the control programatically?
2/ Shall I take care of those lists when using the control in the normal way?
Would you please update the documentation accordingly or point to the place I can find the correct info?
Thans a lot in advance.
John.
I try to use the RadUpload control programaticaly.
Do you mind showing a detailed exemple of how to correctly achieve this?
Your help page does not tell much.
http://www.telerik.com/help/silverlight/radupload-features-programmatic-upload.html
(by the way, the page talks about HasItems that has beend removed in the latest builds)
My code is the following:
private
void
btnImport_Click(
object
sender, RoutedEventArgs e)
{
FileImport.ShowFileDialog();
if
(FileImport.Items.Count > 0)
{
FileImport.StartUpload();
}
}
When I do that everything works fine the first file upload.
The second time I select a file I get the following exception:
System.NullReferenceException Telerik.Windows.Controls.RadUpload.ShowValidFiles()
This is not cool. I get stuck every here and there just because the doc does not tell much despite the component being excellent...
Thanks to that other thread:
http://www.telerik.com/community/forums/silverlight/upload/removing-files-from-items-array-doesn-t-work-properly.aspx
I had the intuition to clear the Items list. This does not seem logical to me or at least it should be made clear somewhere that tis is happening. Why is this needed? Because anyway I'll be unable to upload the same file twice. Right?
Here in that other thread:
http://www.telerik.com/community/forums/silverlight/upload/overwrite-upload-question.aspx
I see that the guys clears much more then I do:
radUpload1.CurrentSession.FailedFiles.Clear();
//radUpload1.CurrentSession.SelectedFiles.Clear();
radUpload1.CurrentSession.UploadedFiles.Clear();
radUpload1.CurrentSession.ValidFiles.Clear();
radUpload1.Items.Clear();
1/ Is this needed for me? Should I clear all those lists when using the control programatically?
2/ Shall I take care of those lists when using the control in the normal way?
Would you please update the documentation accordingly or point to the place I can find the correct info?
Thans a lot in advance.
John.