Saving RichTextBox Contents

2 posts, 0 answers
  1. Mel
    Mel avatar
    5 posts
    Member since:
    Nov 2011

    Posted 20 Jan 2012 Link to this post

    Greetings,
    I am having a problem now trying to save the contents from a RichTextBox.
    In version 2011_3_116 I was able to successfully use the following code to pull the data stream from the richReport and save it to my database. It was then easy to load it back in. Now it seems the stream stops very early on and the transfer fails. Here is the code snippets that handle streaming it to my DB server:

    SaveRichReport_ReportName(theReportName, richReport.GetXamlFromDocument());
    
    ...
                if (theReport != null && theReport.CanRead)
                {
                    UploadEntry upload = new UploadEntry(reportName + ".xaml", theReport);
                    uploadsInFlight.Add(upload);
                    Utils.UploadFile(upload);
                }
    ...
            public static void UploadFile(UploadEntry upload)
            {
                if (UploadStarted != null)
                {
                    UploadStarted(upload);
                }
            }
    ...
    		private void StartUpload(UploadEntry upload)
    		{
    			//compute file digest
    			string file_digest = UploadManager.ComputeHash(upload.GetStream(), sha1);
     
    			//create file bucket
    			RESTSubmit createFile = new RESTSubmit(upload);
    			createFile.RequestComplete += new RESTSubmit.RequestCompleteDelegate(createFile_RequestComplete);
    			createFile.RequestError += new RESTSubmit.RequestErrorDelegate(createFile_RequestError);
    			Stream tStr = upload.GetStream();
    			Dictionary<stringobject> parameters = new Dictionary<stringobject> { { "filename", upload.FileName }, { "file_digest", file_digest }, { "patient_id", upload.patient_id }, { "file_length", upload.Length.ToString() }, {"can_resume""1"} };
    			createFile.Submit(Utils.BaseUri + @"file/create", parameters, RESTSubmit.Method.POST);
    		}


    It is a circuitous route that it takes, but the process works uploading files from other parts of the application, but now it hangs when trying to save the xaml.
    Thanks for your help,
    Mel
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    3055 posts

    Posted 25 Jan 2012 Link to this post

    Hi Mel,

     We are successfully uploading a XAML from RadRichTextBox's Document using the Q3 2011, Q3 2011 SP and the latest internal builds. Could you please check out our test project and let us know if  we have missed something? Which is the RadControls' version that you use and which was your previous one ?   

    Kind regards,
    Petar Mladenov
    the Telerik team

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

Back to Top