I have an UltraGrid with a column that has its style = FormattedTextEditor. I use combo boxes and button selections to populate the column with various text items that essentially define a formula. I'm trying to format it so that different pieces of the formula have different colors. I am using FormattedLinkEditor and am successful doing this as long as I'm appending the pieces sequentially. It save the current Value and appends the newly added formatted value. I'm having trouble inserting a formatted piece in the middle of the formula. I can do it with the text part but it loses the formatting. How do I break up the formatted value into a" part1" and "part2" and insert a new formatted part in between.
Thanks,
Ron
I believe I have it working now. It was the order of statements. Before I had 'PerformAction.EnterEditMode' and then 'grid.ActiveCel = ...' which didn't work. When I reversed these statements, it works. Thanks for your help.
And FormatFormulas is putting each cell into edit mode before it tries to access the selection?
If that's the case, I'm not sure why it's not working. Can you post a small sample project demonstrating the issue?
i have a method FormatFormulas() that goes through each grid row to format the cell.
I tried adding this.BeginInvoke(new MethodInvoker(this.FormatFormulas)); at the end of my Form_Load event and still get the 'Editor must be in edit mode' error.
Hi,
To put the cell in edit mode, you can use grid.PerformAction(EnterEditMode).
However, this will not work in certain events like the Form_Load event, because you cannot set focus to a control inside this event. So you might need to use a BeginInvoke to create a delay.
I'm trying to format the entire Cell since I would have to do this when displaying an existing text when the screen first opens. I set the cell to the ActiveCell, put the grid in EnterEditMode, set the FormattedLinkEditor, but when i try to set the editor.Value or SelectedText to the grid cell's, I get 'Editor must be in edit mode' and I can't figure out the syntax to do that-- the Embeddable UIElement part.