Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
262 views
I have a telerik popped up window. It opens fine; however, I am having an issue closing the window. 


Here is the popup window:


@{Html.Telerik().Window()
         .Name("Window")
         .Title("Student Window")
         .LoadContentFrom(Url.Action("AddReason", "Reason", new { id = reasonID }, Request.Url.Scheme))
         .ClientEvents(events => events
             .OnClose("ClosingWindow")
             )
         .Draggable(false)
         .Scrollable(false)
         .Width(800)
         .Height(600)
         .Modal(true)
         .Visible(false)
         //.Effects(fx => fx           
         //    .Zoom()           
         //    .Opacity())
         .Render();
     }

here is the reference for the javascript:
<script src="@Url.Content("~/Scripts/jquery-1.4.4.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/spin.min.js")" type="text/javascript"></script>

Here is the JavaScript:
function DoOpen(id) {
        var url = '@Url.Action("AddReason","Reason")';
        $.post(url, { id: id }, function (data) {
            var window = $('#Window').data('tWindow').center();
            window.content(data);
            window.open();
        });
   }
 //This javascript is in the main page
//I did an alert. alert($('#Window')) and 
alert($('#Window').data('tWindow')) they both return null

  function ClosingWindow() {
      $('#Window').prop("checked", "checked");
      $('#Window').data('tWindow').close();
       window.location.href = window.location.href;
   }

Here is the partial view :
@model Student.Models.Reason
@using Student.Example
 
@{
    ViewBag.Title = "Add Reason";
    Layout = "~/Views/Shared/_PartialReason.cshtml";
}
 
<script type="text/javascript">
    function CloseWindow() {
//        alert($("#Window").closest('.t-window').data('#tWindow'));
//        $("#Window").data("tWindow").close();
        $('#Window').prop("checked", "checked");
         window.location.href = window.location.href;
    }
 
</script>
 
@using (Html.BeginForm("AddReason", "Reason", FormMethod.Post))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <div class="editor-field">
            @(Html.Telerik().Editor()
            .Name("EncountersArchive")
            .HtmlAttributes(new { style = "height:310px;", id = "AddAReason" })
            .Encode(true)
            .Tools(
            tools => tools
                       .Clear()
                        .Bold().Italic().Underline().Strikethrough().Subscript().Superscript().Separator()
                        .FontName().FontSize()
                        .FontColor().BackColor().Separator()
                        .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull().Separator()
                        .InsertUnorderedList().InsertOrderedList().Separator()
                        .Indent().Outdent().Separator()
            ))
        </div>
        <p style="text-align:center">
              
            <input type="submit" value="Reason" id="AddReasonID" onclick="CloseWindow()"/>
        </p>
    </fieldset>
}


Mitch
Top achievements
Rank 1
 answered on 23 Mar 2013
2 answers
164 views
Hi guys

I'm using a sqlserver view to bring up my fields. My update command however has errors when I try it

This is the resource:
<asp:SqlDataSource ID="SQLLucas" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseAutoSMSDiary1 %>" SelectCommand="SELECT * FROM [vwBookingsDetails]" UpdateCommand="UPDATE [Bookings] SET [Start Time] = @Start, [End Time] = @End1, [Booking Date] = @BookingDate WHERE [Booking ID] = @ID1">                    
             <UpdateParameters>
                <asp:Parameter Name="Start" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="End1" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="BookingDate" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="ID1" Type="Int32"></asp:Parameter>
            </UpdateParameters>
    </asp:SqlDataSource>

This is my error coming from js function appointmentMoveEnd:

Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Incorrect syntax near 'nvarchar'.
Incorrect syntax near 'datetime'.
http://localhost:5468/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.40412.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-AU%3aacfc7575-cdee-46af-964f-5d85d9cdcf92%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-AU%3aed0b2505-4ecf-45ea-bd67-f51c9ccd1855%3a16e4e7cd%3af7645509%3a22a6274a%3aed16cbdc%3a874f8ea2%3a24ee1bba%3a4c8be21a%3af46195d3%3a650fdad%3ad40f7d5c%3ae91ff703%3a7666c7ed%3aa51ee93e%3a59462f1
Line 9

Thanks
Aaron
Aaron
Top achievements
Rank 1
 answered on 23 Mar 2013
6 answers
175 views
I have a GridHyperLink Column in a RadGrid with the ImageUrl property set to a .png image. When the grid displays, there is a border around the image. How can I remove this border? In normal HTML i would just set the border to 0 for the img tag. 

<telerik:GridHyperLinkColumn HeaderText="" UniqueName="CourseDetailsLink" ImageUrl="Images/ClockIcon.png" DataNavigateUrlFields="TrainingItemID" DataNavigateUrlFormatString="CourseDetails.aspx?itemID={0}" DataTextField="TrainingItemID" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="50px" AllowFiltering="false" Groupable="false"></telerik:GridHyperLinkColumn>
Margo Noreen
Top achievements
Rank 1
Iron
Veteran
 answered on 22 Mar 2013
1 answer
59 views
While working on implementing a custom FileBrowserContentProvider, I've come across two issues which I could use some guidance on.

First, when deleting folders, they still appear in the right-hand pane of the FileExplorer control even though they have been removed from the TreeView.

Second, I've implemented automatic unzipping to the StoreFile method following the work of several previous posters. This appears to cause issues for the TreeView, which renders any folders inside of the extracted folders as blank items.

Has anyone else encountered similar issues which could shed light on the cause of these behaviors? Also, clicking the refresh button in the toolbar at the top of the control appears to "fix" both issues. Is there a way to trigger this refresh behavior from the code-behind?
Vessy
Telerik team
 answered on 22 Mar 2013
3 answers
248 views
How can I get all the checked items (nodes) in DropDownTree server-side?
Hank
Top achievements
Rank 1
 answered on 22 Mar 2013
10 answers
407 views
Hello!

There is the same article at your documentation.
Quote:
"
Otherwise, you have to load the user control only the first time:
protected void Page_Load(object sender, EventArgs e)
{
        if (Page.FindControl("myUC") == null)
        {
            Control myControl = this.LoadControl("gridUC.ascx");
            myControl.ID = "myUC";
            this.Panel1.Controls.Add(myControl);
        }
}
"

I want to know if we add controls dynamically we should restore it at every postback. So if (Page.FindControl("myUC") == null) will always true, and control would be recreated.

Dynamically creation userControl at Page_Init is not possible for me. Could u give some comment?

Thanks, Andrew
Daniel
Telerik team
 answered on 22 Mar 2013
2 answers
498 views
I have the following button declared:

<telerik:RadButton ID="btnProcessPayment" runat="server" Text="Process Payment" CssClass="btn-red-strip"
    Style="float: left;" ButtonType="SkinnedButton" EnableTheming="false"
    OnClick="btnProcessPayment_Click" Height="48px" Enabled="false"
    DisabledButtonCssClass="btn-gray-l"
    HoveredCssClass="btn-red-strip" SingleClick="True"
    SingleClickText="Processing..." EnableEmbeddedSkins="False" />

The button is disabled by default until the user checks a box.  Here is the checkbox event handler:

protected void chkPaymentMsgAck_CheckedChanged(object sender, EventArgs e)
{
    btnProcessPayment.Enabled = chkPaymentMsgAck.Checked;
}

This is the related CSS:

.btn-red-strip
{
    background: url("images/btn-drk-red-strip.jpg") repeat-x scroll 0 0 transparent;
    color: white;
    display: block;
    height: 48px;
    line-height: 48px;
    padding: 0 10px;
    cursor: pointer;
}
 
.btn-gray-strip
{
    background: url("images/btn-gray-strip.jpg") repeat-x scroll 0 0 transparent;
    color: white;
    display: block;
    height: 48px;
    line-height: 48px;
    padding: 0 10px;
    cursor: pointer;
}

Everything displays fine when the button is enabled or disabled BUT when it is disabled and then mouse-over'ed, the button background disappears.  I can get rid of this behavior by enabling the built-in styling instead but I want the button to follow the same look as the rest of the site (which don't use RadControls).
J
Top achievements
Rank 1
 answered on 22 Mar 2013
4 answers
102 views
Is it possible to have the RadDocks become tabbed when more than one shares the DockZone?

Michael
Slav
Telerik team
 answered on 22 Mar 2013
1 answer
202 views
I have a number of columns that are in camel-case because the client uses a lot of acronyms. RadGrid keeps renaming thecolumns and putting spaces where they don't belong.

   i.e. If the column name is "RadGridDisplay" it adds spaces and makes it "Rad Grid Display"

What can I do about this? It's driving me nuts and the users are not happy because they have very specific naming conventions on the fields they are using.

TIA!!

CG
(Yes, true camel-case starts with a lowercase letter but that's not the point)
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 22 Mar 2013
1 answer
148 views

I'm trying to set some tree nodes from the client side once the page loads using the code below:

var tree = $find(clientId);
var allTreeNodes = tree.get_allNodes();

However I get the error below when I try to run it in $(document).ready or $(window).ready.

Microsoft JScript runtime error: Unable to get value of the property 'get_allNodes': object is null or undefined.

So basically it doesn't find the tree.  I tested it with jQuery using $("#" + clientId).length and it returns 1 so it exists.

The only time it works is in the pageLoad() which I think is an asp.net ajax method.   Can someone explain why this is the case?

Thanks, Dave.

Boyan Dimitrov
Telerik team
 answered on 22 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?