Im doing a prof of concept with the Telerik grid but i've hit a wall. I'm unable to access the userControl of the edit form. Here is a sample of my code.
ASPX
In the code behind, I am trying to access the user control but it always return 'nothing'.
Can anyone help me on this?
ASPX
<form id="form1" runat="server"> |
<telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True"> |
</telerik:RadScriptManager> |
<div> |
</div> |
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" GridLines="None"> |
<HeaderContextMenu EnableTheming="True"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</HeaderContextMenu> |
<MasterTableView EnableHeaderContextMenu="True"> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px" /> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px" /> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridEditCommandColumn> |
</telerik:GridEditCommandColumn> |
<telerik:GridTemplateColumn HeaderText="500226" UniqueName="ikSpecialty"> |
<ItemTemplate> |
<cc1:Label ID="lblSpecialtyRad" runat="server" Text='<%# GetListString("specialite", "ikspecialite", Container.DataItem("ikspecialite"), "cspecial", True) %>'></cc1:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
</Columns> |
<EditFormSettings UserControlName="uscProcedure.ascx" EditFormType="WebUserControl"> |
<EditColumn UniqueName="EditCommandColumn1"> |
</EditColumn> |
</EditFormSettings> |
</MasterTableView> |
<FilterMenu EnableTheming="True"> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</FilterMenu> |
</telerik:RadGrid> |
</form> |
In the code behind, I am trying to access the user control but it always return 'nothing'.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
If Not IsPostBack Then |
SetDatasource() |
RadGrid1.DataSource = GetIntervAss() |
End If |
End Sub |
Private Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource |
RadGrid1.DataSource = GetIntervAss().DefaultView |
End Sub |
Private Function GetIntervAss() As DataTable |
Return DirectCast(Session("dsData"), DataSet).Tables("interventions_associees") |
End Function |
' The MyUserControl is always = NOTHING |
Private Sub RadGrid1_EditCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.EditCommand |
Dim MyUserControl As UserControl = CType(e.Item.FindControl(Telerik.Web.UI.GridEditFormItem.EditFormUserControlID), UserControl) |
End Sub |
Can anyone help me on this?