Hi,
How to find child controls that are located under the <FormTemplate> tag of RadControl.
<telerik:RadGrid PageSize="3" AllowPaging="true" ID="RadGrid1" runat="server" GridLines="Horizontal"
AllowFilteringByColumn="true" Skin="WebBlue" AllowAutomaticDeletes="True" OnNeedDataSource="RadGrid1_NeedDataSource"
OnDeleteCommand="RadGrid1_DeleteCommand" OnInsertCommand="RadGrid1_InsertCommand"
OnUpdateCommand="RadGrid1_UpdateCommand"
onitemcommand="RadGrid1_ItemCommand" onitemcreated="RadGrid1_ItemCreated">
<PagerStyle Mode="Slider" />
<MasterTableView AutoGenerateColumns="false" DataKeyNames="TerritoryID" EditMode="EditForms"
CommandItemDisplay="TopAndBottom">
<Columns>
<telerik:GridEditCommandColumn>
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn ReadOnly="true" HeaderText="TerritoryID" DataField="TerritoryID"
UniqueName="TerritoryID" />
<telerik:GridBoundColumn ReadOnly="false" HeaderText="TerritoryDescription" DataField="TerritoryDescription"
UniqueName="TerritoryDescription" />
<telerik:GridBoundColumn ReadOnly="false" HeaderText="RegionID" DataField="RegionID"
UniqueName="RegionID" />
<telerik:GridButtonColumn CommandName="Delete" Text="Delete">
</telerik:GridButtonColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
<FormTemplate>
<table id="Table2" cellspacing="2" cellpadding="1" width="250" border="1" rules="none"
style="border-collapse: collapse">
<tr>
<td>
<table id="Table3" cellspacing="1" cellpadding="1" width="250" border="0">
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
TerritoryID:
</td>
<td>
<asp:TextBox ID="txtTerritoryID" MaxLength="5" Visible='<% # (Container as GridItem).OwnerTableView.IsItemInserted %>'
runat="server">
</asp:TextBox>
</td>
</tr>
<tr>
<td>
TerritoryDescription:
</td>
<td>
<asp:CheckBox ID="CheckBox1" runat="server"></asp:CheckBox>
</td>
</tr>
<tr>
<td>
RegionID:
</td>
<td>
<asp:TextBox ID="txtRegionID" runat="server" Text='<%# Eval( "RegionID") %>' TabIndex="1">
</asp:TextBox>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<b>Territory Info:</b>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="btnUpdate" Text='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "Insert" : "Update" %>'
runat="server" CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'>
</asp:Button>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel"></asp:Button>
</td>
</tr>
</table>
</FormTemplate>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
I want to Find out that Controls which I placed inside the RadGrid , such as txtRegionID, CheckBox1…. From code behind.So that I can bind my required data to the thouse controls.
Hi,
I have struck up with one scenario as follow.
I have taken one RadCombo Box under RadGrid’s <FormTemplate> Tag (You can see following Code for referral).
I want to bind the Data to the RadCombo at run time. Any one can pls help me in this regards.
At least pls guide with any sample program/code with same scenario.
<%@ Page Language="C#" MasterPageFile="~/Matrix_MasterPage.master" AutoEventWireup="true"
CodeFile="addsubmenus.aspx.cs" Inherits="addsubmenus" Title="Untitled Page" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
</telerik:RadCodeBlock>
<table width="100%" style="height: Auto" width="80%" class="TableBackGround" cellpadding="0"
cellspacing="0">
<td style="height: 21px" colspan="6" class="MenuSubHeading">
Add Submenu
</td>
</tr>
<tr>
<td style="height: 100px">
<telerik:RadGrid ID="rgSubmenus" runat="server" AllowPaging="True" GridLines="Horizontal"
Skin="WebBlue" OnNeedDataSource="rgSubmenus_NeedDataSource" PageSize="10" Width="70%"
OnInsertCommand="rgSubmenus_InsertCommand" OnItemDataBound="rgSubmenus_ItemDataBound" OnItemCreated="rgSubmenus_ItemCreated">
<PagerStyle Mode="Slider" />
<MasterTableView CommandItemDisplay="TopAndBottom" AutoGenerateColumns="false" DataKeyNames="submenuid"
EditMode="EditForms">
<Columns>
<telerik:GridBoundColumn DataField="submenuid" HeaderText="SubMenu ID" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="mainmenuid" HeaderText="MainMenu ID" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="15%" Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="mainmenuname" HeaderText="MainMenu Name" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="15%">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="submenuname" HeaderText="SubMenu Name" HeaderStyle-HorizontalAlign="Center"
ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="15%">
</telerik:GridBoundColumn>
….. So On.
</Columns>
<EditFormSettings EditFormType="Template">
<EditColumn UniqueName="EditCommandColumn1">
</EditColumn>
<FormTemplate>
<table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="red">
<tr>
<td width="49%" align="right">
Select MainMenu
</td>
<td width="2%">
:
</td>
<td width="49%" align="left">
<telerik:RadComboBox ID="ddlMainmenus" runat="server" MarkFirstMatch="True" Skin="WebBlue"
EmptyMessage="Select Mainmenu" Width="150px">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td width="49%" align="right">
Submenu Name …………………So on….
C#Code:-
I am trying to bind this by using
protected void rgSubmenus_ItemDataBound(object sender, GridItemEventArgs e)
{
if(e.Item is GridEditableItem && e.Item.IsInEditMode)
{
RadComboBox cboInstructor = (RadComboBox)e.Item.FindControl("ddlMainmenus");
………
}
}
But I am nt able to Bind. Pls help me in this regards….!
| var hasReservations = null; |
| function OnClientAppointmentDoubleClick(sender, eventArgs) |
| { |
| var strId = eventArgs.get_appointment().get_id().substring(0, 36); |
| WebServices.SiteService.EventHasRegistration(strId, OnLookupComplete, OnError); |
| if(hasReservations == null || hasReservations== 'undefined') |
| { |
| eventArgs.set_cancel(true); |
| radalert("Validation service currently unavailable. Editing events are not available at this time."); |
| return; |
| } |
| if(hasReservations) |
| { |
| radalert("Some occurrences of this series have reservations assigned to them, they will not be modified."); |
| eventArgs.set_cancel(true); |
| } |