Hello-- i'm using the TelerikEditor component and binding it to a string that i fill with a word document that i import and convert to html. The code works and does load the string with the expected value in an async method but as odd as it sounds if i load the first document nothing is displayed but when i load the second document the first document then displays even though the string content is now set to the second document. I understand there could be issues with the async nature of the code but i don't see how that could be happening considering my code. here is my code:
string documentContent { get; set; }
private async void LoadDocumentFromDisk(InputFileChangeEventArgs e)
{
if (e.File != null)
{
DocxFormatProvider docxProvider = new DocxFormatProvider();
HtmlFormatProvider htmlProvider = new HtmlFormatProvider();
var file = e.File;
byte[] theBytes = new byte[file.Size];
var reader = file.OpenReadStream(10000000);
var whatever = await reader.ReadAsync(theBytes);
RadFlowDocument radFlowDocument = docxProvider.Import(theBytes);
documentContent = htmlProvider.Export(radFlowDocument);
}
}
here is the blazor/razor html for the control:
<TelerikEditor @bind-Value="@documentContent"></TelerikEditor>
Anyone seen anything like this and how to fix the problem?
Thanks, LT.