I am trying to get this functionality to work :
https://docs.telerik.com/devtools/aspnet-ajax/controls/button/how-to/radbutton-validation-and-client-side-event-handlers
however it seems as though Page_ClientValidate (or Page_IsValid) is always returning true.
Ultimately I need to be able to run different scripts depending on whether or not the page has errors.
Hey
I am trying to set the padding for the DateInput. I can set it using the following:
<telerik:RadDatePicker ID="RadExpDate" runat="server" RenderMode="Lightweight" Height="23px" ShowPopupOnFocus="true" DateInput-EmptyMessage="mm/dd/yyyy">
<DateInput runat="server" EmptyMessageStyle-PaddingTop="2" EnabledStyle-PaddingTop="2" FocusedStyle-PaddingTop="2" ></DateInput>
</telerik:RadDatePicker>
Was wondering if the was a setting in CSS to set the padding once regardless of the state of the control (ie: Empty, Enable, etc)?
Thanks
Tom

I'm trying to create a RadGrid with ClientDatasource connected to a Webservice to get, update and delete data. I created everything like the example. Unfortunately the behaviour is very strange / inconsistent. The "Get" Mathot works fine. The "Add" method on the other hand seems to work only once or sometimes twice before reloading the page completely. The "Delete" and and "Edit" Method seem not to get triggered at all.
Its cannot be a problem of the Webservice since I can manually ( over http ) trigger all of the methods without a problem. Furthermore it seems that all the parameters passed to the WS get lost. Can anyone give me an advice on what I am doing wrong here?
Here is my code:
JS:
<script type="text/javascript"> //<![CDATA[ function ParameterMap(sender, args) { if (args.get_type() != "read" ) { args.set_parameterFormat("{ 'parameterName': 'test' }"); } } function UserAction(sender, args) { if (sender.get_batchEditingManager().hasChanges(sender.get_masterTableView()) && !confirm("Any changes will be cleared. Are you sure you want to perform this action?")) { args.set_cancel(true); } } //]]></script>
ASPX:
<telerik:RadGrid runat="server" ID="RadGrid1" ClientDataSourceID="RadClientDataSource1" ResolvedRenderMode="Classic" AllowFilteringByColumn="true" FilterType="HeaderContext" EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="true" PagerStyle-AlwaysVisible="true" AllowSorting="true" AllowPaging="True" CellSpacing="-1" GridLines="Both"> <MasterTableView DataKeyNames="associationid" EditMode="Batch" CommandItemDisplay="Top" BatchEditingSettings-HighlightDeletedRows="true"> <Columns> <telerik:GridBoundColumn DataField="associationid" HeaderText="associationid" UniqueName="column"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="objectida" HeaderText="objectida" UniqueName="column1"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="objectidb" HeaderText="objectidb" UniqueName="column2"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="objectnamea" HeaderText="objectnamea" UniqueName="column3"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="objectnameb" HeaderText="objectnameb" UniqueName="column4"> </telerik:GridBoundColumn> <telerik:GridClientDeleteColumn HeaderText="Delete"> <HeaderStyle Width="70px" /> </telerik:GridClientDeleteColumn> </Columns> </MasterTableView> <ClientSettings> <ClientEvents OnUserAction="UserAction" /> </ClientSettings> </telerik:RadGrid> <telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="True" > <ClientEvents OnCustomParameter="ParameterMap" /> <DataSource > <WebServiceDataSourceSettings BaseUrl="http://localhost/DataService/DataService.svc/" ServiceType="Default"> <Select Url="GetAssocs" DataType="JSON" /> <Update Url="UpdateAssoc" DataType="JSON" /> <Insert Url="AddAssoc" DataType="JSON" /> <Delete Url="DeleteAssoc" DataType="JSON" /> </WebServiceDataSourceSettings> </DataSource> <Schema> <Model ID="associationid"> <telerik:ClientDataSourceModelField FieldName="associationid" DataType="String" /> <telerik:ClientDataSourceModelField FieldName="objectida" DataType="String" /> <telerik:ClientDataSourceModelField FieldName="objectidb" DataType="String" /> <telerik:ClientDataSourceModelField FieldName="objectnamea" DataType="String" /> <telerik:ClientDataSourceModelField FieldName="objectnameb" DataType="String" /> </Model> </Schema> </telerik:RadClientDataSource>
Webservice:
[ServiceKnownType(typeof(Association))][AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]public class DataService : IDataService{ [WebGet] public List<Association> GetAssocs() { using (EventLog eventLog = new EventLog("Application")) { eventLog.Source = "Application"; eventLog.WriteEntry("Log message GET", EventLogEntryType.Information, 101, 1); } List<Association> x = new List<Association>(); for (int i = 0; i < 10; i++) { Association a = new Association(); a.associationid = i.ToString(); a.objectida = i.ToString(); a.objectidb = i.ToString(); a.objectnamea = i.ToString(); a.objectnameb = i.ToString(); x.Add(a); } return x; } [WebGet] public void UpdateAssoc(string JSONstring) { try { using (EventLog eventLog = new EventLog("Application")) { eventLog.Source = "Application"; eventLog.WriteEntry("Log " + JSONstring.ToString(), EventLogEntryType.Information, 101, 1); } } catch (Exception ex) { throw ex; } } [WebGet] public void AddAssoc(string JSONstring) { using (EventLog eventLog = new EventLog("Application")) { eventLog.Source = "Application"; eventLog.WriteEntry("Log message ADD", EventLogEntryType.Information, 101, 1); } } [WebGet] public void DeleteAssoc(string JSONstring) { using (EventLog eventLog = new EventLog("Application")) { eventLog.Source = "Application"; eventLog.WriteEntry("Log message DELETE", EventLogEntryType.Information, 101, 1); } }}
and
[ServiceContract] public interface IDataService { [OperationContract] [WebGet] List<Association> GetAssocs(); [OperationContract] [WebGet] void UpdateAssoc(string JSONstring); [OperationContract] [WebGet] void AddAssoc(string JSONstring); [OperationContract] [WebGet] void DeleteAssoc(string JSONstring); } [DataContract] public class Association { [DataMember] public string associationid { get; set; } [DataMember] public string objectida { get; set; } [DataMember] public string objectidb { get; set; } [DataMember] public string objectnamea { get; set; } [DataMember] public string objectnameb { get; set; } }
Hi All,
I am using Telerik Datetime picker in my ASP.net web application, but In C# while selecting the date from the control, I am loosing the datetime offset value and fraction of second value.
Please help.
Thanks,
S2
I know this has been asked multiple times, but i still cannot set the initial page of Kendo Grid
@(Html.Kendo().Grid<TherapistViewModel>().Name("KendoTherapistGrid").AutoBind(false).Columns(columns =>{ ---BOUND COLUMNS--- }).Events(e=>e.DataBound("onRowBound")).Pageable(pageable => pageable.Refresh(true).PageSizes(true).ButtonCount(5)).Filterable().Sortable().DataSource(dataSource => dataSource .Ajax() .PageSize(20) .Model(model => model.Id(p => p.TherapistId)) .Read(read => read.Action("GetTherapistdata", "Therapist").Data("PatientDetails")) ) )
Since AutoBind if false, I am calling ReadDataSource when the document is ready
$(document).ready(function () { ReadDataSource();});function ReadDataSource(){ $("#KendoTherapistGrid").data().kendoGrid.dataSource.page(2);}
I am hard-coding the page number for now until I get can it to work. There are three pages in the grid.
We have a lightweight tabstrip using the "Simple" skin. We'd like to call attention to a single tab by giving it a different color via a style. We're able to change it by using "tab1.backcolor=Color.Lime" but would prefer if we can have the tab have a secondary style so we can control it's parameters via css.
We tried the following and it successfully changes the single tab font-weight but the background color gets overwritten by the Simple skin:
tab1.CssClass = "highlight-tab";
html .highlight-tab {
font-weight: bold !important;
background-color: Lime !important;
}
We also the following to try and supplement the RadTabStrip_Simple style but can't figure out how to get it to work:
.RadTabStrip_Simple highlight-tab .rtsLevel1 .rtsLink
Is there a way to do this?
thanks
Hello,
Is there a way to get the index of the series item hovered via client - not just the Yvalue or category value?
Was looking at the demo code...
function OnSeriesHover(args) { var message = $get("message"); message.innerHTML = "Hover item with value '" + args.value + "' from category '" + args.category + "'."; }I have a master page with a radmenu and a radComboBox on it.
In OnClientSelectedIndexChanged for the radcombobox, I make an AjaxRequest and in the handling method server-side I want to add and/or remove radmenu items based on the new value in the radcombobox.
I've been unable to get this to happen - the adding of radmenuitems occurs in the server side code, but it's not reflected on the client.
I have tried it with a RadAjaxPanel wrapping the whole thing.
I've tried Ajaxifying the RadMenu, the "Events" radmenuitem and also the "Summary radmenuitem.
The best outcome sees the code behind executing as expected, and the radmenuitems being added, but the items don't show up on the client.
May please be given some guidance?
Thank you.
The relevant code snippets are as follows:
Radmenu and combobox
<telerik:LayoutColumn Span="3" SpanMd="3" SpanSm="12" SpanXs="12"> <div class="RadMenu"> <%--RadMenu_Bootstrap--%> <ul class="rmRootGroup rmHorizontal" style="border: none!important;"> <li class="rmItem" style="border: none!important;"> <div class="rmContent"> <img src="/images/saLogo2.png" alt="site logo" style="vertical-align: middle;" /> </div> </li> <li class="rmItem" style="border: none!important;"> <div class="rmContent"> <img id="imgOrgLogo" runat="server" visible="false" src="" style="vertical-align: middle;" /> <telerik:RadComboBox ID="rcbOrgScope" runat="server" Width="200" AutoPostBack="false" OnClientSelectedIndexChanged="OrgScopeChange" DropDownAutoWidth="Enabled"> </telerik:RadComboBox> </div> </li> </ul> </div></telerik:LayoutColumn><%--Main Nav--%><telerik:LayoutColumn Span="9" SpanMd="9" SpanSm="12" SpanXs="12"> <telerik:RadMenu ID="RadMenu1" runat="server" RenderMode="Auto" EnableAjaxSkinRendering="true"> <Items> <telerik:RadMenuItem Text="Project"> <ItemTemplate> <telerik:RadComboBox ID="rcbProject" runat="server" AutoPostBack="false" OnClientSelectedIndexChanged="ProjectChange" Width="350" ZIndex="7010"> </telerik:RadComboBox> </ItemTemplate> </telerik:RadMenuItem> <telerik:RadMenuItem Text="Dashboard" NavigateUrl="Dashboard.aspx"></telerik:RadMenuItem> <telerik:RadMenuItem Text="Events"> <Items> <telerik:RadMenuItem Text="Map" NavigateUrl="Events/Events.aspx"/> <telerik:RadMenuItem Text="Summary"/> </Items> </telerik:RadMenuItem> <telerik:RadMenuItem CssClass="LastItem"> <ItemTemplate> <telerik:RadButton ButtonType="SkinnedButton" Text="Log out" OnClick="Logout_Click" runat="server"></telerik:RadButton> <a href="Profile.aspx"> <img src="/images/icons8-User-50.png" height="40" width="40" style="vertical-align: bottom;" /> </a> </ItemTemplate> </telerik:RadMenuItem> </Items> </telerik:RadMenu></telerik:LayoutColumn>
JavaScript
<telerik:RadCodeBlock ID="rcbMaster" runat="server"> <script> function OrgScopeChange(sender, args) { var ajaxManager = <%=RadAjaxManager.GetCurrent(Page).ClientID%>; ajaxManager.ajaxRequest('orgChange'); } </script></telerik:RadCodeBlock>
CodeBehind
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { this.MenuUserSettings(); if (this.HasEventManagement) this.SetEventTypesMenuItem(); } this.AjaxWireup(); }protected void AjaxWireup() { RadAjaxManager1.AjaxRequest += Ram_AjaxRequest; RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, rcbOrgScope); RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, RcbProject); RadAjaxManager1.ClientEvents.OnRequestStart = "MasterRequestStart"; } private void Ram_AjaxRequest(object sender, AjaxRequestEventArgs e) { if (e.Argument.Equals("orgChange", StringComparison.InvariantCultureIgnoreCase)) { this.OrganizationScopeInitals = rcbOrgScope.SelectedItem.Text; this.SetEventTypesMenuItem(); } } private void SetEventTypesMenuItem() { RadMenuItem rmi = this.RadMenu1.FindItemByText("Summary"); var dt = EventCore.Data.Access.LookupDao.EventTypeLookup(this.OrganizationScope.EventManagementProfile); //OrganizationScope comes from the value in the radcombo box foreach (System.Data.DataRow r in dt.Rows) { rmi.Items.Add(new RadMenuItem(r["eventType"].ToString(), String.Format("~/Events/Summary.aspx?eid={0}", r["eventTypeId"]))); } }