Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
302 views

Hello, I'm new in telerik teleport designer and i need "Radgrid Header Context Menu Filter option for choosing columns displayed", but i don't know, where i can find it menu in telerik. can you help me? I can't find "EnableHeaderContextMenu" also:(

Please, help me(

Vessy
Telerik team
 answered on 23 Jul 2018
3 answers
214 views

I'm using "AllowCustomSorting" to prevent the RadGrid from sorting the values (they are already sorted) and let it just show the sort direction.

This works fine for "normal" columns.

 

But if such a column is grouped, the RadGrid ignores this setting and sorts by itself.

In my case it's a column with DateTime values (already formatted as strings) - they are already correctly sorted. But if I group this column, the RadGrid sorts the values itself, and especially for DateTime values as strings, this doesn't work correctly.

 

How can I prevent the RadGrid from sorting grouped columns and just use them as they are? I'm on the current version (2018.1) of Telerik ASP.NET Ajax.

 

Thanks!

Eyup
Telerik team
 answered on 23 Jul 2018
3 answers
476 views

Hi,

My issue and code here:
I have a telerik RadNumeric Text Box and a button.  When i enter 6 digit number in the text box, it should auto tab to button.
I am using "OnKeyUp" to achieve this. The first time i type in the 6 digits into the text box, it auto tabs to the button. After that, if i go back to the text box to enter a new number, after entering a single digit, it auto tabs out. It does not wait till i enter 6 digits to tab out.
I can't figure out why it is tabbing out after entering a single digit. 
NOTE: When i load the page the first time, it works good. It tabs out after entering 6 digits. Every subsequent attempt  to enter a number in that text box, it tabs out after single digit.(No new page load involved). Why is it tabbing out after entering single digit

 

<telerik:RadNumericTextBox ID="txtClientIDSelect" Runat="server" AutoPostBack="false"  
                                DataType="System.Int32" ValidationGroup="Submit"  OnTextChanged="txtClientIDSelect_TextChanged"
                                  MaxLength="6" Width="50px" onkeyup="NumericValue1KeyDown(this,event)"    >
                            <NumberFormat ZeroPattern="n" AllowRounding="False" DecimalDigits="0" DecimalSeparator="#" GroupSeparator=""
                                    GroupSizes="6"></NumberFormat>
                                    
                            </telerik:RadNumericTextBox>
                            <asp:RequiredFieldValidator ID="reqClientID" runat="server" ControlToValidate="txtClientIDSelect" ValidationGroup ="Submit"
                    ErrorMessage="ClientID is required." ToolTip="ClientID is required." InitialValue="--Select--"
                    SetFocusOnError="True">*</asp:RequiredFieldValidator>
                           <%-- <asp:TextBox ID="txtClientIDSelect" runat="server"></asp:TextBox>--%>
                              
                            <asp:Button ID="btnSubmitClient" runat="server" Text="SUBMIT" ValidationGroup ="Submit"
                                onclick="btnSubmitClient_Click" />
 
<script type="text/javascript">
                 
            function NumericValue1KeyDown(sender, e) {
            var key = e.keyCode;
            var textCount = 0;
            textCount = document.getElementById('<%= txtClientIDSelect.ClientID %>').value
            //setTimeout(function() { }, 200);
            if(textCount.length >= 6)
            {
             document.getElementById('<%=btnSubmitClient.ClientID %>').disabled = false ;
             document.getElementById('<%=btnSubmitClient.ClientID %>').focus();
            }
            }
</script>
Rumen
Telerik team
 answered on 20 Jul 2018
1 answer
1.4K+ views

 

HI,

I have a user control for address on my web page. When the address or city is changed, i get a valid zip from external url and display it in the zip combobox.

All this works good but after postback, the focus is not set to the user control or to the field which caused postback.

I saved in session the control that is causing postback and tried to set focus to that control on prerender as shown below.

It still doesn't set the focus to the control. How to set the focus to these controls?

 

<asp:UpdatePanel runat="server" ID="up_ClientAddr" UpdateMode="Conditional"  ChildrenAsTriggers ="false"  >
 <ContentTemplate>
  
    <table>
        <tr>
            <td>
                <span>Address:</span>
                <asp:RequiredFieldValidator ID="reqAddr" runat="server" ControlToValidate="txtAddr1" ValidationGroup="Add"
                    ErrorMessage="Address is required." ToolTip="Address is required." SetFocusOnError="True"></asp:RequiredFieldValidator>
            </td>
            <td>
                <telerik:RadTextBox ID="txtAddr1" runat="server" OnTextChanged="txtAddr1_TextChanged" AutoPostBack="true"   >
                </telerik:RadTextBox>
                <asp:Label ID="lblAddr1" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <span>Addr2/Apt#/Suite#: </span>
            </td>
            <td>
                <telerik:RadTextBox ID="txtAddr2" runat="server">
                </telerik:RadTextBox>
                <asp:Label ID="lblRAddr2" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
 
            <td>
                <telerik:RadComboBox ID="rcbCity" runat="server"  MarkFirstMatch="true"
                 AutoPostBack="true" OnSelectedIndexChanged="rcbCity_SelectedIndexChanged">
                </telerik:RadComboBox>
                <asp:Label ID="lblCity" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadComboBox ID="rcbZip" runat="server" MarkFirstMatch="true">
                </telerik:RadComboBox>
                <asp:Label ID="lblZip" runat="server" Text=""></asp:Label>
            </td>
        </tr>
    </table>
    </ContentTemplate>
 </asp:UpdatePanel>

 

protected void txtAddr1_TextChanged(object sender, EventArgs e)
             {
                 Session["event_control"] = "txtAddr1";
                 GetZipCodeValidateAndUpdateZipCodeField();
             }
             protected void rcbCity_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
             {
                 Session["event_control"] = "rcbCity";
                 GetZipCodeValidateAndUpdateZipCodeField();
             }
 
             protected void rcbState_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
             {
                 Session["event_control"] = "rcbState";
                 GetZipCodeValidateAndUpdateZipCodeField();
             }
 
 
 
protected void Page_PreRender(object sender, EventArgs e)
             {
                 if (Session["event_control"] != null)
                 {
                     if (Session["event_control"].ToString() == "txtAddr1")
                     {
                         txtAddr1.Focus();
                     }
                     else if (Session["event_control"].ToString() == "rcbCity")
                     {
                         txtAddr1.Focus();
                     }
                     else if (Session["event_control"].ToString() == "rcbState")
                     {
                         txtAddr1.Focus();
                     }
                 }
             }

 

 

 

Thanks in Advance

Rumen
Telerik team
 answered on 20 Jul 2018
4 answers
159 views

Hi I'm using pasteHTML event on radeditor to paste new content on cursor position, if the editor box is empty it works just great, but if there something else and I hit enter it will modify my html making it useless

 

Here is my script:

function Add_Accordion() {
            var Edtr = $find("<%=ContentEditor.ClientID%>");
            Edtr.pasteHtml("<div id=\"accordion\"><h2>Section 1 title</h2><div><p>Text 1</p></div><h2>Section 2 title</h2><div><p>Text 2</p></div></div>");

}

So.. if I add Hello world! on the first line of editor, hit enter and then click the button to add the script above, this is the resulting html...it add tags and duplicates the ids

<div id="accordion">
</div>
<p>Hello world</p>
<div id="accordion">
<h2>Section 1 title</h2>
<div>&nbsp;</div>
</div>
<p>Text 1</p>
<div id="accordion">
<div>&nbsp;</div>
<h2>Section 2 title</h2>
<div>&nbsp;</div>
</div>
<p>Text 2</p>

 

Thanks for your help!

Oscar
Top achievements
Rank 1
 answered on 20 Jul 2018
6 answers
1.4K+ views
I have looked all over the forums and tried two different approaches, none of which work:

1) adding onkeydown = "handleClickEvent(this, event)" to the control in the .ascx and then this javascript:

function handleClickEvent(sender, args) {
    argsargs = args || window.event;
    if (args.keyCode == 13) {
        args.cancelBubble = true;
        args.returnValue = false;
        if (args.preventDefault) args.preventDefault();
        if (args.stopPropagation) args.stopPropagation();
    }
}

2) Adding this tag <ClientEvents OnKeyPress="disableEnterKey" /> in the RadTextBox tag, calling this script:

function disableEnterKey(sender, eventArgs) {
    var key = eventArgs.get_keyCode();
    if (key && key == 13)
        eventArgs.set_cancel(true);
}
Vasssek
Top achievements
Rank 1
 answered on 20 Jul 2018
2 answers
138 views

Hello,

 

I want to use a context menu for RadSplitBar's. The following code shows the set-up of my test page - it is based on the Telerik trial software R2 2018 for ASP.NET Ajax:

 

<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadContextMenu runat="server" ID="ContextMenu1">
            <Targets>
                <telerik:ContextMenuElementTarget ElementID="RadSplitBar1" />
            </Targets>
            <Items>
                <telerik:RadMenuItem Text="Lock" Value="L" />
                <telerik:RadMenuItem Text="Unlock" Value="U" />
            </Items>
        </telerik:RadContextMenu>
 
        <telerik:RadSplitter ID="RadSplitter1" runat="server">
            <telerik:RadPane ID="RadPane1" runat="server">
            </telerik:RadPane>
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server">
            </telerik:RadSplitBar>
            <telerik:RadPane ID="RadPane2" runat="server">
            </telerik:RadPane>
        </telerik:RadSplitter>
    </div>
    </form>
</body>
</html>

 

The context menu is always visible if I use Windows 7 to check my test page. Windows 10 sparks problems:

Google Chrome shows the context menu (Version: 67.0.3396.99), but the context menu is not available in Internet Explorer (Version: 11.165.17134.0) and Microsoft Edge (Version: 42.17134.1.0).

 

Any help would be appreciated.

Karl-Heinz
Top achievements
Rank 1
 answered on 20 Jul 2018
2 answers
340 views
Hello, i have a project radGrid editable with user control, similar to that example :
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx

My problem is, when i click on update button on my userControl the event on my page which contains my update code, will never be fired.
i want this event above, be fired when i click on the update button on my user control.
protected void rgGrid_UpdateCommand(object sender, GridCommandEventArgs e)
{
    GridEditableItem editedItem = e.Item as GridEditableItem;
    UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
 
 
    //Prepare new row to add it in the DataSource
    DataRow[] changedRows = this.GridSource.Select("codigo = " + editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["codigo"]);
 
    if (changedRows.Length != 1)
    {
        rgGrid.Controls.Add(new LiteralControl("Unable to locate the Employee for updating."));
        e.Canceled = true;
        return;
    }
 
    //Update new values
    Hashtable newValues = new Hashtable();
 
    newValues["codigo"] = (userControl.FindControl("txtCodigo") as TextBox).Text;
    newValues["descricao"] = (userControl.FindControl("txtDescricao") as TextBox).Text;
    changedRows[0].BeginEdit();
    try
    {
        foreach (DictionaryEntry entry in newValues)
        {
            changedRows[0][(string)entry.Key] = entry.Value;
        }
        changedRows[0].EndEdit();
        this.GridSource.AcceptChanges();
    }
    catch (Exception ex)
    {
        changedRows[0].CancelEdit();
        Window.RadAlert("Erro!", 350, 250, "Mensagem", null);
        e.Canceled = true;
    }
}

user control code
private object _dataItem = null;
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
        public object DataItem
        {
            get
            {
                return this._dataItem;
            }
            set
            {
                this._dataItem = value;
            }
        }
 
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
             // should i do something here or what?
        }


Please help me.
Thankz in advance!
Judith
Top achievements
Rank 1
 answered on 20 Jul 2018
2 answers
918 views

Hi,

I want to get a scheduler up and running quickly in an existing webforms project (I have used it in other projects with success) so I've tidied up and dropped a couple of examples from the Telerik demos straight into my project. With all of my tests I cannot add or edit appointments - it seems to be having problems displaying the appointment form. If I right-click to add or edit, I get a visible page postback and the following JS error in the console:

 

Uncaught TypeError: Cannot read property 'add_selectedIndexChanged' of null

at d.LiteView._initializeRecurrenceDropDown (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a41a6cee9%3ab7778d6c%3a8674cba1%3a7c926187%3ac08e9f8a%3a2e42e72a%3aef347303%3a2b0ba4c2%3aabc1db80%3a6b3f73b3%3ae085fe68:3918)

(full error details below)

 

Not had this problem before. I'm hoping this is something simple. I'm using UI for ASP.NET AJAX Q2 2015. Please can anyone help?

Thanks,

David

 

<p>Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a41a6cee9%3ab7778d6c%3a8674cba1%3a7c926187%3ac08e9f8a%3a2e42e72a%3aef347303%3a2b0ba4c2%3aabc1db80%3a6b3f73b3%3ae085fe68:3918 Uncaught TypeError: Cannot read property 'add_selectedIndexChanged' of null</p><p>    at d.LiteView._initializeRecurrenceDropDown (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a41a6cee9%3ab7778d6c%3a8674cba1%3a7c926187%3ac08e9f8a%3a2e42e72a%3aef347303%3a2b0ba4c2%3aabc1db80%3a6b3f73b3%3ae085fe68:3918)<br>    at d.LiteView.initialize (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a41a6cee9%3ab7778d6c%3a8674cba1%3a7c926187%3ac08e9f8a%3a2e42e72a%3aef347303%3a2b0ba4c2%3aabc1db80%3a6b3f73b3%3ae085fe68:3911)<br>    at c.RecurrenceEditor._initializeView (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a41a6cee9%3ab7778d6c%3a8674cba1%3a7c926187%3ac08e9f8a%3a2e42e72a%3aef347303%3a2b0ba4c2%3aabc1db80%3a6b3f73b3%3ae085fe68:3650)<br>    at c.RecurrenceEditor.initialize (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a41a6cee9%3ab7778d6c%3a8674cba1%3a7c926187%3ac08e9f8a%3a2e42e72a%3aef347303%3a2b0ba4c2%3aabc1db80%3a6b3f73b3%3ae085fe68:3627)<br>    at c.RecurrenceEditor.endUpdate (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a16e4e7cd%3af7645509%3a2003d0b8%3a24ee1bba%3ac128760b%3a1e771326%3a88144a7a%3af46195d3%3aaa288e2d%3a258f1c72%3aed16cbdc%3a874f8ea2%3a4c8be21a%3a650fdad%3ad40f7d5c%3ae91ff703%3a7666c7ed%3a29e4ab07%3ab68dcd79%3a59462f1%3aa51ee93e%3ae330518b%3ac8618e41%3ae4f8f289%3a1a73651d%3a333f8d94:6)<br>    at Sys.Component.create (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a16e4e7cd%3af7645509%3a2003d0b8%3a24ee1bba%3ac128760b%3a1e771326%3a88144a7a%3af46195d3%3aaa288e2d%3a258f1c72%3aed16cbdc%3a874f8ea2%3a4c8be21a%3a650fdad%3ad40f7d5c%3ae91ff703%3a7666c7ed%3a29e4ab07%3ab68dcd79%3a59462f1%3aa51ee93e%3ae330518b%3ac8618e41%3ae4f8f289%3a1a73651d%3a333f8d94:6)<br>    at <anonymous>:24:5<br>    at Sys._Application.add_init (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a16e4e7cd%3af7645509%3a2003d0b8%3a24ee1bba%3ac128760b%3a1e771326%3a88144a7a%3af46195d3%3aaa288e2d%3a258f1c72%3aed16cbdc%3a874f8ea2%3a4c8be21a%3a650fdad%3ad40f7d5c%3ae91ff703%3a7666c7ed%3a29e4ab07%3ab68dcd79%3a59462f1%3aa51ee93e%3ae330518b%3ac8618e41%3ae4f8f289%3a1a73651d%3a333f8d94:6)<br>    at <anonymous>:1:17<br>    at Sys._ScriptLoader._loadScriptsInternal (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a48bbf511-5bf9-4491-9be4-5464dcf4e3ba%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2015.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a849ed206-4ebb-4251-adff-3e3454bb6f4e%3a16e4e7cd%3af7645509%3a2003d0b8%3a24ee1bba%3ac128760b%3a1e771326%3a88144a7a%3af46195d3%3aaa288e2d%3a258f1c72%3aed16cbdc%3a874f8ea2%3a4c8be21a%3a650fdad%3ad40f7d5c%3ae91ff703%3a7666c7ed%3a29e4ab07%3ab68dcd79%3a59462f1%3aa51ee93e%3ae330518b%3ac8618e41%3ae4f8f289%3a1a73651d%3a333f8d94:15)</p>
David
Top achievements
Rank 1
 answered on 20 Jul 2018
1 answer
155 views

Designers are such a pain :) It is possible to have a menu item wrapped in a circle and spaced apart instead of butted up against each other( see attached)

 

 

Marin Bratanov
Telerik team
 answered on 19 Jul 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?