I'm trying to implement a MaintainScrollPositionOnPostBack because I've had to move the 'overflow' from my BODY element to a child DIV (to resolve a touch-scrolling issue with RadComboBoxes in newer versions of Chrome.) The problem I'm running into is getting my hidden field AJAXified with the rest of my controls.
If I disable AJAX entirely, the script works perfectly (because the hidden field value is being persisted across postbacks.)
If I enable AJAX but exclude the hidden field from the RadAjaxManager AjaxSettings AjaxUpdatedControl the page works as expected, but the script doesn't (because the hidden field value isn't being persisted across postbacks.)
If I enable AJAX and include the hidden field in the RadAjaxManager's AjaxSettings AjaxUpdatedControl I get a "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)." exception.
The page in question has no scripts on it. The MasterPage's scripts are all wrapped in RadCodeBlock tags. I can't remove the HEAD element's runat="server" because of use. The problem occurs with both and input "s. Wrapping the hidden field in a RadCodeBlock prevents the exception, but does not persist the hidden field's value across postbacks.
Any suggestions you could offer that might point me in the right direction would be appreciated. (And no, I can't post the code--the site part of is proprietary and extremely sprawling.)

Hello,
I'm using a couple RadDatePickers in my UI. I have two that loads on pageload. They are rendering as lightweight normally. Then I have two more in my radGrid's Editform. they are set to render as lightweight as well but when I click on the edit button to open the edit form in the radgrid, all the dropdowns render inproperly.
here is my RadGrid:
<telerik:RadGrid ID="rgResults" runat="server" HeaderStyle-Font-Bold="true" AllowPaging="true" PageSize="10" OnItemCommand="rgResults_ItemCommand" OnNeedDataSource="rgResults_NeedDataSource" OnItemDataBound="rgResults_ItemDataBound" OnPreRender="rgResults_PreRender" AutoGenerateColumns="false"> <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="false"> <Selecting AllowRowSelect="true" UseClientSelectColumnOnly="true"></Selecting> <ClientEvents OnRowDblClick="rowDblClickCollectionBreak" /> </ClientSettings> <MasterTableView DataKeyNames="Accounts_Receivable_ID" InsertItemPageIndexAction="ShowItemOnCurrentPage" Font-Size="Smaller" CommandItemDisplay="Top"> <HeaderStyle CssClass="TableHeader" /> <AlternatingItemStyle BackColor="#DBDBDB" /> <Columns> <telerik:GridEditCommandColumn EditImageUrl="../Content/Images/checkGreen.png" /> <telerik:GridTemplateColumn UniqueName="commandColumn"> <ItemTemplate> <asp:ImageButton ID="btnDelete" runat="server" CommandName="Delete" Height="30px" Width="30px" ToolTip="Delete" ImageUrl="~/Content/Images/minusImg.png" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridBoundColumn HeaderText="Deposit Date" DataField="Deposited_Date" UniqueName="Deposited_Date" /> <telerik:GridBoundColumn HeaderText="Company Name" DataField="Company_Name" UniqueName="Company_Name" /> <telerik:GridBoundColumn HeaderText="Check Amount" DataField="Check_Amount" UniqueName="Check_Amount" /> <telerik:GridBoundColumn HeaderText="Check #" DataField="Check_Number" UniqueName="Check_Number" /> <telerik:GridBoundColumn HeaderText="Submitted" DataField="Submitted" UniqueName="Submitted" /> </Columns> <EditFormSettings EditColumn-ButtonType="ImageButton" EditColumn-EditText="" EditColumn-EditImageUrl="../Content/Images/plus.png" EditFormType="Template"> <FormTemplate> <div class="pad"> <div class="row"> <div class="col-lg-3"> <label>Received Date: </label> </div> <div class="col-lg-3"> <telerik:RadDatePicker RenderMode="Lightweight" runat="server" ID="ReceiveDate" Culture="en-US" Calendar-BackColor="Teal" DbSelectedDate='<%# Bind("Received_Date") %>' TabIndex="3" /> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Deposited Date: </label> </div> <div class="col-lg-3"> <telerik:RadDatePicker RenderMode="Lightweight" runat="server" ID="DepositDate" DbSelectedDate='<%# Bind("Deposited_Date") %>' TabIndex="4" /> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Company Name:</label> </div> <div class="col-lg-3"> <telerik:RadTextBox runat="server" ID="tbCompanyName" Text='<%# Bind("Company_Name") %>' TabIndex="5" /> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Check Amount:</label> </div> <div class="col-lg-3"> <telerik:RadTextBox runat="server" ID="tbCheckAmount" Text='<%# Bind("Check_Amount") %>' TabIndex="6" /> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Check Number:</label> </div> <div class="col-lg-3"> <telerik:RadTextBox runat="server" ID="tbCheckNum" Text='<%# Bind("Check_Number") %>' TabIndex="7" /> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Description:</label> </div> <div class="col-lg-3"> <telerik:RadTextBox runat="server" ID="tbDesc" Text='<%# Bind("Description_") %>' TabIndex="8" /> </div> </div> <div class="row top-pad"> <div class="col-lg-2"> <asp:Button ID="btnUpdate" CssClass="btn btn-block btn-success" Text='<%# (Container is GridEditFormInsertItem) ? "Add" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button> </div> <div class="col-lg-2"> <asp:Button ID="btnCancel" CssClass="btn btn-block btn-danger" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button> </div> </div> </div> </FormTemplate> </EditFormSettings> </MasterTableView> <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> </telerik:RadGrid>
Here is my two DatePickers on page load:
<div class="row text-center"> <div class="col-lg-3"> <div class="row"> <div class="col-lg-3"> <asp:Label runat="server" Text="From: " /> </div> <div class="col-lg-3"> <telerik:RadDatePicker RenderMode="Lightweight" ID="SearchByDateFrom" runat="server" Culture="en-US" /> </div> </div> </div> <div class="col-lg-3"> <div class="row"> <div class="col-lg-3"> <asp:Label runat="server" Text="To: " /> </div> <div class="col-lg-3"> <telerik:RadDatePicker RenderMode="Lightweight" ID="SearchByDateTo" runat="server" Culture="en-US" /> </div> </div> </div> <div class="col-lg-3"> <asp:Button class="btn btn-success btn-block" runat="server" OnClientClick="saveNewSearch()" OnClick="btnSearch_Click" type="button" Text="Search"></asp:Button> </div> </div>I am using RadListBox to show a list of items. Each item has an icon. The requirement is jumping on the item when a the first letter of that item is pressed.
For example: It should focus on "Dock" when letter "D" is pressed
Is there any built-in feature to accomplish this?
Hi Telerik,
I tried to find the text from combobox doesn't work using the normal dropdownlist javascript as below
<telerik:RadScriptBlock ID="rsbAction" runat="server">
<script type="text/javascript">
function action(sender, args) {
var rcbCategory = document.getElementById('<%=rcbCategory.ClientID %>');
var result = false;
if (rcbCategory != null)
if (rcbCategory.selectedIndex > 0)
result = true;
args.IsValid = result;
}
</script>
</telerik:RadScriptBlock>
I as well tried the code provided by the sample also doesn't work as below :
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function category(sender, args) {
var result = false;
var rcbCategory = $find("<%=rcbCategory.ClientID %>");
var rcbCategoryText = rcbCategory.get_text();
if (rcbCategoryText.Length > 1) {
var node = rcbCategory.findItemByText(rcbCategoryText);
if (node) {
var value = node.get_value();
if (value.length > 0 && value % 2 == 0)
result = true;
}
}
args.IsValid = result;
}
</script>
</telerik:RadScriptBlock>
Thank you.

i have a plain page with raddatepicker, but upon click it shows only # on the url and no calendar pop up.
See image below.
Thanks
I have seen other postings about Ajax messing up controls that are exporting to excel but I am not sure what to do since the entire user control has been ajaxified.
I have a web page that has a user control:
<telerik:RadAjaxManagerProxy ID="ramPackingSlip" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ramPackingSlip">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="lblError" />
<telerik:AjaxUpdatedControl ControlID="lblPageHeading" />
<telerik:AjaxUpdatedControl ControlID="pnlButtons" /
<telerik:AjaxUpdatedControl ControlID="ucPackSlipItemPickListInfo" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
In the user control there is a grid and a button that I am using to export the grid contents to Excel:
Button to Export To Excel:
<asp:ImageButton ID="btnExcel" runat="server" ImageUrl="~/Images/ExportToExcel_up.png"
onmouseover="this.src='../images/ExportToExcel_ovr.png'" onmouseout="this.src='../images/ExportToExcel_up.png'"
OnClick="ibExportToExcel_Click" AlternateText="Xlsx" />
Button code behind:
protected void ibExportToExcel_Click(object sender, EventArgs e)
{ string joinInfo = string.Empty;
string extraInfo = string.Empty;
rgToolSelection.Rebind();
rgToolSelection.ExportSettings.OpenInNewWindow = true;
rgToolSelection.ExportSettings.ExportOnlyData = true;
rgToolSelection.ExportSettings.FileName = "RadGridExport";
rgToolSelection.MasterTableView.ExportToExcel();
}
Grid on the user control:
<telerik:RadGrid ID="rgToolSelection"
runat="server"
AllowPaging="true"
PageSize="100000"
GridLines="None"
AllowSorting="True"
DataSourceID="odsToolSelected"
EnableEmbeddedSkins="false"
AllowMultiRowSelection="true"
AllowAutomaticUpdates="true"
OnItemCommand="rgToolSelection_ItemCommand"
OnItemDataBound="rgToolSelection_ItemDataBound">
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
<HeaderStyle HorizontalAlign="Center" />
<ClientSettings>
</ClientSettings>
<MasterTableView ClientDataKeyNames="ToolID" DataKeyNames="ToolID" AutoGenerateColumns="false" AllowAutomaticDeletes="True" EditMode="InPlace">
<Columns>
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"
FilterControlAltText="Filter DeleteColumn column" HeaderText="Deselect"
ImageUrl="~/Images/Trash.gif" Text="Delete"
UniqueName="DeleteColumn" Resizable="false" ConfirmText="Remove Record?">
<HeaderStyle CssClass="rgHeader ButtonColumnHeader"></HeaderStyle>
<ItemStyle CssClass="ButtonColumn" />
</telerik:GridButtonColumn>
<telerik:GridTemplateColumn UniqueName="SerialNumber" HeaderText="Serial Number"
SortExpression="Serial_Number" ItemStyle-Wrap="false">
<ItemTemplate>
<asp:Image ID="imgStatus" runat="server"
Visible="true" />
<%# Eval("SerialNumber", "{0}")%>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn UniqueName="ToolName" HeaderText="Tool Name" DataField="ToolName" AllowSorting="false" />
<telerik:GridBoundColumn UniqueName="ComponentName" HeaderText="Component Name" DataField="ComponentName" AllowSorting="false" />
<telerik:GridBoundColumn UniqueName="SystemStatus" HeaderText="System Status" DataField="Status" AllowSorting="false" />
<telerik:GridBoundColumn UniqueName="ToolSizeName" HeaderText="Size" DataField="ToolSizeNameWithMM" AllowSorting="false" />
<telerik:GridTemplateColumn UniqueName="TemplateMoreInfoColumn" HeaderText="">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:ImageButton ID="ibMoreToolInfo" runat="server" ImageUrl="~/Images/Info.gif" OnClientClick="return false" />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="IntendedUse" HeaderText="Intended Use">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:RadioButtonList ID="rblIntendedUse" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Land" Value="L" />
<asp:ListItem Text="Offshore" Value="O" />
</asp:RadioButtonList>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Leasing" HeaderText="Leasing">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:RadioButtonList ID="rblLeasing" RepeatDirection="Horizontal" runat="server">
<asp:ListItem Text="Monthly" Value="M" />
<asp:ListItem Text="Long Term" Value="L" />
<asp:ListItem Text="None" Value="*" Selected="True" />
</asp:RadioButtonList>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="Value" HeaderText="Value">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<telerik:RadNumericTextBox ID="rntbItemValue" runat="server" Width="60px" NumberFormat-DecimalDigits="2"
EnableEmbeddedSkins="false" EnabledStyle-HorizontalAlign="Right">
</telerik:RadNumericTextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="DontPrint" HeaderText="Don't Print">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:CheckBox ID="chkDontPrint" runat="server"></asp:CheckBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="IsDefaultConsignment" HeaderText="Consignment">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:CheckBox ID="chkIsDefaultConsignment" runat="server"></asp:CheckBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="CommunityValue" HeaderText="Community">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:RadioButtonList ID="rblCommunity" RepeatDirection="Horizontal" runat="server">
<asp:ListItem Text="FCG" Value="1" />
<asp:ListItem Text="IPR" Value="2" />
<asp:ListItem Text="EU" Value="3" />
<asp:ListItem Text="None" Value="*" Selected="True" />
</asp:RadioButtonList>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="HTS" HeaderText="HTS">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<telerik:RadTextBox ID="rtbHTS" runat="server" EnableEmbeddedSkins="false" Columns="10">
</telerik:RadTextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="FieldTicket" HeaderText="Field Ticket" ItemStyle-VerticalAlign="Top">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<telerik:RadTextBox ID="rtbFieldTicket" runat="server" EnableEmbeddedSkins="false"
Columns="10">
</telerik:RadTextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>
I came across this issue and have been looking for awhile. In a radgrid control in edit mode I have a dropdownlist control and the font weight for the label is not bold. How can I do this? Also, in edit mode I have a radtextbox and it's label font weight is bold and can't be changed.
Thank you in advance.
Jim
