I can't believe, as comprehensive as Syncfusion for Xamarin Forms is, that I might have found a component it doesn't offer.....
What I am looking for a something in which I can log data being received in realtime (similar to a terminalo application). As I would like to annotation some entries, it would be useful for me to show those entries in a different colour/font, which is why Rich Text support would be useful.
I don't want to enable the user to edit these entries, so I don't think RichTextEditor or DocIO are appropriate. I also don't want to keep regenerating a PDF so have rejected the PDF view too. I might be able to use SfListView, or a multi-line label (Syncfusion don't offer one), but this seems making the best of what's available, rather than using something indended for displaying text.
So is using a standard Xamarin Label the best I can use to achieve what I want?
Thanks.
Hi Paul,
We could not understand your requirement clearly. Could you please share your requirement in detail with a demo image? It will be helpful for us to provide you with the best possible solution at the earliest.
Based on the given details, you can use the SfRichTextBox to display the Rich text. You can restrict editing by setting the ReadOnly property to True and you can hide the editor ToolBar by setting the ShowToolBar to False.
Please refer to our user guidance document regarding the same,
UG link: https://help.syncfusion.com/xamarin/rich-text-editor/customization#read-only-support
Please refer to the following code snippets for more reference,
|
<richtexteditor:SfRichTextEditor VerticalOptions="FillAndExpand" ReadOnly="True" ShowToolbar="False" HtmlText="This is <strong style="color:red">HTML</strong> text." /> |
You can also use the Xamarin.Forms Label to achieve your requirement.
And the SfListView is used to display the list of items by setting the ItemsSource property. Also, the SfListView is a templated control, and the Item appearance can be achieved by customizing elements in the DataTemplate.
Please refer to our user guidance document regarding SfListView,
UG link: https://help.syncfusion.com/xamarin/listview/overview
Lakshmi Natarajan
Hi,
Thanks for your reply.
No I don't have an image. If you are familiar with HyperTerminal or PuTTY, they displayed everything they received from a serial port on screen in a scrollable window. The only difference for me, is that I would additionally like some formatting control.
It sounds like SfRichTextEditor in a non-editable mode might do the job. If I used this and used binding to drive the text contents, would I be able to append extra lines, without the RichTextEditor scrolling back to the start of the text?
Paul
I haven't tried formatting the text yet, but SfRichTextEditor is looking likely. I have set ScrollOrientation to Vertical and it is scrolling when I would expect, but it only shows the scrollbars whilst I am actually scrolling.
Is it possible to always show the vertical scrollbar when there is more text available than is visible? This would alert my user to the possibility of scrolling. Otherwise they might only see the visible lines and not realise there is more available.
Thanks
Paul
Hi Paul,
Based on your provided information, we suspect you are facing below issues,
The vertical scrollbar is not visible when the text exceeds the height of the RichTextEditor.
The RichTextEditor scrolls to cursor position 0(i.e., top) when we append the text to RichTextEditor.
We are able to reproduce the reported issue and please find the sample to reproduce the reported issue from below,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/GettingStarted597424279
We created a video for illustrating the same and it can be downloaded from the below links,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/RTEWithScrollView1139957947
Could you please confirm us whether you have faced the issue in which platform in Xamarin? And please confirm us whether you are facing the issue in same scenario as we shared in the sample and mentioned in the video? It will be easy for us to investigate further and assist you with the better solution at the earliest.
If our understating is different, could you please modify the provided sample with replication procedure?
With Regards,
Gayathri R
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header/>
<s:Body>
Hi Paul,
Thank you for your update.
We are currently analyzing your requirement and will provide you details on 16th May 2022.
With Regards,
Gayathri R
Hi Paul,
Thank you for your patience.
On further analyzation we found that, RichTextEditor is implemented based on the Xamarin Forms WebView concept and relies on WebView for rendering the HTML content and we have ensured the behaviour in Editor Xamarin Forms control also which possess the vertical scrollbar is not visible when the text is exceeds than the control height. So RichTextEditor also possesses the same behaviour.
Regarding automatic scrolling, In the sample shared by you in the previous update, you have set the ‘ReadOnly’ property to ‘true’ which allows the users to restrict editing. We have mentioned the same in the below UG documentation link,
https://help.syncfusion.com/xamarin/rich-text-editor/customization#read-only-support
Since we were able to focus and automatically scroll the control based on the appended text. We are facing the issue “The RichTextEditor control should scroll based on the appended text even if the ‘ReadOnly’ mode is false”. We have resolved the issue and prepared custom test patch and please find the custom NuGet for the same from below,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomNuGet1290422716
Disclaimer:
Please note that we have created this NuGet for version 19.3.0.53 specifically
to resolve the following issue(s) reported in this/the Forum(s). 174934
Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.
https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache
We have modified the sample for the same and it can be downloaded from below,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/sfRichTextEditor-1574250167
Note: Kindly set the ‘ReadOnly’ property to ‘False’ and have to set focus once control loaded.
We created a video for illustrating the same and it can be downloaded from the below links,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/CursorPositionVideo268910894
Could you please try the above suggested solution with provided custom NuGet and let us know whether it meets your requirement or not?
With Regards,
Gayathri R
Hi,
Ok I can accept that the scroll controls will not be visible unless actually scrolling.
Regarding the use of Read Only, yes I was aware that I am setting this as this was recommended in the first reply to this very post from one of your colleagues.
I tried watching your video, and have downloaded it twice but I keep getting told that the video is unplayable (file type not supported, extension incorrect, or file corrupted). I am using Win11, perhaps that does not support mp4 files out of the box? It it can't be viewed without installing an additional player or codecs, then I'd suggest you are not using the most appropriate video format.
So I tried the updated sample (Android only) and this is my feedback
Also, you never mentioned the fact that the html text cannot seemingly be displayed.
In the sample, it should be adding 3 line of text per second, 1 x timestamp and 2 x html text. All you ever see logged, is the timestamp.
Paul
Hi Paul,
As we mentioned in the previous update, we are facing the issue “The RichTextEditor control should scroll based on the appended text even if the ‘ReadOnly’ mode is false”. We have resolved the issue and prepared custom test patch and please find the custom NuGet for the same from below,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomNuGet1290422716
Note: You have mentioned that did not tried the provided above NuGet. The reported issue only works when we install the above NuGet.
We created a video with proper format for illustrating the same and it can be downloaded from the below links,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Video-1912277805
Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.
https://www.syncfusion.com/kb/6987/how-to-clear-nuget-cache
Kindly follow the steps to install the given above custom NuGet from below link,
Could you please try the above suggested solution with provided custom NuGet and let us know whether it meets your requirement or not?
If you are still facing the
issue even after installed provided custom NuGet, we would like to
setup a web meeting to look into it and provide the solution. Please let us
know your availability. We will make every effort to have this scheduled on a
date and time of your convenience.
With Regards,
Gayathri R
Hi,
I'm, sorry but I am failing to install the custom Nuget you have supplied. All the instructions in the linked page on installing nuget packages appear to use Nuget.org as the source, and none indicate the use of a local .nupkg file.
I am not even sure which of the 3 options discussed there, you expect to me use: Package Manager UI, DotNet CLI, or Package Manager Console.
All instructions refer to packages by name, not by local file.
Please could you clarify further?
Thanks
Paul
Hi Paul,
Kindly follow the steps mentioned in the below link to configure the custom NuGet package,
If you are still facing the issue of installing the provided custom NuGet, we would like to set up a web meeting to look into it and provide the solution. Please let us know your availability (we are ready to assist you by tomorrow). We will make every effort to have this scheduled on a date and time of your convenience.
Note: We are working on IST timing from 8.30 AM to 7.30 PM.
With Regards,
Gayathri R
I followed the instructions in the latest link, but I didn't see how registering an online source would help me install a local .nupkg file. I tried it anyway and browsing from that source offered me components up to v16.4.0.52, which do not include SfRichTextEditor.
So I tried a URL of file://<local path> and that did seems to work and offer me your upgraded 19.3.0.53 package (which I understand is NOT the same as your standard 19.3.0.53 release). I uninstalled the existing package and installed the new one of the same name/version from my local repo. When I cleared the nuget cache, rebuilt and ran the sample app on my Android simulator, it still didn't work as you expect.
I believe I have done everything correct, but if you wish to double check then yes we can have a web meeting. What software would you use? If it helps, we use TeamViewer in house so I already have that installed and can allow you to connect in via that.
I am in the UK so we are on British Summer Time (BST). I believe that your hours of 8:30 to 19:30 IST equate to 4:00 to 15:00 BST. I will be in the office 9am to 5pm today, which is 13:00 to 21:30 IST. My conclusion is that I would be available today from now, until your end of day at 19:30. Otherwise we can try for the same sort of time range, on Monday if you prefer?
regards
Paul
Hi Paul,
Since it is a public forum we couldn't send the meeting invitation here. So we've created a ticket in your account, scheduled a meeting, and sent you an invite.
Regards,
Anitha