Hi, I have this problem:
I want to set URL style to appropriate Cell (not for Column!) in Initialize Row event:
Something like this to set a style:
e.Row.Cells["ProcessCode"].Style = ColumnStyle.URL;
Also I want to connect event to this URL style cell. When using Column events I've succeeded using FormattedLinkEditor attached to Column[".."].Editor, and I've implemented event LinkClicked and it worked, because when style is changed for a column to .URL Editor automatically changes to FormattedLinkEditor....something like this work's:
band.Column["..."].Style = URL ;
((FormattedLinkEditor)band.Column["..."].Editor)).LinkClicked += new LinkClickedEventHandler(eventLinkClicked)
But when I try to add FormattedLinkEditor to Cell["..."].Editor there is no existing .Editor (it is null), so I've created:
e.Row.Cells["..."].Editor = new FormattedLinkEditor(true);
e.Row.Cells["..."].Style = ColumnStyle.URL;
((FormattedLinkEditor)e.Row.Cells["..."].Editor)).LinkClicked += new LinkClickedEventHandler(eventLinkClicked)
And connected event to editor, but at the end there was no link editor shown in the cells! So there is no blue link to click on. It seems as that adding new FormattedLinkEditor to Cell somehow changes style or does something wrong..
Please advise on this.
# Note: there is another solution: to catch On Cell click events or something like that but I really want to make this work with .Editors
Really appreciate your help on this.
Thank you, Igor
My only other guess is that it's taking the style from the editor. Maybe what you need to do is crete an UltraFormattedTextEditor control, set it's TreatAs to URL or FormattedText, and then apply it to the EditorControl property of the cell, rather than the Editor property.
Hi Mike,
Unfortunately it seems that i'm doing something wrong, as when I use:
Cell["..."].Editor = new FormattedLinkEditor(true);
that cell isn't link style (url style)...
It becomes URL only if I set Column[...].Style = URL or when I use Cell["..."].Style = URL but without setting the Cell Editor to FormattedLinkEditor.
It looks like that for some reason Cell editor/style logic is not working the same as Column editor/style logic...
Please advise.
Thx,
Igor
Hi Igor,
The Style property of a column (or cell) determines the default editor that the column (or cell) will use. So there's really no point in setting both the Editor on the column and also the Style. You should probably not be setting the Style, because this may be overridin the Editor you are applying to the cells.