I am trying to hide or display different controls in edit mode depending on the value of another item
This code is not working the textbox is visible no matter what value is in DataType
| Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated |
| If e.Item.IsInEditMode AndAlso Not (TypeOf e.Item Is IGridInsertItem) Then |
| Dim formItem As GridEditFormItem = CType(e.Item, GridEditFormItem) |
| Dim mydd As DropDownList = TryCast(e.Item.FindControl("DropDownList1"), DropDownList) |
| Dim mytb As TextBox = TryCast(e.Item.FindControl("TextBox1"), TextBox) |
| If formItem("DataType").Text = "List-Text" Then |
| mydd.Visible = True |
| mytb.Visible = False |
| End If |
| End If |
| End Sub |