Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
153 views

Hi,

I'm trying to resolve an accessibility issue with the raddatepicker control.  I ran across the below page discussing it's compliance.  

https://demos.telerik.com/aspnet-ajax/datepicker/accessibilityandinternationalization/wcag2.0andsection508accessibility/defaultcs.aspx

But when you click on the link to test compliance using the wave tool, it shows errors.  Specifically, an empty TH element in the first row of the calendar (to the left of the "Sunday" heading, and above the week number).

 

To complicate my situation, the calendar is automatically generated in a grid for filtering a date column, and the columns are dynamically generated.  I've got code that finds the correct control during the item created event for the filter item.  But setting the EnableAriaSupport still has the same accessibility error shown on your demo page.  Is there another property that will address this?

 

The column with the empty TH is the week number.  An option for me might be to remove the week number column.  Is there a setting to do that or can you suggest some sample code for doing that?

 

Thanks,

 

 

Daniel
Telerik team
 answered on 15 Dec 2016
3 answers
83 views

When I insert a link into the editor, the & characters in the query string are getting converted to &

Mostly, I don't mind - the links still work on web pages. However, in some email clients (looking at you, Outlook...) the & entities break the link

I am not using the ConvertCharactersToEntities filter

Is there a way I can prevent this from happening?

I tried this on the content filter demo - I turned off ConvertCharactersToEntities and characters still got converted

Vessy
Telerik team
 answered on 15 Dec 2016
3 answers
145 views

I am using the Diagram-app sample to build my application. I need add option to change text from Shape.

 

I added the code:

 

<div class="configRow">
    <label class="configLabel">Texto</label>
    <div class="configControlContainer">
        <telerik:RadTextBox ID="shapeText" runat="server" EnabledStyle-HorizontalAlign="Right" MaxLength="50" MinValue="0" Width="110px">
            <ClientEvents OnBlur="updateShapeText" />
        </telerik:RadTextBox>
    </div>
</div>

 

But the client function "updateShapeText"​ not work !!!

 

 function updateShapeText(sender, args) {

        if (skipShapeConfigEvent) {
            return true;
        }
        var diagram = getDiagram();
        selection = diagram.select();

        selection[0].shapeVisual.options.content.text = sender.get_value();
    }​

 

Could you help me ?

Bhavya
Top achievements
Rank 1
 answered on 15 Dec 2016
2 answers
110 views
This is probably a classic issue regarding update of dock content, but I can't get the docks to update or move the docks without the entire page is reloaded.

My code is base on an example I found here in the forum written by Telerik, and I have only made a few modifications.

I have moved public List<DockState> GetCurrentDockStates(string userkey, string frmName) to a widget class.

On page_init the docks are initiated from state. On page_load docks that are not in state are initiated and ascx controls are then loaded for all docks. 

I have 2 main problems.

1. I can't move or minimize a dock without the entire page reloads. If it isn't possible to move one dock without having to recreate all docks registered in the given RadDockLayout when I want to save the state (which is what I'm doing now), that is fine if just the RadDock components and their content is reloaded but the top menu and the rest of the page isn't. How can I change my code to achieve that?

2. I can't update the content of one dock without the entire page reloads. How can I update the content of one dock without the other docks or other page content is reloaded?

Hope someone here can help me out.

Thanks.

/Thomas


Widget class .aspx

        public List<DockState> GetCurrentDockStates(string userkey, string frmName)
        {
            //Get saved state string from the database - set it to dockState variable for example
            string dockStatesFromDB = "";
            dockStatesFromDB = DbUtils.GetUserSettings(userkey, frmName, settingsKey);
            List<DockState> _currentDockStates = new List<DockState>();
            if ((dockStatesFromDB != null) && (dockStatesFromDB != ""))
            {
                string[] stringStates = dockStatesFromDB.Split(';');
                foreach (string stringState in stringStates)
                {
                    if (stringState.Trim() != string.Empty)
                    {
                        _currentDockStates.Add(DockState.Deserialize(stringState));
                    }
                }
            }
            return _currentDockStates;
        }


Default.aspx.cs

 

    protected void RadDockLayout1_LoadDockLayout(object sender, DockLayoutEventArgs e)
    {
            Widget _widget = new Widget();
            List<DockState> _currentDockStates = _widget.GetCurrentDockStates((Session[TCSessionConst.SessionFrmDefault_XpoUser] as XpoUser).KeyID, DebugFormName);
            foreach (DockState state in _currentDockStates)
            {
                e.Positions[state.UniqueName] = state.DockZoneID;
                e.Indices[state.UniqueName] = state.Index;
            }
    }

    protected void RadDockLayout1_SaveDockLayout(object sender, DockLayoutEventArgs e)
    {

        List<DockState> stateList = RadDockLayout1.GetRegisteredDocksState();

        StringBuilder serializedList = new StringBuilder();

        Widget _widget = new Widget();
        List<DockState> _currentDockStates = _widget.GetCurrentDockStates((Session[TCSessionConst.SessionFrmDefault_XpoUser] as XpoUser).KeyID, DebugFormName);
        bool state_closed;
        foreach (DockState _dockState in stateList)
        {
            state_closed = false;
            foreach (DockState _dockState2 in _currentDockStates)
            {
                if (_dockState2.UniqueName == _dockState.UniqueName)
                {
                    if (_dockState2.Closed)
                    {
                        state_closed = true;
                        serializedList.Append(_dockState2.ToString());
                        serializedList.Append(";");
                    }
                }
            }
            if (!state_closed)
            {
                serializedList.Append(_dockState.ToString());
                serializedList.Append(";");
            }
        }

        string dockState = serializedList.ToString();
        if (dockState.Trim() != String.Empty)
        {
            DbUtils.SetUserSetting((Session[TCSessionConst.SessionFrmDefault_XpoUser] as XpoUser).KeyID, "Default", "WidgetState", dockState);
        }

    }

    private RadDock CreateRadDockFromState(DockState state)
    {
        Widget widget = new Widget();
        XPOWidgetSettings xpoWidgetSettings = widget.getWidgetSettingsObjectById(state.UniqueName);

        RadDock dock = new RadDock();
        dock.DockMode = DockMode.Docked;
        dock.ID = string.Format("RadDock{0}", state.UniqueName);
        dock.ApplyState(state);
        DockExpandCollapseCommand cmd = new DockExpandCollapseCommand();
        dock.Commands.Add(cmd);
        return dock;
    }

    private RadDock CreateRadDock(string oid, string displayName, string widgetSettings)
    {
        RadDock dock = new RadDock();
        dock.DockMode = DockMode.Docked;
        dock.UniqueName = oid;
        dock.ID = string.Format("RadDock{0}", dock.UniqueName);

        DockCloseCommand closeCmd = new DockCloseCommand();
        dock.Commands.Add(closeCmd);
        DockExpandCollapseCommand cmd = new DockExpandCollapseCommand();
        dock.Commands.Add(cmd);

        return dock;
    }

    private void CreateSaveStateTrigger(RadDock dock)
    {
        //Ensure that the RadDock control will initiate postback
        // when its position changes on the client or any of the commands is clicked.
        //Using the trigger we will "ajaxify" that postback.
        dock.AutoPostBack = true;
        dock.CommandsAutoPostBack = true;

        AjaxUpdatedControl updatedControl = new AjaxUpdatedControl();
        updatedControl.ControlID = "Panel1";

        AjaxSetting setting1 = new AjaxSetting(dock.ID);
        setting1.EventName = "DockPositionChanged";
        setting1.UpdatedControls.Add(updatedControl);

        AjaxSetting setting2 = new AjaxSetting(dock.ID);
        setting2.EventName = "Command";
        setting2.UpdatedControls.Add(updatedControl);

        RadAjaxManager1.AjaxSettings.Add(setting1);
        RadAjaxManager1.AjaxSettings.Add(setting2);
    }

    private void LoadUserWidgets()
    {
        Widget widget = new Widget();
        string radDockID;
        string displayName;
        string settingString;

        List<DockState> _currentDockStates = widget.GetCurrentDockStates((Session[TCSessionConst.SessionFrmDefault_XpoUser] as XpoUser).KeyID, DebugFormName);
        XPCollection widgetSettingsObjectsByUserLevel = widget.getWidgetSettingsObjectsByUserLevel((Session[TCSessionConst.SessionFrmDefault_XpoUser] as XpoUser).Userrole);

        Boolean _doContinue;
        foreach (XPOWidgetSettings _widgetSetting in widgetSettingsObjectsByUserLevel)
        {
            _doContinue = false;
            radDockID = _widgetSetting.Oid.ToString();
            displayName = _widgetSetting.DisplayName;
            settingString = _widgetSetting.Settings;

            foreach (DockState _ds in _currentDockStates)
            {
                if (_ds.UniqueName == radDockID)
                    _doContinue = true;
            }
            if (_doContinue) continue;
            RadDock dock = CreateRadDock(radDockID, displayName, settingString);
            //find the target zone and add the new dock there

            //adding the dock to the docklayout and then docking it to the zone to avoid ViewState issues on subsequent postback
            RadDockLayout1.Controls.Add(dock);

            dock.Dock(DZCenter);

 

            CreateSaveStateTrigger(dock);

            //Load the selected widget in the RadDock control
            dock.Tag = _widgetSetting.AscxFile;
            LoadWidget(dock);
        }
    }

    private void LoadWidget(RadDock dock)
    {
        string siteUrl = TCFramework.TCConfigSettings.HostUrlGroups + Session[TCSessionConst.SessionFrmDefault_SelGroup];
        string userName = (Session[TCSessionConst.SessionFrmDefault_XpoUser] as XpoUser).Username;
        string password = (Session[TCSessionConst.SessionFrmDefault_XpoUser] as XpoUser).GetPassword();
        string ascxFile = "";
        string settings = "";

        string oId = dock.UniqueName;

        Widget widget = new Widget();
        XPOWidgetSettings xpoWidgetSettings = widget.getWidgetSettingsObjectById(oId);

        ascxFile = xpoWidgetSettings.AscxFile;
 settings = xpoWidgetSettings.Settings;

        Control widgetControl = LoadControl(ascxFile);
        if (widgetControl != null)
         dock.ContentContainer.Controls.Add(widgetControl);
    }

    private void CreateDocksFromStateDB()
    {
        Widget _widget = new Widget();
        List<DockState> _currentDockStates = _widget.GetCurrentDockStates((Session[TCSessionConst.SessionFrmDefault_XpoUser] as XpoUser).KeyID, DebugFormName);
        for (int i = 0; i < _currentDockStates.Count; i++)
        {
            RadDock dock = CreateRadDockFromState(_currentDockStates[i]);
            dock.Visible = !_currentDockStates[i].Closed;
            RadDockLayout1.Controls.Add(dock);

            //We want to save the dock state every time a dock is moved.

            if (dock.Visible) CreateSaveStateTrigger(dock);
        }
    }

 

    protected void Page_Init(object sender, EventArgs e)
    {
        CreateDocksFromStateDB();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        foreach (RadDock _rd in RadDockLayout1.RegisteredDocks)
            try
            {
                LoadWidget(_rd);
            }
            catch
            {
                //error in loading widget _rd.
            }

        if (!IsPostBack)
        {
            LoadUserWidgets();
        }
    }


Default.aspx

    <div>
        <telerik:RadDockLayout ID="RadDockLayout1" runat="server"
            onloaddocklayout="RadDockLayout1_LoadDockLayout"
            onsavedocklayout="RadDockLayout1_SaveDockLayout">
            <table width="100%" cellpadding="12px">
                <tr>
                    <td width="25%" valign="top">
                        <telerik:RadDockZone ID="DZLeft" runat="server" BackColor="#BFDBFF"
                            ForeColor="#BFDBFF">
                        </telerik:RadDockZone>
                    </td>
                    <td width="50%" valign="top">
                        <telerik:RadDockZone ID="DZCenter" runat="server" BackColor="#BFDBFF"
                            Visible="True" ForeColor="#BFDBFF">
                        </telerik:RadDockZone>
                    </td>
                    <td width="25%" valign="top">
                        <telerik:RadDockZone ID="DZRight" runat="server" BackColor="#BFDBFF"
                            ForeColor="#BFDBFF">
                        </telerik:RadDockZone>
                    </td>
                </tr>
            </table>
        </telerik:RadDockLayout>
    </div>
    <div style="width: 0px; height: 0px; overflow: hidden; position: absolute; left: -10000px;">
        Hidden UpdatePanel, which is used to help with saving state when minimizing, moving
        and closing docks. This way the docks state is saved faster (no need to update the
        docking zones).
        <asp:UpdatePanel runat="server" ID="UpdatePanel1">
        </asp:UpdatePanel>
    </div>

Shirlee
Top achievements
Rank 1
 answered on 15 Dec 2016
12 answers
185 views
Hi,

    I have one question, is that RadEditor supports including of image as a content, when user enter text as well as image, right now it looks like it is not allowing to paste image under the RadEditor control.   Please let me know, if there are any suggestions.

Regards,
Satya
Rumen
Telerik team
 answered on 15 Dec 2016
1 answer
52 views

Occurs in IE11, IE10, or IE9 (Works in IE8).

  1. Copy a table from MS word/excel into editor.
  2. Right-click right most column.
  3. Select Column > Delete Column.

Unable to select other rows in copied table or edit table cells.

Rumen
Telerik team
 answered on 15 Dec 2016
6 answers
193 views
Hi,

I have 3 questions:

1. I have set the AutoCompleteBox to allow only single mode selection; however, after the user has picked the data I noticed that the control still displays like a linefeed / space as if the user is still allowed to enter more [but it doesn't allow him to enter more than one; I mean it's only adding this space] and I'm not ok with this behaviour. Suggestions? [Pictures attached].

2. Let's say the page I have saves and displays the details of a certain item; and I use an AutoCompleteBox for the country of origin field. In saving, I won't have a problem since the AutoCompleteBox will display proper data for the user to choose from. But in displaying the saved database records, sometimes the country database field might not have a proper value and still be valid; like "USA" instead of "United States", I want to still be able to view that kind of data in the AutoCompleteBox regardless. Is this possible? How can I do it?

3. After the user has entered the letters to search for in the AutoCompleteBox, you know there's like a one second delay before displaying the data for him. How can I add like a "loading..." text in the AutoCompleteBox until the data is retrieved for him?

Many thanks!
chetna
Top achievements
Rank 1
 answered on 15 Dec 2016
3 answers
191 views

I have run into a whole bunch of problems with the editor control on iPhone/Safari devices in the latest release. The .focus() client-side method doesn't appear to work when inside a timeout. In this case, the editor can never receive focus either. Touching inside the editor does not bring up the keyboard.

 

Without a timeout, the editor receives focus and the keyboard comes up, however, when users type, no letters are displayed. THe cursor moves along as if typing is occurring, but nothing is shown in the editor. I tried the Lightweight RenderMode, which didn't look very good in iOS. I tried the Mobile Rendermode, which displayed better, but didn't function properly. Typing in the editor would display a white screen which covered the rest of the site and could never be recovered.

I have reverted back to a previous version of the controls (Q1). Needing to do this is becoming an all-too frequent occurrence.

Ianko
Telerik team
 answered on 15 Dec 2016
1 answer
106 views

Hi:

I copy those code from local demo on my empty and practice site.

         <telerik:RadMediaPlayer RenderMode="Lightweight" ID="RadMediaPlayer1" runat="server" AutoPlay="true"
            Height="360px" Width="640px">
            <PlaylistSettings YouTubePlaylist="PLvmaC-XMqeBb991YNEWAHYL9ZJAeURr-r" Mode="Buttons" ButtonsTrigger="MouseDown" />
        </telerik:RadMediaPlayer>

but when I run, only media player and other nothig. 

The same code on local demo can run very well, What's happen on my site ?

Eyup
Telerik team
 answered on 15 Dec 2016
12 answers
836 views
Hello,

I have a grid and the Insert/Update/Delete events are handled in the 'ItemCommand' event.
I'm now trying to get the dataItem row that was updated/inserted so that I can select it and then change it's BackColor.

Here is what I have now in the ItemCommand  Event:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
   if ((e.CommandName == RadGrid.PerformInsertCommandName) || (e.CommandName == RadGrid.UpdateCommandName))
   {
      GridEditableItem saveableItem = (GridEditableItem)e.Item;
      SaveItems(saveableItem, e.Item.OwnerTableView.IsItemInserted);
   }
}

I trying to do something like:  saveableItem.Selected = true;
but this way won't work because it's the editableItem vs the dataItem.

So my questions:
- Is this the right event to handle this?  If not, what event should I call to handle this (from ItemCommand if possible)?
- How do I 'get' the inserted/updated item, so that I can 'do something' (Select, change BackColor, add Border, etc. after the action)?

Thank you in advance,
Ronnie
Eyup
Telerik team
 answered on 15 Dec 2016
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?