嗨,我有一个问题,就是无法在我的 RichTextBox 控件中正确显示或传输数据到其他 RichTextBox 控件中...
richtextbox1.Document = richtextbox2.Document; //This will be the idea..
实际上我计划要做的是,将我的数据库数据转移到列表视图中,并以原样显示。
SQLDataEHRemarks = myData["remarks"].ToString();// Here is my field from my database which is set as Memo
RichTextBox NewRichtextBox = new RichTextBox();// Now i created a new Richtextbox for me to take the data from SQLDataEHRemarks...
NewRichtextBox.Document.Blocks.Clear();// Clearing
TextRange tr2 = new TextRange(NewRichtextBox.Document.ContentStart, NewRichtextBox.Document.ContentEnd);// I found this code from other forum and helps me a lot by loading data from the database....
MemoryStream ms2 = GetMemoryStreamFromString(SQLDataEHRemarks);//This will Convert to String
tr2.Load(ms2, DataFormats.Rtf);//then Load the Data to my NewRichtextbox
现在我想做的是,将这些数据加载到我的ListView中...或其他控件,比如textblock或textbox。
_EmpHistoryDataCollection.Add(new EmployeeHistoryObject{
EHTrackNum = tr2.ToString() // The problem here is it will display only the first line of the paragraph.. not the whole paragraph
});