This question is locked. New answers and comments are not allowed.
                        
                        I'm validating an additional text box on the uploaders upload item validate event by adding the following event handler.
I then check the text box and display a message box and cancel the upload if the text box is empty, i want to be able to do this without clearing the file while still cancel the upload. I've tried manually adding the file back but i get an exception when calling the "PrepareSelectedFilesForUpload" if i don't call this method the files do not show up in the UI. What is the best way to handle this?
 
 
 
 
 
 
Thanks
Michael
                                RadUpload1.AddHandler(RadUploadItem.ValidateEvent, New UploadValidateEventHandler(AddressOf OnValidate))I then check the text box and display a message box and cancel the upload if the text box is empty, i want to be able to do this without clearing the file while still cancel the upload. I've tried manually adding the file back but i get an exception when calling the "PrepareSelectedFilesForUpload" if i don't call this method the files do not show up in the UI. What is the best way to handle this?
Private Sub OnValidate(ByVal sender As Object, ByVal e As UploadValidateEventArgs)    If txtDesc.Text.Trim = String.Empty Then        'create a new dialog paramater to display        Dim dp As DialogParameters        dp.Content = "A File Description is Required"        dp.Header = "File Description"        'save and readd selected file        Dim file As RadUploadSelectedFile = RadUpload1.CurrentSession.SelectedFiles(0)        RadUpload1.CancelUpload()        RadUpload1.CurrentSession.SelectedFiles.Add(file)        RadUpload1.PrepareSelectedFilesForUpload()        'display allert        RadWindow.Alert(dp)    End IfEnd SubMessage: Unhandled Error in Silverlight Application Code: 4004    Category: ManagedRuntimeError       Message: System.InvalidOperationException: Operation is not valid due to the current state of the object.   at System.Windows.PresentationFrameworkCollection`1.CollectionEnum`1.MoveNext()   at Telerik.Windows.Controls.RadUpload.ValidateItems()   at Telerik.Windows.Controls.RadUpload.StartUpload()   at Telerik.Windows.Controls.RadUpload.<.ctor>b__0(Object p)   at Telerik.Windows.Controls.DelegateCommand.Execute(Object parameter)   at Telerik.Windows.Controls.RadButton.ExecuteCommand()   at Telerik.Windows.Controls.RadButton.OnClick()   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)   at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)     Thanks
Michael


