Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
136 views
Hi,

I have a context menu of 2 actions, create success message and create faliled message.  I want to add javascript confirmation to ask the user "are you sure you want to create success message for this Item <item name>?".  If the user answers Yes, the request will be posted back to the server, if the user answers No, I want to cancel the postback.  Can you provide code snippet how to do this? 

If I implement this code, will it be an issue in the future if your product is upgraded?  meaning that this is too much a custom code that depends on specific version?

Thanks.
Veli
Telerik team
 answered on 24 Feb 2011
3 answers
50 views
My requirement is that in radgrid i have to enable horizontal scrolling ,i dont need vertical scrolling as i want radgrid should resize itself as paging size is change but because of vertical scrolling its not resizing,i cant stop horizontal scroll as column are more .

please help me out how i  can achieve this thing,if you can build me small project and demonstrate it will be a good learning step for me .
Rahul
Top achievements
Rank 1
 answered on 24 Feb 2011
1 answer
80 views

When attempting to add a simple unordered list template to a RadComboBox with EnableLoadOnDemaned=true, I get this javascript error: 'attributes' is null or not an object.

<HeaderTemplate><ul></HeaderTemplate>
<ItemTemplate>
    <li><%# Container.Text %></li>
</ItemTemplate>
<FooterTemplate></ul></FooterTemplate>


Also tried accessing the DataItem property directly with the exact same result:

<HeaderTemplate><ul></HeaderTemplate>
<ItemTemplate>
    <li><%# DataBinder.Eval(Container.DataItem, "Name") %></li>
</ItemTemplate>
<FooterTemplate></ul></FooterTemplate>
Dimitar Terziev
Telerik team
 answered on 24 Feb 2011
4 answers
83 views
Hello,

With the previous version (december 2010) the RadWindow was working perfectly. I use VS2008 and Framework35
Now with latest version, released in January 2011, I'll get a blank window.  So what has changed in this new version?
Must I change/set something extra for this release?

The script that I have:

 

<script type="text/javascript">

function ShowDialog() { 

var oWnd = window.radopen("fundialog.aspx?ITD=" + document.getElementById('<%= txtITDAC.ClientID %>').value + "&FUN=" + document.getElementById('<%= txtFunctie.ClientID %>').value + "&EC=" + document.getElementById('<%= txtEC.ClientID %>').value, "DialogWindow");

 

  oWnd.SetUrl(oWnd.GetUrl()); }

 

 

  

function OnClientClose(oWnd, args) {

 

 

 

var arg = args.get_argument();

 

 

if(arg) {

 

 

if (arg.ARTFULLValue) document.getElementById('<%= txtArtFull.ClientID %>' ).value = arg.ARTFULLValue;

 

 

if (arg.FUNValue) document.getElementById('<%= txtFunctie.ClientID %>' ).value = arg.FUNValue;

 

 

if (arg.ECValue) document.getElementById('<%= txtECVNR.ClientID %>').value = " / " + arg.ECValue + " - " ;

 

 

if (arg.ECValue) document.getElementById('<%= txtEC.ClientID %>' ).value = arg.ECValue;

 

 

if (arg.FUNOMValue) document.getElementById('<%= txtFUNOM.ClientID %>' ).value = arg.FUNOMValue;

 

 

if (arg.EIValue) document.getElementById('<%= txtEI.ClientID %>' ).value = arg.EIValue;

 

 

if (arg.OUValue) document.getElementById('<%= txtOU.ClientID %>' ).value = arg.OUValue;

 

 

if (arg.ECGValue) document.getElementById('<%= txtECG.ClientID %>' ).value = arg.ECGValue;

 

 

}else alert("Er is geen artikel geselecteerd." );

 

 

}

 

 

 

</script>
 
<telerik:RadButton ID="btnFunctie" runat="server" onclientclicked="ShowDialog" AutoPostBack="False" Text="Selecteer"></telerik:RadButton >

 

 <telerik:RadWindowManager ID="RadWin" runat="server" onclientclose="OnClientClose" Top="40px" ReloadOnShow="True" Skin

 ="Black"> <Windows>

 

 

 

<telerik:RadWindow id="DialogWindow" runat ="server" OpenerElementId = "<%# btnFunctie.ClientID %>" OffsetElementId = "txtFunctie" Left="20px" Modal = "true" Width="1150px" Height="550px" Title="Zoek een artikel op" NavigateUrl ="">

 

 

 </telerik:RadWindow </Windows </telerik:RadWindowManager >

Greetz,
Kris

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Georgi Tunev
Telerik team
 answered on 24 Feb 2011
2 answers
142 views

Hello,

I would like to open/download a file saved like a Blob in a database.

There is the code. But It doesn't work !

Could you help me ?

Regards,

Bernard

<
asp:Content ID="Content2" ContentPlaceHolderID="cphMenu" runat="server">

    <telerik:RadToolBar ID="toolBar" runat="server" Width="100%" AutoPostBack="True"

        OnButtonClick="toolBar_ButtonClick">

        <Items>

            ……

            <telerik:RadToolBarButton runat="server" Value="DOC" ImageUrl="~/images/DocNumeriques.gif"

                Enabled="False">

            </telerik:RadToolBarButton>

        </Items>

    </telerik:RadToolBar>

</asp:Content>

 

 

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

<script type="text/javascript">

function openDoc()

{

      ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");

ajaxManager.set_enableAJAX(false);

setTimeout(function()

{

   ajaxManager.set_enableAJAX(true);

}, 0);

ajaxManager.ajaxRequest();

}

</script>

</telerik:RadCodeBlock>

CODE BEHIND

 


protected
void toolBar_ButtonClick(object sender, RadToolBarEventArgs e)

 

{

 

    try

 

    {

 

            switch (e.Item.Value)

 

            {

 

                  ……

 

                  case @"DOC":

 

                ScriptManager.RegisterStartupScript(this, this.GetType(), @"openDoc", @"openDoc();"true);

 

break;

 

……

 

}

 

}

 

      catch (Exception err)

 

      {

 

            ……

 

}

 

}

 

 

 

protected void manager_AjaxRequest(object sender, AjaxRequestEventArgs e)

 

{

 

    try

 

    {

 

           Byte[] aBlob = new Byte[…];

 

            â€¦â€¦

 

            Response.Clear();

 

            Response.ContentType = "application/octet-stream";

 

            Response.AddHeader("Content-Disposition", "attachment; filename=" + aFileName);

 

            Response.Flush();

 

            Response.BinaryWrite(aBlob);

 

            Response.End();

 

    }

 

      catch (Exception err)

 

      {

 

        â€¦â€¦

 

        }

 

}

Stéphane
Top achievements
Rank 1
 answered on 24 Feb 2011
0 answers
100 views
I am trying to put together the resource availability in the RadScheduler and I am having some trouble.  Basically, I used the resource availability demo code as my base and changed some of the parameters to fit my application.  Also, I do not need the "Room" availability to be considered in my argument, so I removed it from the resources.  However, when I run my application, I receive the following error:

Server Error in '/RadTest1' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 16: 
Line 17:             Dim assignedTo As Label = DirectCast(e.Container.FindControl("AssignedTo"), Label)
Line 18:             assignedTo.Text = "Held by: " + user.Text
Line 19:         End Sub
Line 20: 

Source File: C:\WebSites\RadTest1\Schedule.aspx.vb    Line: 18




Here is the code I am using.  Can someone help me out?

Thanks.

<%@ Page Language="VB" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Scheduler.ResourceAvailability.Schedule"
    CodeFile="Schedule.aspx.vb" %>
 
<%--<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="qsf" TagName="Header" Src="~/Common/Header.ascx" %>
<%@ Register TagPrefix="qsf" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
<%@ Register TagPrefix="qsf" TagName="Footer" Src="~/Common/Footer.ascx" %>
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="userStyles.css" />
</head>
<body class="BODY">
    <form id="Form1" method="post" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager2" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <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">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
    <script type="text/javascript">
 
        /* Helper functions */
 
        /// <summary>
        ///     Returns the appointments in the specified period filtered by the specified resource.
        /// </summary>
        /// <param name="scheduler">
        ///     RadScheduler's client-side object
        /// </param>
        /// <param name="start" type="Date">
        ///     The start of the period
        /// </param>
        /// <param name="end" type="Date">
        ///     The end of the period
        /// </param>
        /// <param name="resource">
        ///     The resource (room or user) to filter by
        /// </param>
        /// <param name="appointment">
        ///     The current appointment
        /// </param>
        function getAppointmentsInRangeByResource(scheduler, start, end, resource, appointment) {
            //Get all appointments within the specified time period
            var result = scheduler.get_appointments().getAppointmentsInRange(start, end);
 
            //If specified remove the appointment from the appointment list
            if (appointment)
                result.remove(appointment);
 
            //Filter the appointments based on the resource
            return result.findByResource(resource);
        }
 
        /// <summary>
        ///     Checks if the user associated with the specified appointment has another
        ///     appointment in the specified time period
        /// </sumary>
        /// <param name="scheduler">
        ///     RadScheduler's client-side object
        /// </param>
        /// <param name="start" type="Date">
        ///     The start of the period
        /// </param>
        /// <param name="end" type="Date">
        ///     The end of the period
        /// </param>
        /// <param name="appointment">
        ///     The current appointment
        /// </param>
        function isUserOccupied(scheduler, start, end, appointment) {
            //get the "User" resource associated with the appointment
            var currentUser = appointment.get_resources().getResourcesByType("User").getResource(0);
            //get all appointments in this period which are associated with this resource
            var appointmentsForThisUser = getAppointmentsInRangeByResource(scheduler, start, end, currentUser, appointment);
            //if the list of appointments is not empty the user has other appointments besides the specified in this time period
            return appointmentsForThisUser.get_count() > 0;
        }
        /// <summary>
        ///     Checks if there are other appointments within the specified time slot
        /// </sumary>
        /// <param name="scheduler">
        ///     RadScheduler's client-side object
        /// </param>
        /// <param name="start" type="Date">
        ///     The start of the period
        /// </param>
        /// <param name="end" type="Date">
        ///     The end of the period
        /// </param>
        /// <param name="slot">
        ///     The time slot to check
        /// </param>           
        function isRoomOccupied(scheduler, start, end, slot, appointment) {
            //get the "Room" resource associated with the time slot
            var currentRoom = slot.get_resource();
            //get all appointments for this "room" in the specified period
            var appointmentsForThisRoom = getAppointmentsInRangeByResource(scheduler, start, end, currentRoom, appointment);
            //if the list of appointments is not empty there are other appointments in this slot
            return appointmentsForThisRoom.get_count() > 0;
        }
 
        /// <summary>
        ///     Checks if the specified time slot is occupied and warns to prevent appointment rescheduling.
        ///     Called by the resizeEnd and moveEnd client-side event handlers.
        /// </sumary>
        function warnIfOccupied(start, end, sender, args) {
            var slot = args.get_targetSlot();
            var appointment = args.get_appointment();
 
            if (isUserOccupied(sender, start, end, appointment)) {
                alert("This user is occupied in this time period.");
                args.set_cancel(true);
            }
            else if (isRoomOccupied(sender, start, end, slot, appointment)) {
                alert("This room is not available in this time period.");
                args.set_cancel(true);
            }
 
            appointment.get_element().style.border = "";
        }
        /// <summary>
        ///     Checks if the specified time slot is occupied and visually shows it to the user.
        ///     Called by the resizeing and moving client-side event handlers.
        /// </sumary>
        function highlightIfOccupied(start, end, sender, args) {
            var appointment = args.get_appointment();
            var slot = args.get_targetSlot();
 
            if (isUserOccupied(sender, start, end, appointment) || isRoomOccupied(sender, start, end, slot, appointment)) {
                appointment.get_element().style.border = "1px solid red";
                return;
            }
 
            appointment.get_element().style.border = "";
        }
 
        function onAppointmentResizing(sender, args) {
            var start = args.get_appointment().get_start();
            var end = args.get_targetSlot().get_endTime();
 
            highlightIfOccupied(start, end, sender, args);
        }
 
        function onAppointmentResizeEnd(sender, args) {
            var start = args.get_appointment().get_start();
            var end = args.get_targetSlot().get_endTime();
 
            warnIfOccupied(start, end, sender, args);
        }
 
        function onAppointmentMoving(sender, args) {
            var start = args.get_targetSlot().get_startTime();
            var end = new Date(start.getTime() + args.get_appointment().get_duration());
            highlightIfOccupied(start, end, sender, args);
        }
 
        function onAppointmentMoveEnd(sender, args) {
            var start = args.get_targetSlot().get_startTime();
            var end = new Date(start.getTime() + args.get_appointment().get_duration());
 
            warnIfOccupied(start, end, sender, args);
        }
 
        function onAppointmentInserting(sender, args) {
            var slot = args.get_targetSlot();
            var start = slot.get_startTime();
            var end = slot.get_endTime();
 
            if (isRoomOccupied(sender, start, end, slot)) {
                alert("This room is not available in this time period.");
                args.set_cancel(true);
            }
        }
    </script>
    <telerik:RadComboBox ID="RadComboBox1" runat="server" AppendDataBoundItems="True"
        AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="FirstName" DataValueField="EmployeeID"
        Skin="WebBlue">
        <Items>
            <telerik:RadComboBoxItem runat="server" Selected="True" Text="Whole Office" Value="0" />
        </Items>
    </telerik:RadComboBox>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
        DeleteCommand="DELETE FROM [Appointments] WHERE [AppointmentID] = @AppointmentID"
        InsertCommand="INSERT INTO [Appointments] ([StartTime], [EndTime], [PatientID], [Description], [RecParent], [RecData], [EmployeeID]) VALUES (@StartTime, @EndTime, @PatientID, @Description, @RecParent, @RecData, @EmployeeID)"
        SelectCommand="IF @EmployeeID = 0 BEGIN SELECT * FROM [Appointments] END ELSE BEGIN SELECT * FROM [Appointments] WHERE ([EmployeeID] = @EmployeeID) END"
        UpdateCommand="UPDATE [Appointments] SET [StartTime] = @StartTime, [EndTime] = @EndTime, [PatientID] = @PatientID, [Description] = @Description, [RecParent] = @RecParent, [RecData] = @RecData, [EmployeeID] = @EmployeeID WHERE [AppointmentID] = @AppointmentID">
        <DeleteParameters>
            <asp:Parameter Name="AppointmentID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="StartTime" Type="DateTime" />
            <asp:Parameter Name="EndTime" Type="DateTime" />
            <asp:Parameter Name="PatientID" Type="Int32" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="RecParent" Type="Int32" />
            <asp:Parameter Name="RecData" Type="String" />
            <asp:Parameter Name="EmployeeID" Type="Int32" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="RadComboBox1" Name="EmployeeID" PropertyName="SelectedValue"
                Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="StartTime" Type="DateTime" />
            <asp:Parameter Name="EndTime" Type="DateTime" />
            <asp:Parameter Name="PatientID" Type="Int32" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="RecParent" Type="Int32" />
            <asp:Parameter Name="RecData" Type="String" />
            <asp:Parameter Name="EmployeeID" Type="Int32" />
            <asp:Parameter Name="AppointmentID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedDate="2007-03-30"
        DataSourceID="SqlDataSource1" DataKeyField="AppointmentID" DataSubjectField="PatientID"
        DataStartField="StartTime" DataEndField="EndTime" TimeZoneOffset="03:00:00" OnAppointmentCreated="RadScheduler1_AppointmentCreated"
        DataDescriptionField="Description" DataRecurrenceField="RecData" DataRecurrenceParentKeyField="RecParent"
        EnableDescriptionField="True" Skin="WebBlue" Height="1500px" MinutesPerRow="15"
        SelectedView="WeekView" AdvancedForm-Modal="True" AppointmentContextMenuSettings-EnableEmbeddedSkins="True"
        StartInsertingInAdvancedForm="True" TimelineView-ReadOnly="False">
        <TimelineView UserSelectable="false" />
        <WeekView UserSelectable="true" />
        <MonthView UserSelectable="true" />
        <DayView UserSelectable="true" />
        <ResourceTypes>
            <%--<telerik:ResourceType KeyField="ID" Name="Room" TextField="RoomName" ForeignKeyField="RoomID"
                    DataSourceID="RoomsDataSource" />--%>
            <telerik:ResourceType KeyField="EmployeeID" Name="User" TextField="FirstName" ForeignKeyField="AppointmentID"
                DataSourceID="SqlDataSource2" />
        </ResourceTypes>
        <ResourceStyles>
            <telerik:ResourceStyleMapping Type="User" Text="Alex" ApplyCssClass="rsCategoryBlue" />
            <telerik:ResourceStyleMapping Type="User" Text="Bob" ApplyCssClass="rsCategoryOrange" />
            <telerik:ResourceStyleMapping Type="User" Text="Charlie" ApplyCssClass="rsCategoryGreen" />
        </ResourceStyles>
        <AppointmentContextMenus>
            <telerik:RadSchedulerContextMenu runat="server" ID="ContextMenu1">
                <Items>
                    <telerik:RadMenuItem Text="Edit" Value="CommandEdit" />
                    <telerik:RadMenuItem IsSeparator="True" />
                    <%--<telerik:RadMenuItem Text="Categorize">
                        <Items>
                            <telerik:RadMenuItem Text="Development" Value="1" />
                            <telerik:RadMenuItem Text="Marketing" Value="2" />
                            <telerik:RadMenuItem Text="Personal" Value="3" />
                            <telerik:RadMenuItem Text="Work" Value="4" />
                        </Items>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="True" />--%>
                    <telerik:RadMenuItem Text="Delete" Value="CommandDelete" />
                </Items>
            </telerik:RadSchedulerContextMenu>
        </AppointmentContextMenus>
        <AppointmentTemplate>
            <%# Eval("Subject") %>
            <br />
            <asp:Label runat="server" ID="AssignedTo" />
        </AppointmentTemplate>
        <InlineInsertTemplate>
            <div id="InlineInsertTemplate">
                <asp:TextBox ID="TitleTextBox2" runat="server" Text='<%# Bind("Subject") %>' Width="90%"
                    TextMode="MultiLine" Height="20px"></asp:TextBox>
                <asp:LinkButton ID="InsertButton2" runat="server" CommandName="Insert">
                    <asp:Image runat="server" ID="insertImage2" ImageUrl="Images/ok.gif" AlternateText="update" />
                </asp:LinkButton>
                <asp:LinkButton ID="InsertCancelButton2" runat="server" CausesValidation="False"
                    CommandName="Cancel">
                    <asp:Image runat="server" ID="Image32" ImageUrl="Images/cancel.gif" AlternateText="cancel" />
                </asp:LinkButton>
                <%--<div class="inline-label">
                    Color code:</div>
                <asp:RadioButtonList runat="server" ID="AppointmentTypeRadioButtonList" DataValueField="ID"
                    CssClass="AppointmentTypeSelectorTable" DataSourceID="AppointmentTypesDataSource"
                    SelectedValue='<%# Bind("AppointmentTypeID") %>' DataTextField="Keyword" RepeatDirection="Horizontal"
                    DataTextFormatString="<span class='AppointmentTypeSelector rsAptType_{0}' onclick='onAppointmentTypeSelectorClick'></span>">
                </asp:RadioButtonList>--%>
                <asp:LinkButton ID="InsertMoreButton2" runat="server" CommandName="More" CssClass="rsAdvancedEditLink">Matt Advanced</asp:LinkButton>
            </div>
            <%--<asp:TextBox runat="server" ID="SubjectTextBox" Text='<%# Bind("Subject") %>' Width="99%"></asp:TextBox>
            <div class="UserToolbox">
                User: 
                <telerik:RadComboBox runat="server" ID="UsersComboBox" DataTextField="Text" DataValueField="Key"
                    Width="80px" Skin="Office2007" SelectedValue='<%# Bind("EmployeeID") %>' DataSource="<%# GetAvailableUsers(Container) %>">
                </telerik:RadComboBox>
                  
                <asp:LinkButton runat="server" ID="InsertLinkButton" CommandName="Insert" Text="Insert"></asp:LinkButton
                <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
            </div>--%>
        </InlineInsertTemplate>
        <InlineEditTemplate>
            <div id="InlineEditTemplate">
                <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Subject") %>' Width="90%"
                    TextMode="MultiLine" Height="20px"></asp:TextBox>
                <asp:LinkButton ID="InsertButton" runat="server" CommandName="Update">
                    <asp:Image runat="server" ID="insertImage" ImageUrl="Images/ok.gif" AlternateText="update" />
                </asp:LinkButton>
                <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel">
                    <asp:Image runat="server" ID="Image3" ImageUrl="Images/cancel.gif" AlternateText="cancel" />
                </asp:LinkButton>
                <%--<div class="inline-label">
                    Color code:</div>
                <asp:RadioButtonList runat="server" ID="AppointmentTypeRadioButtonList" DataValueField="ID"
                    CssClass="AppointmentTypeSelectorTable" DataSourceID="AppointmentTypesDataSource"
                    SelectedValue='<%# Bind("AppointmentTypeID") %>' DataTextField="Keyword" RepeatDirection="Horizontal"
                    DataTextFormatString="<span class='AppointmentTypeSelector rsAptType_{0}' onclick='onAppointmentTypeSelectorClick'></span>">
                </asp:RadioButtonList>--%>
                <asp:LinkButton ID="InsertMoreButton" runat="server" CommandName="More" CssClass="rsAdvancedEditLink">Matt Advanced</asp:LinkButton>
            </div>
            <%--<asp:TextBox runat="server" ID="SubjectTextBox" Text='<%# Bind("Subject") %>' Width="99%"></asp:TextBox>
            <div class="UserToolbox">
                User: 
                <telerik:RadComboBox runat="server" ID="UsersComboBox" DataTextField="Text" DataValueField="Key"
                    Width="80px" Skin="Office2007" SelectedValue='<%# Bind("EmployeeID") %>' DataSource="<%# GetAvailableUsers(Container) %>">
                </telerik:RadComboBox>
                  
                <asp:LinkButton runat="server" ID="UpdateLinkButton" CommandName="Update" Text="Update"></asp:LinkButton
                <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
            </div>--%>
        </InlineEditTemplate>
        <TimeSlotContextMenuSettings EnableDefault="true" />
        <AppointmentContextMenuSettings EnableDefault="true" />
    </telerik:RadScheduler>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
        DeleteCommand="DELETE FROM [Employees] WHERE [EmployeeID] = @EmployeeID" InsertCommand="INSERT INTO [Employees] ([PracticeID], [FirstName], [LastName], [SSN], [Street], [City], [State], [Zip], [HomePhone], [CellPhone], [Email]) VALUES (@PracticeID, @FirstName, @LastName, @SSN, @Street, @City, @State, @Zip, @HomePhone, @CellPhone, @Email)"
        SelectCommand="SELECT * FROM [Employees]" UpdateCommand="UPDATE [Employees] SET [PracticeID] = @PracticeID, [FirstName] = @FirstName, [LastName] = @LastName, [SSN] = @SSN, [Street] = @Street, [City] = @City, [State] = @State, [Zip] = @Zip, [HomePhone] = @HomePhone, [CellPhone] = @CellPhone, [Email] = @Email WHERE [EmployeeID] = @EmployeeID">
        <DeleteParameters>
            <asp:Parameter Name="EmployeeID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="PracticeID" Type="Int32" />
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="SSN" Type="String" />
            <asp:Parameter Name="Street" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="State" Type="String" />
            <asp:Parameter Name="Zip" Type="Int32" />
            <asp:Parameter Name="HomePhone" Type="String" />
            <asp:Parameter Name="CellPhone" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="PracticeID" Type="Int32" />
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="SSN" Type="String" />
            <asp:Parameter Name="Street" Type="String" />
            <asp:Parameter Name="City" Type="String" />
            <asp:Parameter Name="State" Type="String" />
            <asp:Parameter Name="Zip" Type="Int32" />
            <asp:Parameter Name="HomePhone" Type="String" />
            <asp:Parameter Name="CellPhone" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="EmployeeID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>


Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
 
Namespace Telerik.Web.Examples.Scheduler.ResourceAvailability
    Partial Public Class Schedule
        Inherits Page
        Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        End Sub
 
        Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As Object, ByVal e As AppointmentCreatedEventArgs)
            Dim user As Resource = e.Appointment.Resources.GetResourceByType("User")
 
            Dim assignedTo As Label = DirectCast(e.Container.FindControl("AssignedTo"), Label)
            assignedTo.Text = "Held by: " + user.Text
        End Sub
 
        Protected Function GetAvailableUsers(ByVal container As Control) As IEnumerable
            Dim appointment As Appointment = (DirectCast(container, SchedulerFormContainer)).Appointment
 
            Dim availableUsers As New List(Of Resource)(RadScheduler1.Resources.GetResourcesByType("User"))
            For Each appointmentInRange As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(appointment.Start, appointment.[End])
                If appointmentInRange Is appointment Then
                    Continue For
                End If
 
                For Each occupiedUser As Resource In appointmentInRange.Resources.GetResourcesByType("User")
                    availableUsers.Remove(occupiedUser)
                Next
            Next
 
            Return availableUsers
        End Function
    End Class
End Namespace
Matt
Top achievements
Rank 1
 asked on 24 Feb 2011
1 answer
131 views
Hi,
I have a radgrid which is data bound using only javascript without any server side binding. Now i want to adjust filter box widths for different columns.
For Ex: If column name is "SR" then i have to adjust width to 30px. If column name is "Name" then adjust it to 50px.

Please let me know how to achieve it using javascript only.

Thanks in advance for helping...
Iana Tsolova
Telerik team
 answered on 24 Feb 2011
2 answers
74 views
Hi,

How can I set the colour/style of specific nodes according to the value of a field in a datasource? For example, if I assign a datasourceid for the treeview which has a boolean/bit field then the nodes that have a value of true/1 should be bold.

Regards,
Ray
Ray Bezuidenhout
Top achievements
Rank 1
 answered on 24 Feb 2011
1 answer
141 views
Is there a way to prevent the user from collapsing nodes on the clientside? I need to keep the whole TreeList fully expanded at all times :-)

Best regards,
Lars Melkevik
Veli
Telerik team
 answered on 24 Feb 2011
4 answers
172 views
Hi,

I know it is possible to setup client side caching declaratively with the RadGrid using the ClientSettings.DataBinding.EnableCaching setting.
However, is it possible to do this with programmatic client side binding?
I am using set_dataSource() and dataBind() methods in Javascript to do the client side binding and I would like to also use caching to implement sorting purely on the client side without any server side callbacks.
Is this possible?

Many thanks,
      Charles Gamble.
Veli
Telerik team
 answered on 24 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?