Hi
I've been struggling with using an UltraFormattedTextEditor as a standalone control (i.e. not in a grid) on a form in a C# WinForms app to display a web hyperlink. 'TreatValueAs' is set to URL.
I want the user to be able to change the link and decided that the best approach was to make use of the EditInfo.ShowLinkDialog method to display a pop-up where they can enter a URL, Display Text and Tooltip text. This works really well. When the dialog is closed the FormattedTextEditor fully reflects what was entered in the dialog (text, URL and tooltip).
My problem is I can't figure what I need to save, say to a database, so that the FormattedTextEditor can be populated when the form is next displayed.
As an example, in the EditInfo dialog I enter: URL = 'www.google.com', Display Text = 'Google' and Tooltip Text = 'Click for Google' .
When the dialog has closed the ForrmattedTextEditor.Value property = '<a title="Click for Google" href="www.google.com">Google</a>' and I save this to a database.
When the form is next displayed I set the ForrmattedTextEditor.Value property to what was saved but then I just see the full xml string with tags exactly as it was saved. So my question is what do I need to do to achieve the same as what the EditInfo.ShowDialog is doing by setting the Display Text, URL and Tooltip text?
Hope what I have asked makes sense.
Regards
Adrian
I didn't look into why setting TreatValueAs to 'URL' doesn;t work, but I tried the value you listed here(<a title=\"Click for Google\" href=\www.google.com\>Google</a>), and left TreatValueAs at the default value (Auto), and it worked.
Thanks Brian.
I hadn't thought of leaving TreatValueAs at the default but that works for me too. Do you think there could be a problem with the explicit 'URL' setting?
A couple of other questions for you:
1) When selecting text in the FormattedTextEditor which is formatted as a hyperlink I'm never able to select the last character. With the example above the text is Google and it's underlined and formatted as a link but if I try to double-click it to select all or try to drag select everything I never pick up the last character (the last 'e').
2) I was hoping that with a FormattedTextEditor in readonly mode I'd see a hand cursor when hovering over the link and would simply be able to click to open the link. But I still have to press CTRL and click to open. I can understand the need for CTRL and click in update mode but not really when it's readonly. Do you know of any workarounds for this?
Many thanks
oh yes
replace & = ;
it work
Hello you.
this is version infragistics2 v8.3.
What version of NetAdvantage are you using? I think I remember that there was a bug regarding URL's that contained a question mark that was fixed a while back.
Hello,
Could you please try to attach if possible a small sample project reproducing the above mentioned issue, I will be happy to take a look at it.
I saved in sql and shown it, by ultragrid...EditorControl = ultraFormattedLinkLabel but it don't work