sairam

sairam

  • NA
  • 69
  • 0

richtextbox... cursor position

Jan 9 2009 10:34 AM

From DB, i get a field which contains data in richtextformat. actually the data is an image. it was uploaded to DB from a richtextbox. so when i get it from DB, it is like a richtext content. i want to insert this image at a given cursor location. BUt the code below i  am using is inserting image at last line. please correct me.

 

data from DB is extracted thru Datareader reader2. richtextbox name is rcheditor1.

while (reader2.Read())

{

String test = reader2[0].ToString();

string Field2 = string.Empty;

Field2 = rchEditor1.Rtf.Insert(rchEditor1.Rtf.Length -4,test);

rchEditor1.Rtf = Field2;

}

reader2.Close();

i tried to use rcheditor1.selectionstart instead of rcheditor1.rtf.length -4.

 

still did not work

 

 


Answers (3)