AD
Administrator
Syncfusion Team
November 3, 2006 12:35 AM UTC
Ok, I think I have it for the most part with a minor exception.
Here is the code I can use to use the opened file as a stream in my StreamReader Object. I just have to make sure that I do not close the reader object until I am finshed editing the file in the EditControl.
Dim reader As System.IO.StreamReader = New System.IO.StreamReader(EditControl1.FileOpened)
Problem:
With this method is that when I go to read the file in line by line the file seems to start reading several pages down the file. I mean that the first line read in using follwoing code does not read the first line in the file. It starts reading about line #200 or so. How can I force it to read the first line everytime. This seems to be some timing issue as the file is being loaded into the EditControl at the saem time I am reading it.
Dim Line as String
line = reader.readline
thanks
teamels
AD
Administrator
Syncfusion Team
November 8, 2006 04:08 AM UTC
Ok, I want to finalize this thread for any future reference.
Steps to take to use the file just opened with another operation.
1.) Make sure the EditControl's SharedFileMode = True
either in the designer properties or in the FileLoad method.
This enables the file to be shared instead of locked out, which is the default setting.
2.) When setting up the Reader Object the correct syntax is essential. The key here is to seperate the two lines of code below instead of using the new key word on the same line as the Dim statement.
Dim reader As System.IO.StreamReader
reader = New System.IO.StreamReader(EditControl1.FileName)
Not sure why that made the difference, but it did. Now you can use the reader object to read the file for any other valid operation.
thanks
teamels
AD
Administrator
Syncfusion Team
November 9, 2006 06:21 AM UTC
Hi Teamels,
Thanks for the update. We are glad that your problem has been solved. Please feel free to contact us if you have any other concerns.
Thanks for your patience.
Regards,
Manohari.R