Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
109 views
Hi,
     In my project am using two rad calendars with id 'CalendarSelectorOne' and 'CalendarSelectorTwo'. I want to set focused date of 'CalendarSelectorTwo' when 'CalendarSelectorOne' view changes on 'OnCalendarViewChanged' event. Below is my code how am using in project

aspx code:
      <rad:RadCalendar ID="CalendarSelectorOne" EnableMultiSelect="false" runat="server"
                        Skin="Black" EnableNavigation="true" EnableMonthYearFastNavigation="true">
                        <ClientEvents OnDateSelected="OnCalendar1DateSelected"
                            OnCalendarViewChanged="OnCalendar1ViewChanged" />
      </rad:RadCalendar>

       
     <rad:RadCalendar ID="CalendarSelectorTwo" EnableMultiSelect="false" runat="server"
                        Skin="Black" EnableNavigation="false" EnableMonthYearFastNavigation="false">
                        <ClientEvents OnDateSelected="OnCalendar1DateSelected" />
       </rad:RadCalendar>


Javascript Code:
   
          var calendarone;
          var calendartwo;
          function pageLoad(sender, args) {
                calendarone = $find('<%=CalendarSelectorOne.ClientID %>');
                calendartwo = $find('<%=CalendarSelectorTwo.ClientID %>');             
            }

        function OnCalendar1ViewChanged(sender, eventArgs) {
                var dateTriplet = sender.get_focusedDate();   
                    var selectedDate = new Date(dateTriplet[0], dateTriplet[1] - 1, dateTriplet[2]);
                    var calendar2 = new Date(dateTriplet[0], dateTriplet[1], dateTriplet[2]);
                    calendartwo.set_focusedDate(calendar2);  
               
            }


    In OnCalendar1ViewChanged event am getting 'CalendarSelectorOne' focused date and add one month from that date and seeting focused date to  'CalendarSelectorTwo' calendar. But its not changing the view of the second calendar.

    Please let us know am doing any wrong in this.


Regards,
Nishanth P

Nishanth
Top achievements
Rank 1
 asked on 25 Mar 2013
2 answers
945 views
I am trying to get the count of the number of rows in the radgrid as part of the needDataSource event.  I needs to change a tab header that sits at top of page based on the number of rows it pulls, tried multiple things but nothing works.  below always returns 0

Protected Sub myRadGridList_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myRadGridList.NeedDataSource
       Dim Count As Integer = 0
       Dim sqlwhere As String = ""
       GetSrpId()
 
       sql = "Select strssn, strFullname, strRank, strPMOS, Convert(varchar(10), strdob, 111) strDob from MnNgPersonnel.dbo.tblMNNatPersonnel Where strRECPREC = '99999999' and strRECSTAT <> 'M' AND " _
           & "(strUIC = '" & HFID.Value & "' or strAttchUIC = '" & HFID.Value & "') and (strSSN Not IN (Select strssn from tblUnitSRPPersonnelHist where intSRpId = " & HFRID.Value & "  and dtExpire > " _
           & "GETDATE() and bitActive = 1) OR strSSN Not IN (Select strssn from tblUnitSRPPersonnelHist where intSRpId = " & HFAID.Value & " and dtExpire > GETDATE() and bitActive = 1)) " & sqlwhere & ""
 
       myRadGridList.DataSource = getData(sql)
 
       Count = myRadGridList.MasterTableView.Items.Count
 
       tbAnnual.HeaderText = "Annual Reviews (" & Count & ")"
 
       pnlGrid.Visible = True
   End Sub
Shinu
Top achievements
Rank 2
 answered on 25 Mar 2013
1 answer
54 views
hi
after reading this:
http://www.telerik.com/help/aspnet-ajax/grid-inserting-values-usercontrol-formtemplate.html

i want to know if there is away of capturing the item edit from user control as shown in the section,

Setting predefined values for controls inside user control on item insertion
i tryed to do this on editcommand but the conversion returns nothing

i know i can get the item data on the databind on the usercontrol but i want to set a few things before i fill the data from the data object.

can i do this? 
thanks.

Shinu
Top achievements
Rank 2
 answered on 25 Mar 2013
3 answers
507 views
I am trying to highlight the current cell in a radGrid while mouseover is happening.   For the most part I have it figured out, except for getting the initial background cell color before changing it, so I can change it back on the mouseout event.

Here is my JS.  The row that is not giving me what I need is $LastColor = item.get_cell(cellName).style.background;  It is returning white when it should be getting the cell background color.  What is the correct property to get this?

var $LastColor
 
       function RowMouseOver(sender, eventArgs) {
           var rowIndex = eventArgs.get_itemIndexHierarchical();
           var item = sender.get_masterTableView().get_dataItems()[rowIndex];
           var cellIndex = eventArgs._domEvent.target.cellIndex;
           var cellName = $find('<%= rgProjectDetails.ClientID%>').get_masterTableView().get_columns()[cellIndex].get_uniqueName();
           $LastColor = item.get_cell(cellName).style.background;
           item.get_cell(cellName).style.background = "red";
       }
       function RowMouseOut(sender, eventArgs) {
           var rowIndex = eventArgs.get_itemIndexHierarchical();
           var item = sender.get_masterTableView().get_dataItems()[rowIndex];
           var cellIndex = eventArgs._domEvent.target.cellIndex;
           var cellName = $find('<%= rgProjectDetails.ClientID%>').get_masterTableView().get_columns()[cellIndex].get_uniqueName();
           item.get_cell(cellName).style.background = $LastColor;
       }
Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Mar 2013
0 answers
66 views
I am using telerik radpanelbar and source from  a sitemap data source.When i give value to url in the sitemap,then the link is redirected to a page other that telerik radwindow manager.I tried to give the value of URl to empty and give  url value to the title attribute,It works and open in the radwindow but the title of the menu is also a link which is not good at all.
How can i open radpanel menus open in the rad window without redirection to its own page other than Radwindow manager?
yishagerew
Top achievements
Rank 1
 asked on 24 Mar 2013
2 answers
90 views
We use a an older version of telerik web DLL  which doesn't support grid.clearActiveRow() method so can you please let me know how to go about it using code. I just want to clear the active row selection. Please help.
Madhu
Top achievements
Rank 1
 answered on 23 Mar 2013
3 answers
224 views
How do I set a RadEditor that is within a RadGrid to only display vertical scroll bars and properly word wrap to the next line.

 

Thank You!
Rengo
Top achievements
Rank 1
 answered on 23 Mar 2013
1 answer
287 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
187 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
217 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
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?