Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Add templated Column using code behind
posted

I'm trying to to something very similar to this:

 http://forums.labs.infragistics.com/forums/t/842.aspx

 But I want to do it via code behind and am having no luck.  Right now a column is created but it does not paint my template  This is what I have so far:

My grid builds fine - in the prerender of the page I add my templated column 

Dim btnCol As New Infragistics.WebUI.UltraWebGrid.TemplatedColumn()
With btnCol
.CellTemplate =
New ActionColumnTemplate
.IsBound =
True
.Type = ColumnType.Custom
.Key =
"btn"
.CellButtonDisplay = CellButtonDisplay.Always
.BaseColumnName =
"iProductID"
End With

ResultsGridUltra.Columns.Insert(0, btnCol)

 

My template looks like this:

Public Class ActionColumnTemplate
Implements ITemplate

Private WithEvents _actionButton As ImageButton
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
_actionButton =
New ImageButton
_actionButton.ImageUrl =
"..//images/action.gif"

container.Controls.Add(_actionButton)

End Sub

End Class

Any ideas?

Parents
No Data
Reply Children