Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
734 views
Hi,

I extensively use RadWindow to edit records from a dataset and this has all been working great. I recently switched from using asp:button to RadButton and my CloseWindow() code does not seem to work when called from RadButton.

I have added both an asp:button and telerik:Radbutton to a page as below:
<asp:Button ID="Button1" runat="server" Text="Cancel"
    Width="100px" OnClientClick="CloseWindow();" />
<telerik:RadButton ID="btnCancel" runat="server" Text="Cancel"
    Width="100px" OnClientClicked="CloseWindow();" CausesValidation="false"></telerik:RadButton>

The asp:button correctly closes the window, but the RadButton does not. Am I doing something wrong here?

When I click on the button I get the following message from explorer:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; FDM)
Timestamp: Fri, 10 Jun 2011 11:13:14 UTC

Message: Expected '}'
Line: 639
Char: 262
Code: 0
URI: http://localhost:1580/P5Time/(S(1jnywutrtzbw552lk2ry5mgd))/EditEvent.aspx?Mode=Insert&Start=2011-06-07+09%3a30&IsAllDay=false&duration=15&rwndrnd=0.9248140078625935

And the source indicated is shown below:
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnAddFavourite_ClientState","iconData":{},"imageData":{},"text":"Add Favourite","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnAddFavourite","width":"100px"}, null, null, $get("btnAddFavourite"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnSave_ClientState","iconData":{},"imageData":{},"text":"Save","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnSave","width":"100px"}, null, null, $get("btnSave"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnExport_ClientState","iconData":{},"imageData":{},"text":"Export","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnExport","width":"100px"}, null, null, $get("btnExport"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnSaveAndClose_ClientState","iconData":{},"imageData":{},"text":"Save + Close","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnSaveAndClose","width":"100px"}, null, null, $get("btnSaveAndClose"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnDelete_ClientState","iconData":{},"imageData":{},"text":"Delete","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnDelete","width":"100px"}, null, null, $get("btnDelete"));
});
Sys.Application.add_init(function() {
    $create(Telerik.Web.UI.RadButton, {"_postBackReference":"","clientStateFieldID":"btnCancel_ClientState","iconData":{},"imageData":{},"text":"Cancel","toggleStatesData":[],"uniqueGroupName":"","uniqueID":"btnCancel","width":"100px"}, {"clicked":CloseWindow();}, null, $get("btnCancel"));
});

The error seems to indicate an issue around the btnDelete definition but it looks the same as all the others. Other RadButtons on the same page appear to work correctly, but they all call server code whereas this Cancel button only calls a javascript function.

David Penny


MTC
Top achievements
Rank 1
 answered on 22 Feb 2013
1 answer
61 views
Hi!

I am currently using the Telrik RadFilter and would like to know whether it is possible to modify the property dropdown on an already creadted FieldEditor so that instead of providing a drop down of options, which the user can select to change the expression, display a popup window similar to the popup window that is used to add the expression in the first place.

If this cannot be done, is it possible to modify the drop down so that it is a lookup, allowing users to type in a property name making it easier to find the correct property?

Many thanks for any help.

Kind regards

Richard
Marin
Telerik team
 answered on 22 Feb 2013
4 answers
496 views
I have a fairly conventional grid with multiple filtered columns.  Is it or isn't it possible to clear all filters at once in JavaScript?

I've looked at multiple examples in this forum but I haven't been able to get anything to work correctly so far.  I don't see any clear definitive answers.
Boris
Top achievements
Rank 1
 answered on 22 Feb 2013
1 answer
183 views
I installed the Q1 '13 update this afternoon.  When I open my visual studio project and attempt to upgrade the project from the latest 2012 extensions to the new extensions I get an error in VS that states RADControls for ASP.NET AJAX Visual Studio Extensions have recovered from an error.  The details of the error are below.  

I have uninstalled and reinstalled the extensions using the control panel, and I still have this issue. Any advice?

Failed to execute command.

System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
   at EnvDTE._DTE.get_ActiveSolutionProjects()
   at Telerik.VSX.Internal.ProjectManagement.ProjectRetriever.GetFirstSelectedProject(DTE dte)
   at Telerik.VSX.Internal.ProjectManagement.ProjectRetriever.GetFirstSelectedProject(IServiceProvider serviceProvider)
   at Telerik.VSX.Internal.ProjectManagement.ProjectWrapFactoryBase`1.GetForFirstSelectedProject(IServiceProvider serviceProvider)
   at Telerik.Web.UI.VSX.ProjectConfigurators.ProjectConfigurationStyles.ProjectUpgrade(IServiceProvider serviceProvider)
   at Telerik.Web.UI.VSX.ProjectConfigurators.StreamlinedProjectConfiguration.StartUpgradeWizard()
   at Telerik.Web.UI.VSPackage.CommandExecutor.Execute(UInt32 commandId)
   at Telerik.VSX.VSPackage.PackageBase.CommandCallback(Object sender, EventArgs e)
Vesko
Telerik team
 answered on 22 Feb 2013
1 answer
125 views
Hi I have a Generic list of items that I want to bind to the DropDownTree. Is it possible to show some items as checked when the list is bound to the Tree? 
Peter Filipov
Telerik team
 answered on 22 Feb 2013
6 answers
616 views
I am buiding my RadGrid in the Code-Behind because it could change upon a post-back. I am adding my columns one at a time and binding them to the columns within my SqlDataSource. One of the types is the GridCheckBoxColumn.

I set the DataField and HeaderText. The DataField is a column that is a BIT type in Sql Server. I even tried TinyInt.

When I run my program I get an error stating 'String was not recognized as a valid Boolean'.

I am setting the RadGrid's DataSourceID to a asp:SqlDataSource that is a select statement.

How do I get around this error?
Kostadin
Telerik team
 answered on 22 Feb 2013
1 answer
44 views
as my case, I used AllowKeyboardNavigation for selection using, when I pass up arrow key, the row will highlight, but the select color is "light", it different to click selection color. As my found out, it is "current row" selection. So my problem is how to deselect that highligh?

my clear row javascript:
 var masterTable = grid.get_masterTableView();
                var row = masterTable.get_dataItems();
                for (var i = 0; i < row.length; i++) {
                    masterTable.get_dataItems()[i].set_selected(false);

my grid client setting:
<ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowKeyboardNavigation="True">
                            <KeyboardNavigationSettings AllowSubmitOnEnter="False" AllowActiveRowCycle="False" />
                            <Selecting AllowRowSelect="True" />
                            <ClientEvents OnKeyPress="OnKeyPress_grdCompany" ></ClientEvents>
                            <ClientEvents OnRowDblClick="OnRowDblClick_grdCompany" ></ClientEvents>
                            <ClientEvents  OnRowSelected="OnRowSelected_grdCompany"></ClientEvents>
                        </ClientSettings>
Eyup
Telerik team
 answered on 22 Feb 2013
1 answer
66 views
Hi,

is there anyone knows if it is possible to have this chart created by Telerik charting product? Any help is appreciated before buying the right charting control.

Regards,

Tamás
Petar Kirov
Telerik team
 answered on 22 Feb 2013
0 answers
195 views
Hi, 
I have a method defined in RadCodeBlock, when i am trying to call it on page load(by pushing my method in _spBodyOnLoadFunctionNames), i am getting error : The value of the property 'MyMethod' is null or undefined, not a Function object.

(Note: I am using RadComboBox with Sharepoint 2010.)

Below is the scenerio:
<telerik:RadCodeBlock ID="RadCodeBlock" runat="server">
    <script type="text/javascript">
            function pageLoad() {
               GetComboBox = function () {
                    var combo = $find("<%= MyRadComboBox.ClientID %>");
                    return combo;
                };
            };
    </script>                    
</telerik:RadCodeBlock>


Method2 = function(){
var combo = GetComboBox(); -->// getting error
// do something
}
 
var index = ko.utils.arrayIndexOf(_spBodyOnLoadFunctionNames, "Method2");
if( index === -1) {
    _spBodyOnLoadFunctionNames.push("Method2");
}

 ERROR : The value of the property 'GetComboBox' is null or undefined, not a Function object.
Dheeraj
Top achievements
Rank 1
 asked on 22 Feb 2013
5 answers
541 views
Hi,

I am using the RadCombobox version 2.1.1/2.2 in an old web application that I need to make updates to.  I am trying to use client side javascript to adjust the width of a RadCombobox using the OnClientDropDownOpening and Closing events.  The Width property does not seem to work for this, I was able to look around the other properties and figured out how to do this, but the scroll bar still displays as the original width.  Two questions, how do I adjust the scroll bar with using jscript and is there another way of displaying only the dropdown items at a larger width, keeping the combo box the same smaller width?  Also, there's got to be another way to adjust the width than what I am doing in the jscript.  Code follows:

    function OnClientDropDownOpening(sender, eventArgs)     
    {     
    sender.S.style.width = 400;  
    }     
 
 
    function OnClientDropDownClosing(sender, eventArgs)     
    {     
    sender.S.style.width = 25;  
    }     
 
 
 
<radc:RadComboBox ID="ddReasonCode" runat="server" width="25" NoWrap="true" OnClientDropDownOpening="OnClientDropDownOpening" OnClientDropDownClosing="OnClientDropDownClosing">     
     <Items>    
    <radc:RadComboBoxItem runat="server" Text="FB - Explosive and Incendiary" Value="FB" ID="FB"/>    
    <radc:RadComboBoxItem runat="server" Text="FE - Poisons (Toxic Chemicals)-Low Degree" Value="FE" ID="FE"/>    
    <radc:RadComboBoxItem runat="server" Text="FW - Diving" Value="FW" ID="FW"/>    
     </Items>    
</radc:RadComboBox>    
 
Nencho
Telerik team
 answered on 22 Feb 2013
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?