I am trying to use templated columns on a text column. However, the column appears to be read-only (nothing happens when double clicking). Setting an EditorControlID didn't help. Do templated columns support edit mode?
Thanks,
Ari
Thanks for your reply.
The column contains text that is marked up with html and could contain paragraph tags, line breaks, even divs and spans. The lengh could get quite long (thousands of characters). The webgrid was not handling this. I tried TableLayout="Fixed". Although the row height was fixed in IE, Firefox still stretched the row to fit the contents. So I implemented the template below. This causes the cell to have scrollbars if the text is too long (works both in IE and Firefox).
If you know of a better way of doing this without using templated columns, please let me know.
Public Class NotesCellTemplate Implements ITemplate Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn Dim ci As Infragistics.WebUI.UltraWebGrid.CellItem = CType(container, Infragistics.WebUI.UltraWebGrid.CellItem) Dim div As LiteralControl = New LiteralControl("<div style=""height: 40px; overflow: auto"">" & ci.Text & "</div>") container.Controls.Add(div) End SubEnd Class
If you have any controls in the cell template of a templated column, then those cells shouldn't be able to go into edit mode. If you want such cells to be editable, you should put a control inside the cell template that allows editing, such as a text box or WebTextEdit.
I recall that, in the past, it was possible to put these cells into edit mode, but if the user did, the result was that the controls in the cell template were lost. The solution for this issue was to handle the client-side events of the grid to prevent cells in the column from going into edit mode in the first place.
You mention that this is a "text" column. Is there a particular reason you've set this to a templated column? What controls are you putting in the cell template?