I have a couple of dropdownlists on my forTemplate but the fucntionality I need is the following. On Insert I need them to be avialable to pick data, but on Edit mode I want to disable them so that they cannot mess with them becuase they are not editable in edit mode. i thought the follwoing code would work but appears not. On insert mode or what i thought was insertmode it fills the ddl and it works for soem reason, but on edit or insert it disables my dropwdownlists.
Protected Sub myPOGrid_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myPOGrid.ItemDataBound
If (TypeOf e.Item Is IGridInsertItem AndAlso e.Item.IsDataBound) Then
Dim gr As DropDownList = DirectCast(e.Item.FindControl("ddlPOFund"), DropDownList)
sql = "Select intFundID, strPGMCDnum + ' \ ' + CASE WHEN intSourceId = 1 then 'FEDERAL' ELSE 'STATE' END + ' \ ' + strEorNum FUND from Drat_fundSource where bitArchive IS NULL"
gr.Items.Add(New ListItem("Pick Funding Source", "0"))
buildDD(sql, gr)
End If
If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
Dim editedItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
Dim PoFund As DropDownList = DirectCast(editedItem.FindControl("ddlPOFund"), DropDownList)
Dim FundS As DropDownList = DirectCast(editedItem.FindControl("ddlFundSource"), DropDownList)
PoFund.Enabled = False
FundS.Enabled = False
End If
End Sub