Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
1.4K+ views
I am using radwindowmanager on my master page and my other aspx pages are showing radwindows using this manager. except one aspx page, everything is working as expected. on this problematic page i have nothing different, I have the radwindow shown but the bloody OnClientClose event is not working! On other pages when i delete the OnClientClose function on javascript code, it gives me the event is not defined error as normal. but on the problematic page when i delete the OnClientClose, it doesnt even give an error. 

function confirm(text) {
             var oManager = GetRadWindowManager();
             var oWnd = oManager.open(null, "RadWindow6");
             oWnd.SetTitle(text);
         }

<telerik:RadWindow ID="RadWindow6" runat="server" Animation="None" Behavior="Default"
                Height="170px"
                InitialBehavior="None" Left="" Modal="True" NavigateUrl="~/popups/ConfirmWindow.aspx" OnClientClose="OnClientClose"
                Overlay="True" Top="" VisibleStatusbar="False" Width="360px" Skin="WebBlue" Behaviors="Move,Close" >
            </telerik:RadWindow>

and here's the script that is added to a close button on the ConfirmWindow.aspx page which is inside this radwindow (works and closes the window as expected) :

function CloseWindow(type) {
        var oWnd = GetRadWindow();
        var oArg = new Object();
        oArg.result = false;
        oArg.type = type;
        oWnd.close(oArg);
    }



the javascript func is opening radwindow and my close button is closing the window but OnClientClose is not working, not even seeked! What am I missing?
James
Top achievements
Rank 1
 answered on 11 May 2020
5 answers
412 views

I'm using marker to show text with polygon. This seems to work ok.
Is there possibility to resize the text when zooming the map? When zooming out, text shows smaller and when zoomin in, text size is bigger

 

Here's the code which shows the example text.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
 
    <style type="text/css">
        .RadMap .k-marker::before, .RadMap .k-marker-Pin-target::before, .RadMap .k-marker-pin-target::before {
            content: none !important;
        }
 
        .RadMap .k-marker {
            text-shadow: none !important;
        }
 
        .k-map.RadMap .k-marker {
            width: auto !important;
            height: auto !important;
            text-shadow: none;
            padding: 0;
            background-image: none;
            cursor: default;
            margin: -11px 0 0 -2px !important;
            color: black !important;
             
        }
    </style>
</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>
 
 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
 
 
        <telerik:RadCodeBlock runat="server">
            <script type="text/javascript">
 
                var shapeData = [{
                    "type": "Feature",
                    "properties": {
                        "object": "seat",
                        "num": 2,
                        "marker": {
                            "title": "LONG MESSAGE TEXT",
                            "location": [4, 3]
                        }
                    },
                    "geometry": {
                        "type": "Polygon",
                        "coordinates": [
                          [
                            [
                              29.102396965026852,
                              62.7612086158975
                            ],
                            [
                              29.109349250793457,
                              62.7612086158975
                            ],
                            [
                              29.109349250793457,
                              62.762092508522215
                            ],
                            [
                              29.102396965026852,
                              62.762092508522215
                            ],
                            [
                              29.102396965026852,
                              62.7612086158975
                            ]
                          ]
                        ]
                    }
                }
                ];
 
                function shapeCreated(e) {
                    try {
 
                        if (e.shape.dataItem.properties["marker"]) {
                            var map = e.sender;
                            var marker = e.shape.dataItem.properties.marker;
                            // make sure a custom shape title is added, so that the custom code could affect only these markers
                            // note that this affects the selector which customizes the markers (see the RenderTextNode function below)
                            marker["shape"] = "text-label";
                            // add the custom marker to the markers collection
                            var markerElement = map.markers.add(marker);
                            //    // render the shape label
                            var markerElm = markerElement.element;
                            //    // get the dynamically added title attribute and add it as text to the span element
                            var markerTitle = markerElm.attr("title");
                            markerElm[0].style.fontSize = "22px;"
                            markerElm.text(markerTitle);
                            var tooltip = markerElm.data("kendoTooltip");
                            tooltip.destroy();
                        }
                    }
                    catch (err) {
                        alert(err);
                    }
                }
 
                function OnInitialize(sender, args) {
                    var originalOptions = args.get_options();
                    originalOptions.layers[1].dataSource = { data: shapeData };
                    args.set_options(originalOptions);
                }
 
            </script>
        </telerik:RadCodeBlock>
 
 
        <div style="width: 100%; height: 100%;">
 
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="500">
            </telerik:RadAjaxLoadingPanel>
 
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
 
                <asp:HiddenField runat="server" ID="HiddenGeoJSON" />
 
                <telerik:RadMap runat="server" ID="RadMap2" Zoom="8" LayersDataSourceID="">
                    <ClientEvents OnInitialize="OnInitialize" OnShapeCreated="shapeCreated" />
                    <CenterSettings Latitude="5" Longitude="5" />
                    <LayerDefaultsSettings>
                        <ShapeSettings>
                            <StyleSettings>
                            </StyleSettings>
                        </ShapeSettings>
                    </LayerDefaultsSettings>
                    <LayersCollection>
 
                        <telerik:MapLayer Type="Tile" UrlTemplate="http://a.tile.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png">
                        </telerik:MapLayer>
 
                        <telerik:MapLayer Type="Shape">
                        </telerik:MapLayer>
 
 
                    </LayersCollection>
                </telerik:RadMap>
            </telerik:RadAjaxPanel>
 
        </div>
    </form>
</body>
</html>

Regards, 
Auvo

Auvo
Top achievements
Rank 1
 answered on 11 May 2020
2 answers
439 views
Looking for javascript Method which will force client rebind of the telerik:RadGrid Batch Editing and will refresh its state with out post backI used bellow syntax to refresh grid state,it’s not working

function assignDataSourceAndRefresh()
{
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
masterTable.dataBind();
}

I also used bellow syntax it’s working but it’s make a post back.i need a process which refresh grid state without postback

function testRefresh(sender, args) {
alert("shamim");

var batchManager = $find('<%=RadGrid2.ClientID%>').get_batchEditingManager();
batchManager.cancelChanges($find('<%=RadGrid2.ClientID%>').get_masterTableView());
}
Hino
Top achievements
Rank 1
 answered on 11 May 2020
3 answers
168 views

Hi guys, is there a way to use "rem" instead of "em" on the controls? Using "rem" gives a build error ...

Thanks, Tom

Doncho
Telerik team
 answered on 08 May 2020
6 answers
639 views
I need to set the mask when they start to type e.g.
if they enter 4 the mask should be 16 digits split into 4 groups of 4 digits each #### #### #### #### - VISA
if they enter number 51-55 the mask should be same as above - MASTERCARD
if they enter 6011 or 65 the mask should be same with the previous two - DISCOVER
if they enter 34 or 37 the last group should be 3 character instead (15 in total) - AMEX

Thank you

EDIT: In addition, the very same regex which works for regular textbox does not work (ONLY AMEX) for Masked textbox:
<telerik:RadMaskedTextBox ID="txtCCNumber" runat="server"
        Mask="#### #### #### ####" ValidationGroup="CardValidate" />
                    <asp:RequiredFieldValidator ID="cardnumbervalidator" runat="server"
                        ControlToValidate="txtCCNumber" ErrorMessage="Card Number is Required!"
                        SetFocusOnError="True" ValidationGroup="CardValidate">!</asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="cardregvalidator" runat="server"
                        ControlToValidate="txtCCNumber" ErrorMessage="Card Number is not valid!"
                        ValidationExpression="^((4\d{3})|(5[1-5]\d{2})|(6011))-?\d{4}-?\d{4}-?\d{4}|3[4,7][\d\s-]{13}$" ValidationGroup="CardValidate">!</asp:RegularExpressionValidator>
Rumen
Telerik team
 answered on 08 May 2020
5 answers
396 views

It's my understanding that if I'm using Classic RenderMode, I should get the Sprite Icons on the pushbutton, if I use LightWeight rendering I should get the Kendo css images, with that being said, this took some digging to get it to this simple of an example, with the RadButton ID="btnRadButton" the icons will show the sprite image and the css image for both Classic and LightWeight rendering.  If you take the RadButton ID="btnRadButton" off the page, or set visible="false", you'll get the css images only.

Using 2020.1.114.45 Upgraded to 2020.1.219.45  same issue with the latest version

 

 

 

 

 

 

 

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="Test._Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableScriptCombine="True">
        </telerik:RadScriptManager>
        <telerik:RadButton ID="btnRadButton" runat="server" Text="My Button" RenderMode="Classic"
            AutoPostBack="false" >
        </telerik:RadButton>
        <h1>Classic</h1>
        <telerik:RadPushButton ID="btnOK" runat="server" Text="OK Classic" RenderMode="Classic" >
            <Icon CssClass="rbOk" Top="6px" />
        </telerik:RadPushButton>
        <telerik:RadPushButton ID="btnSearch" runat="server" Text="Search Classic" RenderMode="Classic">
            <Icon CssClass="rbSearch" Top="6px" />
        </telerik:RadPushButton>
        <telerik:RadPushButton ID="btnCancel" runat="server" Text="Cancel Classic" RenderMode="Classic">
            <Icon CssClass="rbCancel" Top="6px" />
        </telerik:RadPushButton>
        <h1>Lightweight</h1>
        <telerik:RadPushButton ID="RadPushButton1" runat="server" Text="OK Classic" RenderMode="Lightweight" >
            <Icon CssClass="rbOk" Top="6px" />
        </telerik:RadPushButton>
        <telerik:RadPushButton ID="RadPushButton2" runat="server" Text="Search Classic" RenderMode="Lightweight">
            <Icon CssClass="rbSearch" Top="6px" />
        </telerik:RadPushButton>
        <telerik:RadPushButton ID="RadPushButton3" runat="server" Text="Cancel Classic" RenderMode="Lightweight">
            <Icon CssClass="rbCancel" Top="6px" />
        </telerik:RadPushButton>
    </form>
</body>
</html>

Rumen
Telerik team
 answered on 07 May 2020
3 answers
168 views
THis property does not seem to be available for numerictextboxes added through radinput manager. Has the property name changed or something?
Attila Antal
Telerik team
 answered on 06 May 2020
1 answer
156 views

Hi,

I am trying to build an application with a RadWizard which have 3 steps.  All 3 steps are loaded from other user controls which has numbers of fields on each.  

My questions is is it possible to get the fields values from OnActiveStepChanged and OnNextButtonClick from the code behind of the RadWizard itself?  

Thanks

Ivan

Peter Milchev
Telerik team
 answered on 06 May 2020
5 answers
749 views

Hi

 

I saw this url for EditTemplate purpose

http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/manual-crud-operations/defaultcs.aspx

 

here I canot solve this name space issue this line any one guide me

var product = new Model.ReadWrite.Product();

 

I added this name space also

System.Data.Entity.Migrations 

 

but i meet this issue 

Error 38 The type or namespace name 'Model' could not be found (are you missing a using directive or an assembly reference?) 

 

I need Edit Template For Telerikgrid using server side records binded with Crud operations

any one guide me


 

 

Eyup
Telerik team
 answered on 06 May 2020
1 answer
170 views

I would like to tie the validation trigger to a radbutton that is external to a radgrid.

Example:

<telerik:RadButton ID="btnAddStatusComplete" runat="server" Text="Complete" OnClick="btnAddStatusComplete_Click">
</telerik:RadButton>

<telerik:RadGrid ID="rgAddStatusJustify" runat="server" AutoGenerateColumns="false" AllowPaging="false" AllowFilteringByColumn="false"
                 OnBatchEditCommand="rgAddStatusJustify_BatchEditCommand"
                 OnDeleteCommand="rgAddStatusJustify_DeleteCommand" OnNeedDataSource="rgAddStatusJustify_NeedDataSource" OnItemDataBound="rgAddStatusJustify_ItemDataBound">
    <MasterTableView Width="100%" AutoGenerateColumns="false" DataKeyNames="itemName" EditMode="Batch">
      <BatchEditingSettings EditType="Cell" HighlightDeletedRows="true"/>
      <Columns>
        <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" />
        <telerik:GridBoundColumn DataField="itemDescription" HeaderText="Item Description" ReadOnly="True" SortExpression="itemDescription" ItemStyle-HorizontalAlign="Left">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="userComment" HeaderText="Justification" UniqueName="userComment">
            <ItemStyle BorderStyle="Solid" Width="200" />
            <ColumnValidationSettings EnableRequiredFieldValidation="true">
                <RequiredFieldValidator ForeColor="Red" Text="*Comment is required" Display="Dynamic"></RequiredFieldValidator>
            </ColumnValidationSettings>
        </telerik:GridBoundColumn>
      </Columns>
    </MasterTableView>
</telerik:RadGrid>

I want the userComment field filled in for all rows prior to a postback being triggered by btnAddStatusComplete_Click.  Preferably the validation text will show up once they click "Complete" but am open to other/better approaches.

Thank you

Doncho
Telerik team
 answered on 05 May 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?