ScriptManager.RegisterStartupScript(),grid does not retain the inline mode i.e. row for adding new record gets disappears.
e.Item.OwnerTableView.IsItemInserted = true;
RadGrid.Rebind()
but its not working
<telerik:RadGrid ID="SpGrid" runat="server" AllowMultiRowSelection="False" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="false" PageSize="7" ShowStatusBar="true" Skin="Outlook"> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"> </HeaderContextMenu> <PagerStyle Mode="NumericPages" /> <MasterTableView AllowMultiColumnSorting="True" CommandItemDisplay="Top" DataKeyNames="SPECIALITY_ID" Name="Specialist"> <Columns> <telerik:GridEditCommandColumn HeaderText="Edit" UniqueName="EditCommandColumn"> <ItemStyle Width="50px" /> </telerik:GridEditCommandColumn> <telerik:GridBoundColumn DataField="SPECIALITY_ID" HeaderButtonType="TextButton" HeaderText="SPECIALITY ID" SortExpression="SPECIALITY_ID" UniqueName="SPECIALITY_ID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="SPECIALITY_DESC" HeaderButtonType="TextButton" HeaderText="DESCRIPTION" SortExpression="SPECIALITY_DESC" UniqueName="SPECIALITY_DESC"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText="Delete this Specialist ?" Text="Delete" UniqueName="DeleteColumn1"> <HeaderStyle Width="20px" /> <ItemStyle CssClass="MyImageButton" HorizontalAlign="Center" /> </telerik:GridButtonColumn> </Columns> <EditFormSettings EditFormType="Template"> <FormTemplate> <table ID="tblSpecialitymaster" border="1" cellpadding="1" cellspacing="2" rules="none" style="border-collapse: collapse; background: white;" width="100%"> <tr class="EditFormHeader"> <td colspan="2" style="font-size: small; font-family: Verdana;color:Maroon"> <b>SpecialityDetail</b> </td> </tr> <tr> <td> <table ID="Table3" border="0" cellpadding="1" cellspacing="1" class="module" width="250"> <tr> <td> </td> <td> </td> </tr> <tr> <td> SpecialityID: </td> <td> <asp:TextBox ID="txtSpId" runat="server" Font-Names="verdana" Text='<%# Bind("SPECIALITY_ID") %>' Font-Size="8.5pt" MaxLength="50" TabIndex="1" ReadOnly="true"> </asp:TextBox> </td> </tr> <tr> <td> Description: </td> <td> <asp:TextBox ID="txtSpDesc" runat="server" Font-Names="verdana" Font-Size="8.5pt" MaxLength="50" onkeypress=" return CharOnly('txtSpDesc',50)" TabIndex="2" Text='<%# Bind("SPECIALITY_DESC") %>' > </asp:TextBox> <asp:RequiredFieldValidator ID="RFVSpDesc" runat="server" ErrorMessage="Enter Description." ControlToValidate="txtSpDesc"></asp:RequiredFieldValidator> </td> </tr> </table> </td> </tr> <tr> <td align="right" colspan="2"> <asp:Button ID="btnUpdate3" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' Style="color: White; background-color: SteelBlue; font-family: Verdana; font-size: 8pt; width: 87px;" runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'> </asp:Button> <asp:Button ID="btnCancel3" runat="server" CausesValidation="False" CommandName="Cancel" Style="color: White; background-color: SteelBlue; font-family: Verdana; font-size: 8pt; width: 87px;" Text="Cancel" /> </td> </tr> </table> </FormTemplate> </EditFormSettings> </MasterTableView></telerik:RadGrid>function valid() {var grid = $find("<%=RadGridCountry.ClientID %>");var detail= grid.get_detailTables()[0].get_dataItems()[0].findElement("txtSpDesc");}
i trace that detail value it giving always null value<AjaxSettings> <telerik:AjaxSetting AjaxControlID="uxRadPager"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="uxPhotos" LoadingPanelID="uxAjaxLoadingPanel" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="uxPhotos"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="uxRadPager" LoadingPanelID="uxAjaxLoadingPanel" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings><telerik:RadListView runat="server" ID="uxPhotos" AllowPaging="true" OnNeedDataSource="uxPhotos_NeedDataSource" OnItemDataBound="uxPhotos_ItemDataBound" ViewStateMode="Enabled"> <LayoutTemplate> <asp:Table ID="Table3" runat="server" CellPadding="0" CellSpacing="0"> <asp:TableRow> <asp:TableCell> <fieldset runat="server" id="itemPlaceholder" /> </asp:TableCell> </asp:TableRow> </asp:Table> <telerik:RadDataPager ID="uxRadPager" Skin="Vista" runat="server" PagedControlID="uxPhotos" PageSize="10" ViewStateMode="Enabled"> <Fields> <telerik:RadDataPagerButtonField FieldType="FirstPrev" /> <telerik:RadDataPagerButtonField FieldType="Numeric" /> <telerik:RadDataPagerButtonField FieldType="NextLast" /> <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " /> <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go" TextBoxWidth="15" /> </Fields> </telerik:RadDataPager> </LayoutTemplate> <ItemTemplate> <fieldset style="float: left; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; vertical-align: middle; text-align: center; width: 90px; border: 0px;"> <asp:Table runat="server" CellPadding="0" CellSpacing="0"> <asp:TableRow> <asp:TableCell Style="position: relative"> <div style="position: relative"> <asp:Image runat="server" ImageUrl="~/Images/ThumbnailBg.jpg" /> <div id="Div1" runat="server" style="position: absolute; left: 10px; top: 10px; z-index: 1;"> <asp:HyperLink runat="server" ID="uxPhotoLink"> <asp:Image runat="server" ID="uxPhoto" /></asp:HyperLink> <div id="Div2" runat="server" style="position: absolute; left: 62px; top: -10px; z-index: 2; height: 20px; width: 20px"> <asp:Image runat="server" ID="uxStatus" ImageUrl="~/Images/StatusEdit.png" /> </div> </div> </div> </asp:TableCell> </asp:TableRow> </asp:Table> </fieldset> </ItemTemplate> </telerik:RadListView>Hi,
I am having a combobox like this,
<telerik:RadComboBox ID="txtDoctorId" runat="server" AutoPostBack="true" AllowCustomText="true"
ExpandAnimation-Type="Linear" CollapseAnimation-Type="Linear" Width="300px" EnableLoadOnDemand="true"
Filter="Contains">
<HeaderTemplate>
<table>
<tr>
<td style="width: 80px;">
Code
</td>
<td style="width: 220px;">
Consultant Name
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table>
<tr id="cmbRow">
<td id="cellCode" style="width: 80px">
</td>
<td id="cellName" style="width: 220px">
</td>
</tr>
</table>
</ItemTemplate>
</telerik:RadComboBox>
I have to find the htmltablecell inside the itemtemplate during itemdatabound
plz help me..Thnx in advance....
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> <script type="text/javascript" language="javascript"> function refreshGrid(arg) { if (!arg) { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); } } </script></telerik:RadCodeBlock><telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadCodeBlock1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="rgd_Labor" UpdatePanelHeight="" /> <telerik:AjaxUpdatedControl ControlID="rgd_Materials" UpdatePanelHeight="" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager>protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem item = e.Item as GridEditableItem; RadDateTimePicker startDate = (RadDateTimePicker)item.FindControl("startDate"); TableCell cell = (TableCell)start.Parent; CompareValidator CV1 = new CompareValidator(); CV1.ErrorMessage = "*"; CV1.ControlToValidate = startDate.ID; CV1.Operator = ValidationCompareOperator.GreaterThanEqual; CV1.ValueToCompare = DateTime.Now.ToString(); cell.Controls.Add(CV1); } }