I would like to turn the ID column of a dynamically created table into an edit button. Is this possible? I have seen plenty of documents on creating button columns, but I want to convert a column from text to a button column in the _ColumnCreated or covert each cell in the _PreRender.
Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles QueryRadGrid.PreRender Dim intColIndex As Integer Dim gridRow As GridDataItem For Each column As GridColumn In QueryRadGrid.MasterTableView.AutoGeneratedColumns If column.UniqueName = "ID" Then intColIndex = column.OrderIndex For Each gridRow In QueryRadGrid.MasterTableView.Items Dim editCol As GridButtonColumn = New GridButtonColumn editCol.ButtonType = GridButtonColumnType.LinkButton editCol.DataTextField = gridRow.Cells(intColIndex).Text ' How do I convert this cell??? 'gridRow.Cells(intColIndex) = ??? Next End If NextPrivate Sub QueryRadGrid_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles QueryRadGrid.ColumnCreated Dim field As String Try field = e.Column.UniqueName If Not field = Nothing AndAlso field <> "" AndAlso field <> "ExpandColumn" Then If DataSet.Tables(TableName).Columns(field).ColumnName = "ID" Then e.Column.HeaderText = ""
DO SOMETHING HERE TO CONVERT COLUMN