This is a migrated thread and some comments may be shown as answers.

RadGrid Batch Update - Disable Textbox in a TemplateColumn

0 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neelima
Top achievements
Rank 1
Neelima asked on 28 Sep 2011, 03:56 PM
I'm working on the RadGrid batch update like the one shown in one of the demos. I need to disable textbox in a template column of the RadGrid based on the condition.

If the column was a BoundColumn I would use the following code in the Grid's PreRender event. But how to handle this with the batch update Grid and a TemplateColumn.

Private Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender
     Dim status As String = Request.QueryString(0)
     If status = "Future" Then
         For Each column As GridColumn In RadGrid1.Columns
             If (column.UniqueName = "Start_Dt") Then
                 CType(column, GridBoundColumn).ReadOnly = False
                 CType(column, GridBoundColumn).DataFormatString = "{0:D}"
                 Exit For
             End If
         Next
     Else
         For Each column As GridColumn In RadGrid1.Columns
             If (column.UniqueName = "BoundDate") Then
                 CType(column, GridBoundColumn).ReadOnly = True
                 CType(column, GridBoundColumn).DataFormatString = "{0:D}"
                 Exit For
             End If
         Next
     End If
 End Sub

Thank you!!

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Neelima
Top achievements
Rank 1
Share this question
or