I'm struggling with trying to get to the SearchContext item for a radsearchbox via the client side. below I have what I'm trying to get to, but to no avail. If some guidance could be provided I would greatly appreciate it.
function onCheckboxChanging(sender, args) { var chkbxlId = sender.get_id(); var srchbxId = chkbxlId.replaceAll("radchkbox_Item", "radsearch_Item"); var objSearchBox = $find(srchbxId); var objSearchContext = objSearchBox.get_searchContext(); alert( 'SearchBox Context Item Value = ' + objSearchContext.value);}
I am creating dynamic RadComboBox controls in the Page_Init event handler. The control needs have have multiselect checkboxes therefore I am leveraging the "Load on Demand" feature using web method. I am able to add the checkbox using a client template successfully that looks like this:
function onItemDataBound(sender, eventArgs) { var item = eventArgs.get_item(); var dataItem = eventArgs.get_dataItem(); item.get_attributes().setAttribute("text", dataItem.Text); item.set_value(dataItem.Value); item.set_clientTemplate("<div onclick='StopPropagation(event)' class='combo-item-template'><input id='chkMultiSelect' class='rcbCheckbox' type='checkbox' value='#=Value#' onclick='checkboxClick(this);' /><span>#=Text#</span></div>"); dataItem.Index = item.get_index(); item.bindTemplate();}
All of this works just fine, the "Load on Demand" is working great. I'm able to select the items in the checkbox and all of that is good.
The problem exists when another control on the page performs a postback. I need to recreate this RadComboBox control in the Page_Init event handler, and what I would like to do is to create the "checked" items during the control creation. In other words, the RadComboBox would be initially created with only the checked items server-side, and when the client-side "OnClientItemsRequesting" event handler fires it would already have these items in the control.
So I created a server side ItemTemplate class as such:
public class KimDDLItemTemplate : ITemplate{ public void InstantiateIn(Control container) { System.Web.UI.HtmlControls.HtmlGenericControl outerDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); outerDiv.Attributes.Add("onclick", "StopPropagation(event)"); outerDiv.Attributes.Add("class", "combo-item-template"); System.Web.UI.HtmlControls.HtmlInputCheckBox cbx = new System.Web.UI.HtmlControls.HtmlInputCheckBox(); cbx.ID = "chkMultiSelect"; cbx.Attributes.Add("class", "rcbCheckbox"); cbx.Attributes.Add("onclick", "checkboxClick(this);"); System.Web.UI.HtmlControls.HtmlGenericControl innerSpan = new System.Web.UI.HtmlControls.HtmlGenericControl("span"); outerDiv.Controls.Add(cbx); outerDiv.Controls.Add(innerSpan); outerDiv.DataBinding += new EventHandler(rcbDDLValue_DataBinding); container.Controls.Add(outerDiv); } private void rcbDDLValue_DataBinding(object sender, EventArgs e) { System.Web.UI.HtmlControls.HtmlGenericControl targetParent = (System.Web.UI.HtmlControls.HtmlGenericControl)sender; RadComboBoxItem item = (RadComboBoxItem)targetParent.BindingContainer; string itemValue = (string)DataBinder.Eval(item, "Value"); System.Web.UI.HtmlControls.HtmlInputCheckBox target = (System.Web.UI.HtmlControls.HtmlInputCheckBox)targetParent.FindControl("chkMultiSelect"); System.Web.UI.HtmlControls.HtmlGenericControl innerSpan = (System.Web.UI.HtmlControls.HtmlGenericControl)targetParent.Controls[1]; target.Value = itemValue; target.Checked = true; innerSpan.InnerText = (string)DataBinder.Eval(item, "Text"); }}
And in the Page_Init event handler I added each of the items obtained from the viewstate value in the Postback to create the new RadComboBoxItem. But these are not visible in the control when I open the drop down.
Am I adding the items on the Page_Init event properly?

I would like the time picker in the advanced form to list times from 5am to 8pm in half hourly intervals. Can this be done please?
Thanks,
Matt
I work on a large website that has many RadButtons with ContentTemplates, and uses a RadConfirm and callback functionality to confirm the user action and perform a PostBack. Recently, someone noticed that the JavaScript code inside the callback sender.click() does not work in Firefox.
This is a known bug, as documented here LINK
Great, so I've set about adding the Firefox-specific workaround, as seen in this demo. LINK
if (shouldSubmit) { //initiate the original postback again sender.click(); if (Telerik.Web.Browser.ff) { sender.get_element().click(); }}
Which works fine with normal RadButtons. But, I've found if the RadButton has a <ContentTemplate> declared, the postback is not executed, and the confirm keeps calling the OnClientClicking method which opens the RadConfirm again.
I've copied the code from this Demo into my own test page and reproduced the issue, it is very simple to reproduce. Simply add a ContentTemplate to the second button.
<telerik:RadButton RenderMode="Lightweight" ID="btnRadConfirm" runat="server" Text="RadConfirm" OnClientClicking="RadConfirm" OnClick="Button_Click"> <ContentTemplate> Template </ContentTemplate> </telerik:RadButton>
And now the confirmation cannot cause a postback in Firefox. We are using Telerik version 2016.2.607.45
I've tried following the directions in: http://www.telerik.com/forums/what-event-is-fired-on-resize but it doesn't appear that onResizeEnd is called when auto resizing.
I have the RadEditor inside a RadWindow and I need to run some javascript to resize the RadWindow when the RadEditor auto-sizes. Can I get some direction about what event to trap on so I can run my javascript to resize my Rad Window manually?
Thanks!

I'm using the EditorModule RadEditorStatistics and it always returns one less character than what has actually been entered in the text box. I'm not sure if it's the way I've implemented it or if that is just the way it works. Any help would be appreciated. I'm including the markup and js I use. Any help would be greatly appreciated.
<telerik:RadEditor ID="redJustification" runat="server" EditModes="Design" MaxTextLength="4000" SkinID="DefaultSetOfTools" ContentAreaMode="Div" OnClientInit="CharCountInit" Height="225px" Width="98%" Style="background-color: White; overflow: auto; display: block" Skin="Default" TabIndex="51"> <Tools> <telerik:EditorToolGroup> <telerik:EditorSeparator /> <telerik:EditorTool Name="Cut" /> <telerik:EditorTool Name="Copy" /> <telerik:EditorTool Name="Paste" /> <telerik:EditorSeparator /> <telerik:EditorTool Name="SelectAll" /> <telerik:EditorTool Name="FindAndReplace" /> <telerik:EditorSeparator /> <telerik:EditorTool Name="AjaxSpellCheck" /> <telerik:EditorSeparator /> </telerik:EditorToolGroup> </Tools> <Modules> <telerik:EditorModule Name="RadEditorStatistics" /> </Modules> </telerik:RadEditor>function CharCountInit() { var originalRender = Telerik.Web.UI.Editor.Modules.RadEditorStatistics.prototype.render; Telerik.Web.UI.Editor.Modules.RadEditorStatistics.prototype.render = function () { originalRender.apply(this); this.get_editor().remove_selectionChange(this._onDoCountDelegate); this.get_editor().attachEventHandler("onkeydown", this._onDoCountDelegate); };}
Hi guys
I have a database that has been populated with raw html programmatically, but when I try to inline text-edit those fields to tweak content, it fails to 'Update' because the data in 2 columns contains some raw html. How can I tell radgrid to allow it for specific columns?
I (as webmaster) am not worried about users hacking because only I have (secured) access to this function.
Thanks for your help!
Clive

first I have my RadScheduler in a page calling a webservice using a custom provider (MyDbSchedulerProvider)
I am adding dynamic category coloring to my appointments.
I was able to add them manually to the front code as
<ResourceStyles> <telerik:ResourceStyleMapping Type="Calendar" Key="cat1" Text="category 1" BackColor="#DEB887" BorderColor="#000000" /> <telerik:ResourceStyleMapping Type="Calendar" Key="cat2" Text="category 2" BackColor="#000000" BorderColor="#FFFFFF" /></ResourceStyles>then in my provider code I tried a few things but only got this to work so far
Dim oResource As ResourceSelect Case (i Mod 4) Case 0 'apt.CssClass = "rsCategoryAqua" 'apt.BackColor = Drawing.Color.Aqua 'apt.ForeColor = Drawing.Color.Black oResource = New Resource("Calendar", "cat1", "category 1") apt.Resources.Add(oResource) Case 1 'apt.CssClass = "rsCategoryBeige" 'apt.BackColor = Drawing.Color.Beige 'apt.ForeColor = Drawing.Color.Black oResource = New Resource("Calendar", "cat2", "category 2") apt.Resources.Add(oResource)End Selectok I tried to remove the code front tags and add instead in the page behind
RadScheduler1.ResourceStyles.Add(New ResourceStyleMapping("Calendar", "cat3", "category 3"))RadScheduler1.ResourceStyles.Add(New ResourceStyleMapping("Calendar", "cat4", "category 4"))^^ didn't work
I also tried this
RadScheduler1.Resources.Add(New Resource("Calendar", "cat1", "category 1"))^^ didn't work
highest preference is to add these colorings only in the provider but if I need to I can also add them dynamically in my page vb code if needed.
I use the webservice to keep from doing any database calls in the page to slow down my page. it would help to have the coloring only in the provider (webservice call) also.
