Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
124 views
Here's my scenario.  My Visual Studio 2010 Web Application has just been upgraded from an older version of Telerik to the newest version (Q1 2012 SP1) to support IE9.  I am noticing quite a few UI issues and some things that stopped working.  The most prominent is the resizing of controls on the screen.  We used to use the AjaxManager's "OnResponseEnd" to fire a "resize" client-side function and all was right with the world.  That apparently has stopped working and I was wondering if the newest version of the ASP .NET controls need some extra work.

I have a MasterPage within my "MainPage.aspx" file which holds my main menu.  Under the main menu I have a UserControl (which is really just an iFrame).  Depending on which menu item is selected I load a specific ASPX page into my iFrame user control.  Now my "MainPage" has a RadAajaxManager on it and the ClientEvents get called correctly (OnResponseEnd is what I'm using) with no issues. 

My UserControl (simple ASCX file) does NOT have a RadAjaxManager ... but the ASPX page it loads DOES have one.  For example:
userControl.FrameSource = SubPage.aspx;

SubPage.aspx DOES have a RadAjaxManager ... but I cannot get the OnRequestStart or OnResponseEnd to fire.  Like I mentioned before...this was all working in the old version of Telerik on IE7 and 8 (comp mode).  Is it my code, new Telerik, IE9?  Any help would be greatly apprecited.

Thanks all,
Kevin
Kevin
Top achievements
Rank 1
 asked on 18 May 2012
2 answers
137 views
I have two RadListBoxes on my page which I populate via a database call server-side.

Selecting an item from listbox1 will select (highlight) certain items in listbox2.  After this is done, I want the first highlighted item in listbox2 to display at the top of the visible area of that listbox, i.e. I want that item to scroll to the top of listbox2.

I'm familiar with the client-side methods "item.ensureVisible()" and "item.scrollIntoView"....but what I need is a server-side version of "ensureVisible()".  Is there a way to do this?  Thanks in advance.
David
Top achievements
Rank 1
 answered on 18 May 2012
4 answers
119 views
I have more then 15 appoint ment for one date , and i want to set that alphabatical order... how can i set..?


REgards
Samir
Allen
Top achievements
Rank 1
 answered on 18 May 2012
2 answers
138 views
I'm using a RadNotification in a UserControl, which is in a content page, which is in a master page.  The RadNotification the UserControl is referencing is in the Master page.  Here's the code I use to get it:
public RadNotification GetNotificationAlert(Control ctl)
{
    var master = (defaultMaster)ctl.Page.Master;
    if (master != null)
        return master.FindControl("RadNotification1") as RadNotification;
 
    return null;
}

This works, but if I try to change any of the properties of the notification, such as width, visibletitlebar, etc. nonw of them work.  Here's an example:
var notification = GetNotificationAlert(this);
notification.VisibleTitlebar = false;
notification.Width = 540;
notification.Height = 90;
notification.Opacity = 70;

Any idea what I might be doing wrong?

Thanks!

Software
Top achievements
Rank 1
 answered on 18 May 2012
2 answers
72 views


Hi,
I am using radcalender control in inside radgrid. Value stored in db is of format "7/4/2010 12:00:00 AM". can i assign this value to rad calendar.
Is this possible ?

  <telerik:GridTemplateColumn HeaderText="Start" UniqueName="fispersrt" DataField="fispersrt"
                                Visible="true">
                                <ItemTemplate>
                                <telerik:RadCalendar ID="rdCalendar" runat="server">
                                </ItemTemplate>
                                <HeaderStyle ForeColor="Red" />
                            </telerik:GridTemplateColumn>

Regards,
Akki
Akki
Top achievements
Rank 1
 answered on 18 May 2012
1 answer
76 views
Hello,

I have an ImageButton in a  RadGrid with a RadAjaxManager. When I click on the ImageButton in line 1 of the grid, controls are populated with the data from the radgrid. If I click on the same imagebutton in lines 2..n, nothing fires.

Code to bind the cotrols are as follows.

 

 

 

<telerik

:AjaxSetting AjaxControlID="imgRequest">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="rgRequests" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="rdpReqInfoReceivedDate" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="ddlRequestType" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="cbxIsRequired" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="ddlOutcomes" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="tbxOutcomeReason" />

 

 

 

<telerik:AjaxUpdatedControl ControlID="rdpReqOutcomeDate" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 


Any help would be appreciated.

Thanks
Thomas
Eyup
Telerik team
 answered on 18 May 2012
1 answer
163 views
So I'm wanting to prevent nested styles for ease of interpretation by another system after the user has created the content in the RadEditor. I've been able to make some progress with this but run into problems when the user makes a selection and tries to apply a new css style to a block of text that contains more then one style already. For example one word is blue and the other red and the user has decided to make them both green and so has selected them together thinking they can change both at the same time. The style change is applied however my code currently fails to handle this situation and allows a nested style to be created. 

More concrete example is this one: This will be the end of it all because that's all I care to write. 
And I want to change the color of the words "the end" to both be blue. So I select both and I see the color change but I end up with this as my resulting text - nested spans: 
<span class="yellow_bold">This will be </span><span class="blue_bold">the </span><span class="yellow_bold"></span><span class="red_bold"><span class="blue_bold">end</span> of it all </span><span class="blue_bold">because</span>...

Where I think my problem is coming from is that when I ask for the selected element in the command event - I only get the first word and not the second. Is there someway for me to get each element (word) in turn and process them or is there an entirely different way I could be handling this to get the result I need?

If I step into the code I see the following:

var selectedHTML = "";
var selectedHtmlElement;
var selectionObject;

function OnClientCommandExecuting(editor, args) {
selectedHTML = editor.getSelectionHtml(); // becomes "<font class="yellow_bold">the </font><font class="red_bold">end</font>"
selectedHtmlElement = editor.getSelectedElement(); // becomes "This will be the end of..."
selectionObject = editor.getSelection(); // becomes an object I don't know how to use - maybe it is helpful and I don't know it
}

function OnClientCommandExecuted(editor, args) {
var commandName = args.get_commandName();

if (commandName == "ApplyClass") {

var className = args.get_value();
if (className == "") return;

// alert("executing on " + selectedHTML);


var selectedElement = editor.getSelectedElement(); // becomes an element with innerHtml = "the "
var parentElement = getParentSpan(selectedElement.parentNode);
if (parentElement) {
var newNode1 = parentElemen


The OnClientCommandExecuted is only fired once and I only get the one word/element when I request getSelectedElement. Is there some way to access the other word/element in this event as well so I can process it. And note how the element returned by getSelectedElement is different between the CommandExecuted and CommandExecuting events. The latter returns the top parent element that contains all the words/elements and not just the 2 that are affected by the style change.

<telerik:RadEditor ID="RadEditor1" runat="server" Height="400px" EditModes="Design" StripFormattingOnPaste="AllExceptNewLines"
                    StripFormattingOptions="AllExceptNewLines" OnClientCommandExecuted="OnClientCommandExecuted"
                     OnClientCommandExecuting="OnClientCommandExecuting">
                    <Content></Content>
</telerik:RadEditor>

<telerik:RadScriptBlock ID="voteScript" runat="server" >
    <script type="text/javascript" >
 
        var selectedHTML = "";
        var selectedHtmlElement;
        var selectionObject;
 
        function OnClientCommandExecuting(editor, args) {
            selectedHTML = editor.getSelectionHtml();
            selectedHtmlElement = editor.getSelectedElement();
            selectionObject = editor.getSelection();
        }
 
        function OnClientCommandExecuted(editor, args) {
            var commandName = args.get_commandName();
 
            if (commandName == "ApplyClass") {
 
                var className = args.get_value();
                if (className == "") return;
 
                // alert("executing on " + selectedHTML);
 
 
                var selectedElement = editor.getSelectedElement();
                var parentElement = getParentSpan(selectedElement.parentNode);
                if (parentElement) {
                    // break the content into 3 pieces - before selected text, the selected text, and after selected text and apply span styles to each
                    var newNode1 = parentElement.cloneNode(false);
                    var newNode2 = selectedElement.cloneNode(true);
                    newNode2.innerHTML = newNode2.innerText;
                    // alert(newNode2.innerHTML);
                    newNode1.innerHTML = parentElement.firstChild.nodeValue;
                    parentElement.innerHTML = parentElement.lastChild.nodeValue;
 
                    parentElement.parentNode.insertBefore(newNode1, parentElement);
                    parentElement.parentNode.insertBefore(newNode2, parentElement);
                }
                else {
                    var justText = selectedElement.innerText;
                    var newNode = document.createElement("FONT");
                    newNode.setAttribute("class", className);
                    newNode.innerHTML = justText;
 
                    selectedElement.parentNode.replaceChild(newNode, selectedElement);
                }
            }
        }
 
        function getParentSpan(el) {
            if (!el || el == null) return false;
 
            while (el && el.tagName && el.tagName.toLowerCase() != "font" && el.tagName.toLowerCase() != "body") {
                el = el.parentNode;
            }
 
            if (el == null || !el.tagName || el.tagName.toLowerCase() == "body") return false
            else return el;
        }
 
    </script>
</telerik:RadScriptBlock>

Rumen
Telerik team
 answered on 18 May 2012
2 answers
116 views
I have a user setup form that contains several RadButtons for the individual permissions (checkboxes).  The RadButtons are created at runtime on page init then added to a fieldset:
var availablePermissions = Permissions.AllPermissions(PermissionCategory.Client);
foreach (var permission in availablePermissions)
{
    //create the permission checkbox
    var checkbox = new RadButton
                    {
                        AutoPostBack = false,
                        ToggleType = ButtonToggleType.CheckBox,
                        ButtonType = RadButtonType.ToggleButton,
                        ID = "Permission_" + permission.Name,
                        Value = permission.Name,
                        ToolTip = permission.Description,
                        Text = permission.DisplayName,
                        Checked = workUser.HasPermission(permission)
                    };
        PermissionFieldSet.Controls.Add(checkbox);
}

This part of the code works great.  The permissions are added and displayed appropriately.  The problem is now accessing the controls on postback.  Since they were added at runtime and can be varied in number I need to iterate all possible permissions checked.  The original plan was to get any Request.Form elements that matched the ID pattern of "Permission_" like so:
public bool SaveOrUpdateUser()
{
    /* Various other user setup fields */
 
    //get all form fields that contain the "Permission_" identifier
    var permissions = Request.Form.AllKeys.Where(key => key.Contains("Permission_")).Select(key => Request.Form[key]).ToList();
}

While this call does successfully retrieve the permissions, the information returned is a serialized version of the RadButton control:
{\"text\":\"ButtonText\",\"value\":\"ButtonValue\",\"checked\":true,\"target\":\"\",\"navigateUrl\":\"\",\"commandName\":\"\",\"commandArgument\":\"\",\"autoPostBack\":false,\"selectedToggleStateIndex\":0,\"readOnly\":false}

So, how can I deserialize this back into a RadButton to be able to interpret the checked status of each of my permissions?  I know I could manually breakdown the string, but that seems like a workaround at best.

Thanks.

Tom
Tom Rasmussen
Top achievements
Rank 1
 answered on 18 May 2012
4 answers
322 views
Hi,

I have a RadTreeView, binded from database of 5 Levels.
Handling the Node click from client side, now I'm facing an issue, if the Node level is 2 I have to block the node click no post back should happend when user clicks on that node.

Regards
Krishna
Avinash Tauro
Top achievements
Rank 1
 answered on 18 May 2012
14 answers
367 views
Hi,
I'm using the Telerik RadEditor on our website.  When I browse to it on an iPad and I try to enter text  but does not allow the entry of text the onscreen keyboard doesn't pop up.

The iPad uses Safari which is listed as supported for RadEditor...

Anyone solved this problem?



Rumen
Telerik team
 answered on 18 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?