It would be very helpful if you could provide us a little more information about current configuration, such as the Grid markup and code behind code related to it.
For instance, I would need to understand what is in the markup the VB code is trying to access. Based on the code I am assuming there is a Template Column which you would like to access, similar to this example:
<asp:Label ID="lblEmpMsg" runat="server"></asp:Label>
Please note that the Grid has multiple types of items. HeaderItem, FooterItem, FilterItem, DataItem, etc... and the ItemDataBound applies for all, see Accessing rows.
You will need to apply a condition to the VB code that will check and only run the code for Dataitems, or otherwise, it may cause unexpected behavior.
Public Sub rgbt_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgbt.ItemDataBound
If TypeOf e.Item Is GridDataItem Then
Dim item As GridDataItem = CType(e.Item, GridDataItem)
Dim lblEmpMsg As Label = CType(e.Item.FindControl("lblEmpMsg"), Label)
Dim empMsgVal As String = lblEmpMsg.Text
If (empMsgVal = "" Or IsDBNull(empMsgVal)) Then
item.Enabled = True
item.Enabled = False
In addition to the markup I would also need to know which version of the Telerik controls have you upgraded from? That would help me search for changes in between.
Get quickly onboarded and successful
with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.