Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
196 views

Given the following code example, is there a way to access "RadTextBox_Name" in code-behind prior to initiating an Edit operation on the record? e.g. in the RadGrid onItemCommand event (CommandName="Edit") is there a way to manipulate the attributes of RadTextBox_Name prior to the pop-up appearing? My real-world application is a bit more complicated than this (e.g. I have several fields and want to have some enabled/disabled based on values in other fields, etc.) but for purposes of my question, the below code example is adequate.


<telerik:RadGrid ID="RadGrid_Products" runat="server" AutoGenerateColumns="False" AllowAutomaticUpdates="True"  DataSourceID="SqlDataSource_Products">
<MasterTableView DataKeyNames="Key" EditMode="PopUp" commanditemdisplay="Bottom" >
  <Columns>
   <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1" />
   <telerik:GridBoundColumn DataField="Key" HeaderText="Key" UniqueName="Key" />
   <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name" />
  </Columns>
  <EditFormSettings EditColumn-UniqueName="EditCommandColumn1" EditFormType="Template" CaptionDataField="Name" >
   <FormTemplate>
     <table width="100%">
      <tr>
       <td width="10%" align="right">
        Name:
       </td>
       <td width="90%">
        <telerik:RadTextBox ID="RadTextBox_Name" runat="server" width="100%" Text='<%# Bind("Name" ) %>' />
       </td>
      </tr>
     </table>
    </FormTemplate>
  </EditFormSettings>
 </MasterTableView>
</RadGrid>
Princy
Top achievements
Rank 2
 answered on 04 Nov 2013
5 answers
101 views
Hi,
 I have 2 radgrids with checkbox for each row and ID column, now If I select some row in grid1 if grid2 has same rowID as grid1 then disable checkbox in grid2 for that ID. Please send me if you have any sample code.
Thanks in advance!!
Princy
Top achievements
Rank 2
 answered on 04 Nov 2013
1 answer
191 views
I'm trying to find a RadComboBox on my ASP.Net form using the preferred syntax:
var combo = $find("<%= RadComboBox1.ClientID %>");

However, the combox box is actually embedded in a user control.  How can I reach that RadComboBox using the above javascript function?

This doesn't seem to work:

var combo = $find("<%= MyUserControl_RadComboBox1.ClientID %>");

Where MyUserControl_RadComboBox1 is the unique id in the rendered markup.

Thanks.
Princy
Top achievements
Rank 2
 answered on 04 Nov 2013
0 answers
62 views
I simply want to add this gallery jquery to my page GalleryView `https://github.com/jackwanders/GalleryView/zipball/master` `http://www.catosplace.net/blogs/personal/2010/01/17/galleryview-jquery-plugin-2-0/`.  This is an easy to use extremely simple gallery.  However, ScriptManager breaks it

Here is my default.aspx

<%@ 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>
    <!-- First, add jQuery (and jQuery UI if using custom easing or animation -->
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
    <!-- Second, add the Timer and Easing plugins -->
    <script type="text/javascript" src="../js/jquery.timers-1.2.js"></script>
    <script type="text/javascript" src="../js/jquery.easing.1.3.js"></script>
    <!-- Third, add the GalleryView Javascript and CSS files -->
    <script type="text/javascript" src="../js/jquery.galleryview-3.0-dev.js"></script>
    <link type="text/css" rel="stylesheet" href="../css/jquery.galleryview-3.0-dev.css" />
    <!-- Lastly, call the galleryView() function on your unordered list(s) -->
    <script type="text/javascript">
        $(function () {
            $('#myGallery').galleryView({
                transition_speed: 2000,         //INT - duration of panel/frame transition (in milliseconds)
                transition_interval: 4000,      //INT - delay between panel/frame transitions (in milliseconds)
                easing: 'swing',                //STRING - easing method to use for animations (jQuery provides 'swing' or 'linear', more available with jQuery UI or Easing plugin)
                show_panels: true,              //BOOLEAN - flag to show or hide panel portion of gallery
                show_panel_nav: false,          //BOOLEAN - flag to show or hide panel navigation buttons
                enable_overlays: true,          //BOOLEAN - flag to show or hide panel overlays
 
                panel_width: 900,               //INT - width of gallery panel (in pixels)
                panel_height: 500,              //INT - height of gallery panel (in pixels)
                panel_animation: 'slide',       //STRING - animation method for panel transitions (crossfade,fade,slide,none)
                panel_scale: 'crop',            //STRING - cropping option for panel images (crop = scale image and fit to aspect ratio determined by panel_width and panel_height, fit = scale image and preserve original aspect ratio)
                overlay_position: 'bottom',     //STRING - position of panel overlay (bottom, top)
                pan_images: true,           //BOOLEAN - flag to allow user to grab/drag oversized images within gallery
                pan_style: 'drag',          //STRING - panning method (drag = user clicks and drags image to pan, track = image automatically pans based on mouse position
                pan_smoothness: 15,             //INT - determines smoothness of tracking pan animation (higher number = smoother)
                start_frame: 1,                 //INT - index of panel/frame to show first when gallery loads
                show_filmstrip: true,           //BOOLEAN - flag to show or hide filmstrip portion of gallery
                show_filmstrip_nav: true,       //BOOLEAN - flag indicating whether to display navigation buttons
                enable_slideshow: false,        //BOOLEAN - flag indicating whether to display slideshow play/pause button
                autoplay: false,            //BOOLEAN - flag to start slideshow on gallery load
                show_captions: true,            //BOOLEAN - flag to show or hide frame captions
                filmstrip_size: 3,              //INT - number of frames to show in filmstrip-only gallery
                filmstrip_style: 'scroll',      //STRING - type of filmstrip to use (scroll = display one line of frames, scroll filmstrip if necessary, showall = display multiple rows of frames if necessary)
                filmstrip_position: 'bottom',   //STRING - position of filmstrip within gallery (bottom, top, left, right)
                frame_width: 164,               //INT - width of filmstrip frames (in pixels)
                frame_height: 80,               //INT - width of filmstrip frames (in pixels)
                frame_opacity: 0.5,             //FLOAT - transparency of non-active frames (1.0 = opaque, 0.0 = transparent)
                frame_scale: 'crop',            //STRING - cropping option for filmstrip images (same as above)
                frame_gap: 5,                   //INT - spacing between frames within filmstrip (in pixels)
                show_infobar: true,             //BOOLEAN - flag to show or hide infobar
                infobar_opacity: 1              //FLOAT - transparency for info bar
            });
        });
</script>
    <style type="text/css">
        body
        {
            margin: 2em;
            font-family: Arial, Helvetica, sans-serif;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableEmbeddedjQuery="false">
        <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>
    <ul id="myGallery">
        <li>
                src="http://www.spaceforaname.com/galleryview/img/photos/bp1.jpg" title="Lone Tree Yellowstone"
                data-description="A solitary tree surviving another harsh winter in Yellowstone National Park. Yellowstone National Park, Wyoming. (Photo and caption by Anita Erdmann/Nature/National Geographic Photo Contest) " />
            <li>
                <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp2.jpg"
                    src="http://www.spaceforaname.com/galleryview/img/photos/bp2.jpg" title="Is He Still There?!"
                    data-description="One morning while on the Big Island of Hawaii, i exploring my surroundings to see if i could find something to photograph. I almost went back inside when something on this huge palm tree leaf caught my eye. I stayed around and it was this little gecko, startled by my presence he was hidden between the ridges of the leaf. He would pop his head up periodically to check his surroundings, as soon as he saw i was still there he would hide again. We played this game for a while until i got the shot. Holualoa big Island, Hawaii. (Photo and caption by Lorenzo Menendez/Nature/National Geographic Photo Contest)" />
                <li>
                    <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp4.jpg"
                        src="http://www.spaceforaname.com/galleryview/img/photos/bp4.jpg" title="Noni Nectar For Green Gecko"
                        data-description="Madagascar Gold Dust Day Gecko licking nectar from a young noni fruit in Kailua, Hawaii. These geckos were living all around the hale' we were staying in, enjoying the noni and basking on the railing and sunny steps to our place. They were very shy mostly, except this one must have enjoyed the nectar so much as to let me get a shot of their favorite activity. They seemed to tend the noni very attentively throughout the day. August 2010, Chandra S Sherin. Kona Village Resort, Kailua - Kona, Hawaii. (Photo and Caption by Chandra Sherin/Nature/National Geographic Photo Contest)" />
                    <li>
                        <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp7.jpg"
                            src="http://www.spaceforaname.com/galleryview/img/photos/bp7.jpg" title="Flight of an Eagle Owl"
                            data-description="A large adult eagle owl in flight. Lingfield, Surrey, UK. (Photo and caption by Mark Bridger/Nature/National Geographic Photo Contest)" />
                        <li>
                            <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp14.jpg"
                                src="http://www.spaceforaname.com/galleryview/img/photos/bp14.jpg" title="Winter Lollipops"
                                data-description="Winter is extremely beautiful in Lithuania. It was an early morning and minus 25 degrees Celsius outside. This landscape feels out of this world, but in fact it's in the outskirts of my home city, Kaunas—just a mile away from my house. Oftentimes beauty lies just a step away from our door. Kaunas, Lithuania (Photo and caption by Matas Juras/Nature/National Geographic Photo Contest)" />
                            <li>
                                <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp26.jpg"
                                    src="http://www.spaceforaname.com/galleryview/img/photos/bp26.jpg" title="Day of Youth"
                                    data-description="Muslim girls at the day of the youth on the 11th of February. The girls are walking in a procession to the mayor of the village and are singing about the power of Cameroon. Lagdo, Cameroon. (Photo and caption by Ronnie Dankelman/People/National Geographic Photo Contest)" />
                                <li>
                                    <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp27.jpg"
                                        src="http://www.spaceforaname.com/galleryview/img/photos/bp27.jpg" title="Sunbathing Underwater"
                                        data-description="The sun gives us energy even underwater. This image was captured during freediving (diving on a single breath without scuba gear) in the Red Sea. Eel Garden, Dahab, Sinai, Egypt. (Photo and caption by Vaclav Krpelik/People/National Geographic Photo Contest)" />
                                    <li>
                                        <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp28.jpg"
                                            src="http://www.spaceforaname.com/galleryview/img/photos/bp28.jpg" title="Untitled"
                                            data-description="Children filled with happiness playing in the water. Brazil. (Photo and caption by Seth Solo/People/National Geographic Photo Contest)" />
                                        <li>
                                            <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp41.jpg"
                                                src="http://www.spaceforaname.com/galleryview/img/photos/bp41.jpg" title="New Orleans Streetcar"
                                                data-description="This is a streetcar in New Orleans traveling back towards The Quarter on St. Charles Ave. I held the camera against the window sill, making sure to divide the image equally between the inside and the outside. New Orleans, Louisiana. (Photo and caption by Don Chamblee/Places/National Geographic Photo Contest)" />
                                            <li>
                                                <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp49.jpg"
                                                    src="http://www.spaceforaname.com/galleryview/img/photos/bp49.jpg" title="By The Wind of Chance"
                                                    data-description="I was doing my touristic duties to photograph the Pyramids, and I hear my professor shouting. Next thing you know my entire class and some police officers were running to catch my professors hat. It actually wasn't until later that night when scrolling through my photos that I realized I captured this gem. Great Pyramid of Giza. (Photo and caption by John Head/Places/National Geographic Photo Contest)" />
                                                <li>
                                                    <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp52.jpg"
                                                        src="http://www.spaceforaname.com/galleryview/img/photos/bp52.jpg" title="Fishing on the Cloud"
                                                        data-description="Anglers fishing in the mist rising from the reservoir by dawn look like fishing on cloud. Gosam reservoir, Anseong, Gyeonggi-do, Korea. (Photo and caption by Sungjin Kim/Places/National Geographic Photo Contest)" />
                                                    <li>
                                                        <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp53.jpg"
                                                            src="http://www.spaceforaname.com/galleryview/img/photos/bp53.jpg" title="Blue Lagoon"
                                                            data-description="Blue lagoon, Iceland. (Photo and caption by Maroesjka Lavigne/Places/National Geographic Photo Contest)" />
                                                        <li>
                                                            <img data-frame="http://www.spaceforaname.com/galleryview/img/photos/crops/bp54.jpg"
                                                                src="http://www.spaceforaname.com/galleryview/img/photos/bp54.jpg" title="Time"
                                                                data-description="An image with beautiful natural colours i was surveying for work when i found this moment and only got the one single shot due to the meeting with my client, the car and the climber was removed one week after the image was taken... UK. (Photo and caption by Simon Belham/Places/National Geographic Photo Contest)" />
    </ul>
    <p>
        Please view the source of this page if you are having difficulties setting up GalleryView.</p>
    </form>
</body>
</html>


All I have to do to get this to work is to remove

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnableEmbeddedjQuery="false">
    <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>

'm not sure how to handle this. I've added the suggested EnableEmbeddedjQuery="false" to the RadScriptManager and the jquery will not fire. In fact with the RadScriptManager there, the page just shows up as blank.

Any help would be awesome.

Thanks!


Joshua
Top achievements
Rank 1
 asked on 03 Nov 2013
4 answers
111 views
Here is the scenario. There is a raddropdownlist and an asyncupload. The user should select an item (file type) from the drop down and this is a required field. I want to validate this field whenever the user attempt to upload a file. That is if the user didn't choose any file type and attempt to click the Select button, asyncupload should not open the File Select dialog. Instead it should validate the raddropdownlist which is the required field.
Merin
Top achievements
Rank 1
 answered on 03 Nov 2013
6 answers
118 views
I took your idea for a blog/forum as your sample and implemented my own. Strage behavior is the template columns for the edit and reply buttons does not fire off to the Item Command event of the Tree List. Perhaps i am missing something but all seems in check.

<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanelBlog" Width="100%" Height="100%">
                        <asp:Label runat="server" ID="lblSelectedBlog" Text="Select an Program/Group and/or an Event to start blogging" Font-Size="Larger" />
                        <telerik:RadTreeList ID="RadTreeListBlogBoard" runat="server" DataKeyNames="BlogSubjectId" ClientDataKeyNames="BlogSubjectId" ParentDataKeyNames="ID"
                             AutoGenerateColumns="false" GridLines="Horizontal" BorderStyle="Solid" AllowPaging="true" PageSize="12">
                            <NoRecordsTemplate>
                                <asp:Label runat="server" Font-Bold="true" Font-Italic="true" Text="Click the button above to start a new blog entry." />
                            </NoRecordsTemplate>
                            <Columns>
                                <telerik:TreeListBoundColumn UniqueName="BlogSubjectId" DataField="BlogSubjectId" Display="false" HeaderText="BlogSubjectId"/>
                                <telerik:TreeListTemplateColumn UniqueName="Subject" DataField="Subject" HeaderText="Subject">
                                    <HeaderStyle Width="180px" />
                                    <ItemStyle Width="180px" Wrap="true"/>
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LnkSubject" runat="server" Font-Bold="true" Font-Size="Large" CommandName="ExpandCollapse" CommandArgument="ExpandAll" Text='<%#Eval("Subject")%>' />
                                    </ItemTemplate>
                                </telerik:TreeListTemplateColumn>
                                <telerik:TreeListBoundColumn UniqueName="FullName" DataField="FullName" HeaderText="Author">
                                    <HeaderStyle Width="120px" />
                                    <ItemStyle Width="120px" Wrap="false"/>
                                </telerik:TreeListBoundColumn>
                                 <telerik:TreeListBoundColumn UniqueName="ModifiedDate" DataField="ModifiedDate" HeaderText="Last modified:" DataFormatString="{0:dd MMM yyyy HH:mm}">
                                    <HeaderStyle Width="120px" />
                                    <ItemStyle Width="120px" />
                                </telerik:TreeListBoundColumn>
                                <telerik:TreeListBoundColumn UniqueName="AddDate" DataField="AddDate" HeaderText="Date added:" DataFormatString="{0:dd MMM yyyy HH:mm}">
                                    <HeaderStyle Width="120px" />
                                    <ItemStyle Width="120px" />
                                </telerik:TreeListBoundColumn>
                                                                
                                 
 
                                <telerik:TreeListTemplateColumn HeaderText=" " >
                                    <HeaderStyle Width="75px" />
                                    <ItemStyle Width="75px" />                                   
                                    <ItemTemplate>
                                        <telerik:RadButton ID="RadButtonReply" runat="server" CommandName="ReplyEntry" ToolTip='<%# "Reply to the " + Eval("Subject") + " entry"%>' Width="24px" Height="24px">
                                            <Image ImageUrl="../images/Blog/reply-blue-24.png" />                                           
                                        </telerik:RadButton>
                                        <telerik:RadButton ID="RadButtonEdit" runat="server" CommandName="EditEntry" ToolTip='<%# "Edit the " + Eval("Subject") + " entry"%>' Width="24px" Height="24px" >
                                            <Image ImageUrl="../images/Blog/edit-blue-24.png" />
                                        </telerik:RadButton>
                                    </ItemTemplate>
                                </telerik:TreeListTemplateColumn>
 
                            </Columns>
 
                            <DetailTemplate>
                                <div>
                                    <asp:Label ID="lblBody" runat="server" Text='<%#Eval("Body")%>'></asp:Label>
                                </div>
                            </DetailTemplate>
 
                            <ClientSettings >
                                <ClientEvents />
                            </ClientSettings>
                        </telerik:RadTreeList>
                    </telerik:RadAjaxPanel>
SDI
Top achievements
Rank 1
 answered on 02 Nov 2013
0 answers
89 views
sorry, wrong posted.
Wong
Top achievements
Rank 1
 asked on 02 Nov 2013
2 answers
231 views
Hi,

The OnFileUploaded event is not firing. Am i missing something?

aspx

<telerik:RadCloudUpload 
                        ID="CU" 
                        runat="server" 
                        MultipleFileSelection="Disabled" 
                        ProviderType="Azure" 
                        MaxFileSize="2147483648"
                        OnFileUploaded="CU_FileUploaded"
                        OnClientUploadFailed="OnClientUploadFailed" 
                        AllowedFileExtensions=".pdf"
                        httpHandlerUrl="~/AzureUploadHandler.ashx">
                    </telerik:RadCloudUpload>

aspx.cs

 protected async void AU_FileUploaded( object sender, Telerik.Web.UI.FileUploadedEventArgs e ) {
            DateTime startDate = DateTime.Now;
            Bll.BfxFiles.SaveFileAsync( Sys.Config.DomainId, 0, 1, e.File.InputStream, e.File.FileName );

            AsyncUploadLabel.ForeColor = System.Drawing.Color.Green;
            AsyncUploadLabel.Text = string.Format( "File '{0}' uploaded successfully to Azure BLOB storage.<br/>Start: {1}<br/>End: {2}<br/>Size: {3}", 
                e.File.FileName, startDate.ToString(), DateTime.Now.ToString(), e.File.ContentLength.ToString() );
        }

handler

<%@ WebHandler Language="C#" Class="AzureUploadHandler" %>

using System;
using System.Web;

public class AzureUploadHandler : Telerik.Web.UI.CloudUploadHandler, System.Web.SessionState.IReadOnlySessionState {
    
    public override void SetKeyName(object sender, Telerik.Web.UI.CloudUpload.SetKeyNameEventArgs e) {
        if ( HttpContext.Current.Session["SelectedBfxFileId"] == null ) {
            HttpContext.Current.Response.Redirect( "~/Login.aspx?m=1" ); // session timed out
        }
        else {
            try {
                int bfxFileId = Convert.ToInt32(  HttpContext.Current.Session["SelectedBfxFileId"] );
                if ( bfxFileId == 0 ) {
                    HttpContext.Current.Response.Redirect( "~/Error.aspx?e=1" ); // invalid bfxFileId
                }
                else {
                    e.KeyName = Bll.BfxFiles.BuildBlobName( bfxFileId, e.OriginalFileName );
                }
            }
            catch ( Exception ex ) {
                throw ex;
            }
        }
    }
}
Eric
Top achievements
Rank 1
 answered on 01 Nov 2013
4 answers
92 views
I would like to either redirect the page or open a new window on user selection of new appointment by double clicking on the scheduler.  I have been able to do it with editing/viewing an appointment but not for new appointments.  Any solutions for this issue?


<telerik:RadScheduler ID="rsRooms" runat="server" DataStartField="dtStartDateTime" DataEndField="dtEndDateTime" DataKeyField="intRequestId"
  DataSubjectField="Title" OverflowBehavior="Expand" SelectedView="WeekView" MonthView-VisibleAppointmentsPerDay="6" 
  MultiDayView-UserSelectable="False" TimelineView-UserSelectable="False" Skin="Office2010Blue"
  Width="100%" WeekView-DayStartTime="07:00:00" WeekView-DayEndTime="16:59:59" WorkDayStartTime="07:00:00"
  WorkDayEndTime="16:00:00" DayView-DayEndTime="16:00:00" DayView-DayStartTime="07:00:00" CustomAttributeNames="intRoomScheduledId">
</telerik:RadScheduler>

Private Sub loadCal()
    Dim roomId As Integer = Convert.ToInt32(ddlRooms.SelectedValue)
    sql = String.Format("SELECT DISTINCT(r.intRequestId), s.intRoomScheduledId, s.dtMeetingDate dtStartDateTime, CONVERT(VARCHAR(10),s.dtMeetingDate, 120) + ' ' + " _
                        & "SUBSTRING(CONVERT(VARCHAR(23),r.dtEndDateTime,121),11,20) dtEndDateTime, r.strRemarks, ISNULL(p.strPurpose, r.strPurpose) + ': ' + " _
                        & "REPLACE(CONVERT(VARCHAR(5),r.dtStartDateTime,108),':','') + '-' + REPLACE(CONVERT(VARCHAR(5),r.dtEndDateTime,108),':','') Title " _
                        & "FROM tblRequest r JOIN tblRoomScheduled s ON s.intRequestId = r.intRequestId LEFT JOIN tblPurpose p ON r.intPurposeId = p.intPurposeId " _
                        & "WHERE s.intRoomId = {0}", roomId)
    rsRooms.DataSource = getData(sql)
    rsRooms.DataBind()
    For Each apt As Telerik.Web.UI.Appointment In rsRooms.Appointments
        sql = String.Format("SELECT s.intRoomScheduledId FROM tblRoomScheduled s JOIN MnNgPersonnel.dbo.tblMNNatPersonnel p ON s.intPersonnelId = p.intPersonnelId " _
                            & "WHERE s.intRoomScheduledId = {0} AND p.strFTLogon = '{1}'", apt.Attributes("intRoomScheduledId"), myLogon)
        myDataTable = New DataTable
        myDataTable = getData(sql)
        If myDataTable.Rows.Count = 0 Then apt.AllowDelete = False Else apt.AllowDelete = True
    Next
End Sub
Protected Sub rsRooms_AppointmentDataBound(sender As Object, e As Telerik.Web.UI.SchedulerEventArgs) Handles rsRooms.AppointmentDataBound
    Dim dt As DataTable
    Dim id As Integer = e.Appointment.Attributes("intRoomScheduledId")
    sql = "SELECT intStatusId FROM tblRoomScheduled WHERE intRoomScheduledId = " & id
    dt = New DataTable
    dt = getData(sql)
    If dt.Rows(0)(0) = "1" Then ' Pending
        e.Appointment.BackColor = Drawing.Color.Khaki
    ElseIf dt.Rows(0)(0) = "2" Then ' Approved
        e.Appointment.BackColor = Drawing.Color.LightGreen
    ElseIf dt.Rows(0)(0) = "3" Then ' Cancelled
        e.Appointment.BackColor = Drawing.Color.DarkSalmon
        e.Appointment.AllowDelete = False
    End If
End Sub
Protected Sub rsRooms_AppointmentClick(sender As Object, e As Telerik.Web.UI.SchedulerEventArgs) Handles rsRooms.AppointmentClick
    Dim aptId As Integer = 0
    Dim reqId As Integer = 0
    Dim isVTC As Boolean = False
    mvRequest.ActiveViewIndex = 1
    pnlSelectVTS.Visible = False
    pnlRequest.Visible = False
    aptId = e.Appointment.ID
    hfAptId.Value = aptId
    reqId = e.Appointment.Attributes("intRoomScheduledId")
    sql = "SELECT bitVTC FROM tblRequest WHERE intRequestId = " & aptId
    isVTC = getData(sql).Rows(0)(0)
    If isVTC = True Then
        sql = "SELECT intRoomScheduledId FROM tblRoomScheduled WHERE intRequestId = " & aptId
        myDataTable = New DataTable
        myDataTable = getData(sql)
        If myDataTable.Rows.Count > 1 Then rblVTC.SelectedValue = "1" Else rblVTC.SelectedValue = "0"
    Else
        rblVTC.SelectedValue = "2"
    End If
    Dim strURL As String = String.Format("RequestDetails.aspx?apt={0}&rm={1}&dt={2}", encryptQueryString(reqId), encryptQueryString(ddlRooms.SelectedValue), encryptQueryString(e.Appointment.Start))
    Page.ClientScript.RegisterStartupScript(Me.GetType(), "New Window", "window.open('" + strURL + "','','')", True)
End Sub
Boyan Dimitrov
Telerik team
 answered on 01 Nov 2013
4 answers
88 views
Hello!

I have written the following javascript function that selects all the appointments of a certain "group". Now I wish to move them all to the left and right the exact same amount....any thoughts.

function OnClientAppointmentMoving(sender, args)
        {
            //Get all appointments and info
            var appointments = sender.get_appointments();
            var appointmentcount = appointments.get_count();
            //Get selected appointment and its info
            var currentappointment = args.get_appointment();
            var oldslot = currentappointment.get_timeSlot();
            var list = currentappointment.get_attributes();
            var ordergroup = list.getAttribute("OrderGroup");
            //Selected appointment drop slot
            var newslot = args.get_targetSlot();
            var curslot = newslot - oldslot;
            alert(oldslot);
            //handle all visiable appointments
            for (var i = 0; i < appointmentcount; i++)
            {
                //Get all scheduler appointments
                appointment = appointments.getAppointment(i);
                appointment.set_selected(false);
                templist = appointment.get_attributes();
                tempordergroup = templist.getAttribute("OrderGroup");
                //Work only with current appointment group
                if (tempordergroup == ordergroup)
                {
                    //Visually demonstrate split is selected
                    appointment.set_selected(true);
                    //Move all selected appointments left and right by same amount
                    //HELP HERE!!!
 
                }//end if
            }//end for
 
             
 
        }//end function

Thanks in advance!
Kate
Telerik team
 answered on 01 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?