I am using VS2013 framework 4.5 and telerik version 2014.1.403.45
RadComboBox not showing the items on clicking on it. The defination is like this-
<telerik:RadComboBox ID="cmbjobType" runat="server" Skin="Web20"
EmptyMessage="--Please Select--">
<Items>
<telerik:RadComboBoxItem Value="0" Text="Repair" />
<telerik:RadComboBoxItem Value="1" Text="Additional" />
<telerik:RadComboBoxItem Value="2" Text="Modify" />
</Items>
</telerik:RadComboBox>
RadTextBox also not working properly, the Empty message is not clearing on clicking on the textbox
<telerik:RadTextBox ID="txtProjTitle" EmptyMessage="Enter Project Title" CssClass="TextBox" runat="server"></telerik:RadTextBox>
and i face some more issues is this some version problem, please suggest.
I have added the following to my master Page
<telerik:RadScriptManager ID="RadScriptManager1" AsyncPostBackTimeout="6000000" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
</Scripts>
</telerik:RadScriptManager
It might getting conflict with ToolScriptManager, once i removed these lines of COde , all my ajax and telerik controls worked as expected.
Related
I have a GridButtonColumn in my RadGrid and I want to open a ModalPopupExtender on click event of the GridButtonColumn. Now the problem is what do I have to give in TargetControlID in my ModalPopupExtender?
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID=""
RepositionMode="RepositionOnWindowResize" PopupCo## Heading##ntrolID="TargetTemplatePanel"
BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
You can set the ModalPopupExtender's TargetControlID to pretty much any server-side control you want. Here's an example from a project of mine:
<div id="rscmain" runat="server">
<telerik:RadScriptManager ID="SM1" runat="server" EnablePageMethods="true" />
</div>
<asp:ModalPopupExtender ID="MPE1" runat="server" TargetControlID="rscmain" />
I've been trying to get the AjaxControlToolkit (downloaded from NuGet) version 7.0607 to work for web forms that use a masterpage with no luck.
Running DotNet 4.5
The MasterPage has the ToolkitScriptManager on it, but it does not pass down to child pages.
I can create a standalone aspx page, drop a scriptmanager on the page and the controls work just fine, so I figure there is a setting missing.
What is the procedure for making this work?
The masterpage script block is as so:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="AjaxControlToolkit" Name="ExtenderBase.BaseScripts.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit" Name="Common.Common.js" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
</Scripts>
</ajaxToolkit:ToolkitScriptManager>
no bug, just bad advice from another forum.
The following lines were the culprit - either one messes up things:
<asp:ScriptReference Assembly="AjaxControlToolkit" Name="ExtenderBase.BaseScripts.js" />
<asp:ScriptReference Assembly="AjaxControlToolkit" Name="Common.Common.js" />
Replacing the Microsoft script manager with toolkit script manger did the trick for me and they are working.
<asp:ScriptManager ID="ScriptManager1" runat="server">
with
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
I wrote the following code, based on telerik examples:
<telerik:RadComboBox ID="rcbPageSize"
runat="Server"
skin="Gray"
AllowCustomText="true"
Style="float:right; margin-left: 5px;"
Width="60px"
OnClientTextChange = "PageSizeChanged"
OnClientSelectedIndexChange = "PageSizeChanged">
<Items>
<telerik:RadComboBoxItem runat="Server" Text="10" Value="10" />
<telerik:RadComboBoxItem runat="Server" Text="20" Value="20" Selected="true" />
<telerik:RadComboBoxItem runat="Server" Text="50" Value="50" />
<telerik:RadComboBoxItem runat="Server" Text="150" Value="150" />
<telerik:RadComboBoxItem runat="Server" Text="250" Value="250" />
</Items>
</telerik:RadComboBox>
<telerik:RadCodeBlock ID="rcb" runat="server">
<script type="text/javascript">
function PageSizeChanged(sender, eventArgs) {
alert("You typed " + sender.get_text());
}
</script>
</telerik:RadCodeBlock>
When I change the selection, the function "PageSizeChanged" is called, but when I change the text by typing inside the combobox, the function is never called.
Anyone has a suggestion why?
Thanks,
Inbal.
I find it's definitely a 'feature' of this Telerik control. If you use your code, type something, press enter and then click outside the box the event will fire.
Just pressing enter or just clicking outside don't fire it on their own.
I'm using a slightly newer version of the Telerik controls as the skin Gray has been deprecated but I'm assuming it will be the same in your version.
OnClientTextChange WILL NOT fire until the user hits Enter or clicks outside the RadComboBox. Says so here: http://www.telerik.com/help/aspnet-ajax/combobox-onclienttextchange.html
You will have to set AutoPostBack="true", to fire server events.
<telerik:RadComboBox ID="rcbPageSize"
AutoPostBack="true"
runat="Server"
skin="Gray"
AllowCustomText="true"
Style="float:right; margin-left: 5px;"
Width="60px"
OnClientTextChange = "PageSizeChanged"
OnClientSelectedIndexChange = "PageSizeChanged">
Here is the problem im having. I have 5 buttons on my form that appear next to each other (horizontal). 3 out of the 5 buttons had to be put in an update panel b/c these buttons have to do AsyncPostBack, the other 2 buttons need to be outside to do a postback. Everything works the way I would like accept that all the buttons dont appear on the same line. Is there anything I can do put get these 5 buttons to appear on the same line, given the different functionality of these buttons?
The UpdatePanel renders a <div> you need to style this div so that that it displays inline Notice the Style="display:inline" in the following code. There's other ways to accomplish this depending on your layout but this is the most straightforward.
<asp:UpdatePanel ID="UpdatePanel1" runat="server" Style="display:inline">
<ContentTemplate>
<asp:Label ID="labelText" runat="server" Text="Label" />
<asp:Button ID="Button1" runat="server" Text="Button1" />
<asp:Button ID="Button2" runat="server" Text="Button2" />
<asp:Button ID="Button3" runat="server" Text="Button3" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="Button4" runat="server" Text="Button4" />
<asp:Button ID="Button5" runat="server" Text="Button5" />
You don't have to have your buttons inside the UpdatePanel to make this work. You would simply need to define them as AsyncPostBackTriggers. You don't have to worry about breaking your layout then.
<div class="toolbar">
<asp:Button ID="Button1" runat="server" Text="Button1" />
<asp:Button ID="Button2" runat="server" Text="Button2" />
<asp:Button ID="Button3" runat="server" Text="Button3" />
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="labelText" runat="server" Text="Label" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="Button2" EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="Button3" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
I'm using GridView and there is a dropdownlist in header cell for filtering.
<gm:GridView ID="routePlanGridView" runat="server" AutoGenerateColumns="False"
AllowPaging="true" PageSize="20" GridLines="Both" ShowFooter="true" CssClass="grid"
DataKeyNames="RoutePlanId" OnSorting="routePlanGridView_Sorting"
AllowSorting="true" OnPageIndexChanging="routePlanGridView_PageIndexChanging"
OnSelectedIndexChanging="routePlanGridView_SelectedIndexChanging"
OnRowDataBound="routePlanGridView_RowDataBound"
OnRowEditing="routePlanGridView_RowEditing"
OnRowUpdating="routePlanGridView_RowUpdating">
<HeaderStyle CssClass="gridHeaderFooter" />
<FooterStyle CssClass="gridHeaderFooter" />
<RowStyle CssClass="gridRow" />
<AlternatingRowStyle CssClass="gridRowAlternate" />
<Columns>
<asp:TemplateField SortExpression="SPName">
<HeaderTemplate>
SP Name<br />
<asp:DropDownList ID="spNameFilterDDL" runat="server" CssClass="gridControl" AutoPostBack="true" DataSourceID="SPNameSDS" DataTextField="SPName" OnDataBound="filterDDL_DataBound" OnSelectedIndexChanged="spNameFilterDDL_SelectedIndexChanged" />
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="spNameLabel" runat="server" Text='<%# Bind("SPName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<...15 more...>
</Columns>
</gm:GridView>
and there are relevant event handlers for sorting and paging.
Now the problem is if I put "SP Name" text in a link button, page crashes when link clicked, otherwise no link produced to sort.
If I remove Header Template fields (all of them) and put a text with HeaderText attribute of TemplateField it works as expected. Is there a way to put them together? I need that dropdown and also sorting.
Thanks.
sorry, forgot to insert the code correctly - here:
<asp:LinkButton runat="server" Text="SP Name" CommandName="Sort" CommandArgument="SPName" ></asp:LinkButton>
You need to use a link button for your header text. So in place of "SP Name", use . It should work if you are handling sorting.