I have a column with style set to and Editor set to instance of FormattedLinkEditor which has TreatValue set to URL as well:
DocumentsGrid.Rows.Band.Columns["Link"].Editor = DocumentLinkControl;DocumentsGrid.Rows.Band.Columns["Link"].CellActivation = Activation.AllowEdit;
When I edit the contents of a link by modifying its contents directly, everything is ok but when I select a link via button which displays a list of links, link gets set to the FormattedLinkEditor as expected. When I leave the editing control, link gets wrapped in some html tags and in the end it doesn't look nice :)
I know this explanation is a bit confusing so let me clarify it with example: If user enters text with keyboard eg. C:\testfile.txt, link will display as expected C:\testfile.txt and when user will leave that cell, link will stay in the same format. When user decides to select link from predefined set of links, it will select C:\testfile.txt and when leaving editing mode of that cell some kind of formatting will be applied so link will look like this: <a href="C:\testfile.txt">C:\testfile.txt</a> .
When setting the selected link programmatically in FormattedLinkEditor, I set the Value property (which displays link correctly at all times). When link gets "stored" to cell, it gets somehow corrupted.
I've tried to fix this by setting Style of the column after setting Editor property but to no avail.
I don't know whether this is expected behaivour or an error in use of the control. If you need an example to reproduce an error, please let me know.
Best regards.
Hi Andrej,
If I understand you correctly, you are providing the user with a list of links and they choose one. At this point, how are you taking that choice and putting it into the grid cell? I would think you would need to set the Value property of the grid cell. Are you doing it in some other way?
Hi Mike,
Sorry I haven't been too much specific. I set the Value property of the FormattedLinkEditor (I thought it will take care of nitty gritty details since it is EmbeddableEditorBase descendant). The story goes like this. I have FormattedLinkEditor control and EditorButtonClick event handler in which OpenFileDialog is displayed. When user selects a filename to open, I set that value to Value property of FormattedLinkEditor. Only problem is that I don't understand why second way (programmatic setting) does not work as expected.
Best regards
I think you need to assign the Value of the grid cell, not the editor.
Okay, it looks like the URL style of the column is just expecting to interpret raw text as a link. So the links you already see do not include the "a href " tag. If you want to include the tags, then you would need to use FormattedText style for the column.
I've already tried that and it works the same as before.