We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Adding text programmaticly

Good day all, I'm having a heck of a time trying how to add text programmaticly. I have tried appendtext, insert, EditLocation and can not seem to build a text file dynamically. Could someone please point me in the right location. I'm sure i'm just missing a simple method or property setting. Thanks, Dennis

1 Reply

AD Administrator Syncfusion Team July 14, 2003 03:41 PM UTC

Hi Dennis, There are several ways in which to dynamically add text to the EditControl. First, there is the Insert() method of the EditControl, which has five overrides. The simplest one just takes a string as its single parameter. The other overrides for Insert take an EditLocation. If you specify a location that does not exist (e.g. Line 5 character 6 when there is only one line in the file), the insertion will fail. To perform this, you would need to create blank lines first. The other way to modify the text would be by setting the Text property of the control. Also, make sure that you have called NewFile() if you wish to create a blank document. Without this call (or without loading up a file), none of the text functions will work, since there will not be any content to modify. I hope this helps. Thanks, and have a great day! Syncfusion Technical Support

Live Chat Icon For mobile
Up arrow icon