Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
107 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
114 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
4 answers
136 views
Hello telerik team,
My problem is i need to change the text of "8AM" to something like "Tiết 1".
Same to "9AM" to "Tiết 2"
Can i do that thing with RadScheduler?
Kate
Telerik team
 answered on 01 Nov 2013
1 answer
126 views
Hi there,

I'm currently having this problem with RadSlidingZone: When I click on Dock button, the SlidingPane collapses, and I cannot expand it again. Here's my code snippet:

<telerik:RadPane ID="RadPane1" runat="server" Width="480" MinWidth="100" MaxWidth="500">
<telerik:RadSlidingZone ID="SlidingZone1" runat="server" Width="22">
<telerik:RadSlidingPane ID="SlidingPane1" runat="server" Title="Add Feature(s)" Width="500px" Height="530px" DockOnOpen="false" EnableDock="true">
<div>
...
...
</div>
</telerik:RadSlidingPane>
</telerik:RadSlidingZone>
</telerik:RadPane>

I'm not firing any server-side or client-side event on this SlidingZone. I hope you can help me figure out what went wrong. Thank you!
Vessy
Telerik team
 answered on 01 Nov 2013
7 answers
185 views
Hi Telerik team,

Is there no way I can use two different base stylesheets for two different trees?

I need to change the base stylesheet of the treeview control for my master page menu to reduce padding's and things like that and use my custom skin with custom images. I get it working simply great when there are no more tree controls on the page. Once I have another tree control on the page using the embedded base style sheet my treeview in the master page is messed up because the .RadTreeview class is loaded fresh from the Telerik DLL. How do I achieve this?

Below are the few changes I made to the Base stylesheet
 
.RadTreeView .rtUL .rtLI .rtUL  
{  
    padding-left5px;  
}  
 
.RadTreeView .rtTop,   
.RadTreeView .rtMid,   
.RadTreeView .rtBot  
{  
    padding0px 0 0px 0px;  
}  
.RadTreeView .rtPlus,   
.RadTreeView .rtMinus  
{  
    font-size: 0;  
    padding: 0;  
    display: -moz-inline-box;  
    displayinline-block;  
    vertical-aligntop;  
    cursorpointer;  
    margin6px 1px 0 -18px;  
    width11px;  
    height11px;  
    background-repeatno-repeat;  
}  
 
.RadTreeView .rtSp  
{  
    display: -moz-inline-box;  
    displayinline-block;  
    width1px;  
    height16px;  
}  
 
.RadTreeView .rtIn  
{  
    margin-left1px;  
    padding4px 3px 3px 10px 
    text-decoration:none;  

Thanks,
Tilak
Boyan Dimitrov
Telerik team
 answered on 01 Nov 2013
2 answers
191 views
I have a RadFilter with multiple RadFilterDropDownEditors with DropDownType RadComboBox. All of these I've set the DataSource in the ExpressionItemCreated Event.

Because of the size of the dataset for one of the combox boxes, I'm trying to use LoadOnDemand like so:

protected void RadFilter1_ExpressionItemCreated(object sender, RadFilterExpressionItemCreatedEventArgs e)
{
    var singleItem = e.Item as RadFilterSingleExpressionItem;
    if (singleItem != null && singleItem.IsSingleValue)
    {
        if(singleItem.InputControl is RadComboBox)
        {
            var dropDownList = singleItem.InputControl as RadComboBox;
 
            switch (singleItem.FieldName)
            {
                case "Security":
                    dropDownList.EnableLoadOnDemand = true;
                    dropDownList.ShowMoreResultsBox = true;
                    dropDownList.EnableVirtualScrolling = true;
                    dropDownList.WebServiceSettings.Method = "GetSecurityNames";
                    dropDownList.WebServiceSettings.Path = "DataSetPopup.aspx";
                    break;
            }
        }
    }
}

This works pretty well, but as soon as I click to add a new expression or load the filter from saved data, it no longer remembers the Selected Text value - it's blank. It remembers the SelectedValue, and the numeric value appears in the Filter Expression below the control, but I need it to display the text value as well.

Is there an event where I can get the selected value and set the Text field of the combo box?

Here's the markup for the filter if that helps
<rad:RadFilter runat="server" ID="RadFilter1" OnFieldEditorCreating="RadFilter1_FieldEditorCreating" OnApplyExpressions="RadFilter1_ApplyExpressions" OnExpressionItemCreated="RadFilter1_ExpressionItemCreated"  ExpressionPreviewPosition="Bottom" ShowApplyButton="false" AllowFilterOnBlur="true"  SettingsFormatter="BinaryFormatter">
     <FieldEditors>
           <rad:RadFilterDropDownEditor FieldName="Currency" DataTextField="IsoCurrencyCode" DataValueField="CurrencyId" DropDownType="RadComboBox"   />
           <rad:RadFilterDropDownEditor FieldName="Country" DataTextField="CountryDesc" DataValueField="CountryId" DropDownType="RadComboBox"/>                         
           <rad:RadFilterDropDownEditor FieldName="Region" DataTextField="RegionDesc" DataValueField="RegionId" DropDownType="RadComboBox"/>                         
           <rad:RadFilterDropDownEditor FieldName="Security" DataTextField="Security" DataValueField="SecurityId"  DropDownType="RadComboBox" />
      </FieldEditors>
</rad:RadFilter>


Antonio Stoilkov
Telerik team
 answered on 01 Nov 2013
2 answers
107 views
Have two grids with a master/detail relation created per the online example at:
http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/master-detail/defaultvb.aspx?#qsf-demo-source

All works well, when records are selected in the master grid, the detail grid updates.

However, when I place a record in the master grid in edit mode, the relationship to the detail grid is lost, presumably, because the 'SelectedItems' collection within the master grid becomes null (from what I've been able to determine via tracing)... the detail grid then automatically updates and becomes blank, losing the connection between the master and detail grids.

Is there a way to prevent that from happening? I would like to have the detail data for the record in edit mode appear in the detail grid for reference purposes..
ToltingColtAcres
Top achievements
Rank 2
Veteran
Iron
 answered on 01 Nov 2013
1 answer
243 views
Hi,

I have a grid with two group expression/field and a one GroupFooterTemplate. I need to hide one of the group footer.

I need something like the image.

Thanks.


I need to hide the secondary group footer only on the primary display
Viktor Tachev
Telerik team
 answered on 01 Nov 2013
4 answers
170 views
After upgrading to 2013.3.1015.45 all my skins were broke on the RadGrid.  After two days of trying to figure it out, I believe it's an issue with the CommandItemDisplay property.  When I removed it, the skins apply properly.  When I set it to "Top" the skins did not apply.  I've attached a screen shot of with "Top" set and without "Top" set.
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test.aspx.vb" Inherits="eNotice.Test" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
     
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
       
        <div>
        <telerik:RadGrid ID="RadGrid1" Skin="Metro" Width="100%" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None">
            <%--<MasterTableView NoMasterRecordsText="No Members Found" PageSize="25" DataKeyNames="ID">--%>
            <MasterTableView CommandItemDisplay="Top" NoMasterRecordsText="No Members Found" PageSize="25" DataKeyNames="ID">
                 <CommandItemTemplate>
                        <div style="padding-left:5px;">
                            <div style="float:left; width:50%;padding-left:5px;">
                                 
                                <telerik:RadButton Runat="server" skin="Metro" ID="ClearFilter" Text='Clear Filter' CommandName="ClearFilter" AutoPostBack="true" />
                            </div>
                            <div style="float:right;padding-right:5px;">
                                <telerik:RadButton Runat="server" skin="Metro" ID="lnkRefresh" Text='Refresh' CommandName="Refresh" />
                            </div>
                        </div>
                    </CommandItemTemplate>
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" FilterControlAltText="Filter column column" HeaderText="ID" UniqueName="column">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="City" FilterControlAltText="Filter column1 column" HeaderText="City" UniqueName="column1">
                        <ColumnValidationSettings>
                            <ModelErrorMessage Text="" />
                        </ColumnValidationSettings>
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
<FilterMenu EnableEmbeddedScripts="False"></FilterMenu>
 
<HeaderContextMenu EnableEmbeddedScripts="False"></HeaderContextMenu>
        </telerik:RadGrid>
    </div>
         
    </form>
</body>
</html>
Venelin
Telerik team
 answered on 01 Nov 2013
10 answers
622 views
Hi, I am using the AutoCompleteBox with the following configuration:

<telerik:RadAutoCompleteBox runat="server" ID="Recipient_RadAutoCompleteBox" AllowCustomEntry="true" TextSettings-SelectionMode="Single" Width="200px"  DataSourceID="Recipient_SqlDataSource"  DataTextField="Name" InputType="Text">
</telerik:RadAutoCompleteBox >

Everything works fine if the user types an entry that is not in the list, or if the user selects an item from the list and then hits the "Tab" or "Enter" key. The problem I'm having occurs when the user arrows down the list to highlight an entry or types in the same text as an existing entry, and then uses the mouse to put the focus on another field on the page. When that happens, the text shows in the AutoCompleteBox correctly, but on the server side there are no entries added to the Control and the .Text property is also empty. Please help.
Mari
Top achievements
Rank 1
 answered on 01 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?