Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
1.3K+ 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
115 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
322 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
880 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
134 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
6 answers
186 views

We have client requirement to export multiple grids and produce a single spreadsheet with multiple tabs without user interaction (scheduled). So we're attempting to set the data source and the item data bound events in code with no problems, so the grid is completely setup correctly, but when we export and try to capture the exported file, we are unsuccessful. so here is my question: in a standard user driven asp.net page, we can access the exported file from here:

Private Sub Grid_GridExporting(ByVal source As Object, ByVal e As GridExportingArgs)
Dim    ExportString = e.ExportOutput
End Sub

is there a different way we can get the same file from the grid without triggering the event? I see some solutions that require us to go through the cells and copy each one to the worksheet, but this is no good because it's missing tons of stuff (like formatting). And it's already part of the functionality of the Grid to be able to export in a very clean manner, so i have hope that there might be a trick somewhere that i did not see. Something simple like: grid.GetHTMLSheet()

 

Thank you for all the help,

Sam

Sam
Top achievements
Rank 1
 answered on 19 Jul 2018
5 answers
207 views

I am trying to change cursor type to 'pointer' when hover over shape.

Any recommendations?

Tsvetomir
Telerik team
 answered on 19 Jul 2018
3 answers
237 views
Need Help with TELERIK radgrid export to excel issue. Anyone who can help with the below mentioned issue please reply. 

So In the application we are using Telerik radGrid to display data table in a dynamic grid view. We are trying to export radgrid item to the excel sheet. 
the below mentioned code snippet is working fine when the function is getting call from a single web page. 



protected void RadCxtMenu_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
{

if (e.Item.Text == "Export to Word")
{


radGridItem.ExportSettings.ExportOnlyData = true;
radGridItem.ExportSettings.IgnorePaging = true;
radGridItem.ExportSettings.OpenInNewWindow = true;
radGridItem.MasterTableView.ExportToWord();

}
else if (e.Item.Text == "Export to Excel")
{

ExportClick();
radGridItem.ExportSettings.ExportOnlyData = true;
radGridItem.ExportSettings.IgnorePaging = true;
radGridItem.ExportSettings.OpenInNewWindow = true;
radGridItem.MasterTableView.ExportToExcel();



}

but the above code is not working when it is reffered from a rad multi page and rad tab.
The issue that we are facing is, the parent page where the rad multi page redirection is used to redirect to a different page where the grid view is used to display the data .we could not download the data to a excel file with the export to excel rad manu item click. The popup which should be displayed in the browser for the user to select and save the excel file is not getting displayed and the excel can not be saved. We are not sure if this is a telerik related constrain can any one advise. the code snippet or the rad multi page is given below.


protected System.Web.UI.WebControls.Label lblPageHeader;
protected Telerik.Web.UI.RadTabStrip uwtConsolidation;
protected Telerik.Web.UI.RadMultiPage RadMultiPage1;
public const string SELECTED_CONSOLIDATION_TAB = "SelectedConsolidationTab";
public static readonly string QUERY_FLAG = "FLAG";
public static readonly string QUERY_SERVICE ="NodeType";


if (!Page.IsPostBack)
{
RadPageView ConsolidatedEquipmentItemTab = new RadPageView();
RadPageView PlantHistoryTab = new RadPageView();
RadPageView IssueRegisterTab = new RadPageView();
ConsolidatedEquipmentItemTab.ContentUrl = "ConsolidatedEquipmentItem.aspx";
PlantHistoryTab.ContentUrl = "PlantHistory.aspx";
IssueRegisterTab.ContentUrl = "IssueRegister.aspx"; // This is the page that contains the grid where export is not working
//ConsolidatedEquipmentItemTab.Selected = true;

RadMultiPage1.PageViews.Add(ConsolidatedEquipmentItemTab);
RadMultiPage1.PageViews.Add(PlantHistoryTab);
RadMultiPage1.PageViews.Add(IssueRegisterTab);



switch (selectedTab)
{

case 0: ConsolidatedEquipmentItemTab.Selected = true; break;
case 1: PlantHistoryTab.Selected = true; break;
case 2: IssueRegisterTab.Selected = true; break;
default: ConsolidatedEquipmentItemTab.Selected = true; break;


}
}

if (Session[SELECTED_CONSOLIDATION_TAB] != null)
uwtConsolidation.SelectedIndex = selectedTab;


}

Please advise. We appreciate your help.
Marin Bratanov
Telerik team
 answered on 18 Jul 2018
7 answers
311 views
Hi

I am working with Radgrid which has columns like -

-->Name            Unit/Currency            Jan 11        Feb 11    Mar 11    Apr 11    .....     Dec 11        Total_of _12_months

Now I want horizontal scroll but columns; Name , Unit/Currency and Total_of _12_months to be fixed. So i am looking for 2 columns on left of grid and one column on right side of grid to be fixed. is there a way to achieve in Radgrid with existing features? How to achieve tht?

Thanks,
Pradip
Marin Bratanov
Telerik team
 answered on 17 Jul 2018
4 answers
204 views

Team Telerik,

I've encountered what appears to be a bug with the RadMaskedTextBox.set_value() method in ASPNet UI 2015.1.401.45

When called, the RadMaskedTextbox doesn't reflect the new value until you mouse click into the field.

Work Around:

Call RadMaskedTextbox.focus() immediately after RadMaskedTextbox.set_value(). It's a little tacky, but it works.

Can you guys fix this for 2015 Q2? That'd be great. Thanks.

- Jonathan

Peter Milchev
Telerik team
 answered on 17 Jul 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?