private void ProcessDocument(ASPxGridView grid, OrderedDictionary newValues) { ASPxRichEdit richEdit = GetRichEdit(grid); //for text in db newValues["RtfContent"] = Encoding.UTF8.GetString(richEdit.SaveCopy(DocumentFormat.Rtf)); //for binary in db //newValues["RtfContent"] = richEdit.SaveCopy(DocumentFormat.Rtf); throw new CustomCallbackException("Data modifications are not allowed in online demos"); //Note that data modifications are not allowed in online demos. To allow editing in local/offline mode, download the example and comment out the "throw..." operation in the ASPxGridView.RowUpdating event handler. OpenedCanceledDocumentIDs.Remove(richEdit.DocumentId); DocumentManager.CloseDocument(richEdit.DocumentId); }
protected void reNotes_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e) { string[] parameters = e.Parameter.Split('|'); if (parameters[0] == "open") { if (parameters.Length > 2) { OpenNote(decimal.Parse(parameters[1]), parameters[2].Trim()); } else { OpenNote(decimal.Parse(parameters[1]), "A"); } } else { ASPxRichEdit rich = sender as ASPxRichEdit; using (MemoryStream ms = new MemoryStream()) { rich.SaveCopy(ms, DocumentFormat.Html); ms.Position = 0; decimal protocolversion = decimal.Parse(txtProtocolVersion.Text); string user = Request.Cookies["UserSettings"]["UserCKey"].ToString(); // Session["userckey"].ToString(); int index = lstTags.SelectedIndex; string tag = lstTags.Items[index].Text.Trim(); if (tag == "-- New --") { //generate new tag tag = ""; } Note note = new Note(); note.saveNote(protocolversion, decimal.Parse(user), tag, txtNoteTitle.Text, ms); lstTags.DataSource = note.getTags(protocolversion); } } }