Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
141 views
I want to use a radiobutton as an additional field in the radUpload control.
I wish to force the user to select either of two choices.
I have created the javascript so they show up correctly on the page, but I cannot access the values from the UploadedFiles collection.

here is the java to create the additional fields.
var numberOfCustomFields = 0;  
function OnClientAddedHandler(sender, eventArgs)  
{  
  var inputRow = eventArgs.get_row();  
  var uList = inputRow.parentNode;  
  var count = 0;  
      
  //new row for a User Manual Category check box  
  newRow = document.createElement("li");  
  count++;  
  uList.insertBefore(newRow, inputRow);  
  var label = document.createElement("span");  
  label.innerHTML = "Manuals/Add. info";  
  label.style.fontSize = 12;  
  input = document.createElement("input");  
  input.type = "radio";  
  input.name = "group" + count;  
  input.id  = sender.getID("radUserManual");     
  newRow.appendChild(input);  
  newRow.appendChild(label);  
    
  //new row for a Cut-Sheets Category check box  
  newRow = document.createElement("li");  
  count++;  
  uList.insertBefore(newRow, inputRow);  
  var label = document.createElement("span");  
  label.innerHTML = "FFE Cut Sheet";  
  label.style.fontSize = 12;  
  input = document.createElement("input");  
  input.type = "radio";  
  input.name = "group"+ count;  
  input.id = sender.getID("radCutSheet");     
  newRow.appendChild(input);  
  newRow.appendChild(label);  
   
  // Set the number of fields from the count    
  numberOfCustomFields = count;  
}  
function OnClientDeletingHandler(sender, eventArgs)  
{  
   var input = eventArgs.get_fileInputField();  
   deleteCustomFields(input);  
}  
function OnClientDeletingSelectedHandler(sender, eventArgs)  
{  
  var inputs = eventArgs.get_fileInputFields();  
    
  for (i = 0; i < inputs.length; i++)  
  {  
    deleteCustomFields(inputs[i]);       
  }  
  eventArgs.set_cancel(true);  
}  
function deleteCustomFields(input)  
{  
   var li = input.parentNode.parentNode;  
   var ul = input.parentNode.parentNode.parentNode;  
     
   for (var i = 0; i < numberOfCustomFields; i++)  
   {     
       ul.removeChild(li.previousSibling);          
   }      
   ul.removeChild(li);  
}  
 

and here is where i am trying to get the additional fields values.

For Each f As Telerik.Web.UI.UploadedFile In RadUpload1.UploadedFiles  
                If f.GetIsFieldChecked("radCutSheet") Then  
                    sCategory = "Cutsheet" 
                ElseIf f.GetIsFieldChecked("radUserManual") Then  
                    sCategory = "User Manual" 
                End If  
 
                If Directory.Exists(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/") Then  
                    f.SaveAs(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/" & f.GetName, True)  
                Else  
                    Directory.CreateDirectory(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/")  
                    f.SaveAs(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/" & f.GetName, True)  
                End If  
 
                'Insert record into the database - because this file may exists we need to create a stored proc  
                'that will do an insert or an update.  
                'StoreNameinDB(strPath & Replace(txtStockNumber.Text.Trim, "-", "") & "/" & f.GetName, sCategory)  
 
            Next 
bharti ten
Top achievements
Rank 1
 answered on 19 Feb 2010
3 answers
115 views
Hi,
My program logic is as below:
(1).Information in RadGrid is all show in label.
(2).User click on the Edit Icon which has CommandName= "Edit".
(3). GirdView turn into Edit Mode and user key in the information in the textBox.
(4)User click on the Update icon which has CommandName ="Update" and then fire UpdateCommand event.

My problem is in the UpdateCommand Event , i am not able to get the information that has been edited by user.I can only get information that is as before edited.
The purpose to have UpdateCommand event fire is to have checking and perform update action.
Does any one has idea on this?

My Coding is as below:



[code]
Protected Sub ajaxGridPlant_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles ajaxGridPlant.UpdateCommand
       
        Dim strCompanyNo As String
        Dim strPlantName As String
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim strPlantNo As String
        Dim strLastModifiedBy As String
        Dim dteLastModifiedOn As DateTime


        Try




            strCompanyNo = CType(editedItem.FindControl("ddlCompanyNo"), RadComboBox).SelectedItem.Value

            strPlantNo = CType(editedItem.FindControl("txtPlant"), TextBox).Text

            strPlantName = CType(editedItem.FindControl("txtPlantName"), TextBox).Text

            strLastModifiedBy = CType(editedItem.FindControl("lblEditLastModifiedBy"), Label).Text
            dteLastModifiedOn = CType(editedItem.FindControl("lblEditLastModifiedOn"), Label).Text


            If strPlantNo = "" Then
                Throw New Exception("OMG!!")

            End If

            'UpdateRecord(strCompanyNo, strPlantNo, strPlantName, strLastModifiedBy, dteLastModifiedOn)

        Catch ex As Exception
            Alert(ex.Message)

        End Try
[/code]
johnson lim
Top achievements
Rank 1
 answered on 19 Feb 2010
1 answer
253 views
I'm trying to use a GridNumericColumn in a Grid using InPlace editing.  The field is a decimal 18,10 in Sql Server. Length of 8 to left and 10 to right of decimal.  The field displays properly in both item and edit modes. However, when you click on the field to edit, the field cuts off to only 2 decimal places to the right.   I've tried several different things but haven't got it to work.  I figured there be a decimal postion property but don't see one. The line is listed below in its current format. But this isn't working properly.

                            <telerik:GridNumericColumn UniqueName="Reduction" SortExpression="Reduction" HeaderText="Reduction" DataField="Reduction" FooterText="NumericColumn footer" NumericType="Number" AllowRounding="false" DataType="System.Decimal" KeepNotRoundedValue="true" DataFormatString="{0:F10}"  >                              
                            </telerik:GridNumericColumn>   


Thanks
Shinu
Top achievements
Rank 2
 answered on 19 Feb 2010
1 answer
276 views
    <script type="text/javascript">                                                                                                                                            
        function docFileGridOnRowCreated(sender, eventArgs) { } 
        function docFileGridOnRowCreating(sender, eventArgs) { } 
         
        function docFileGridOnRowDblClick(sender, eventArgs)  
        {  
            alert(eventArgs.get_gridDataItem().get_dataItem()); 
        } 
    </script>      
    <style type="text/css">                         
    </style>   
 
       
    <asp:Button ID="btn" runat="server" Text="Save" /> 
    <cym:RadGrid ID="docFileGrid" runat="server" DataSourceID="docFileODS" 
        ClientSettings-ClientEvents-OnRowDblClick=""
        <ClientSettings> 
            <ClientEvents OnRowCreated="docFileGridOnRowCreated" 
                OnRowCreating="docFileGridOnRowCreating" OnRowDblClick="docFileGridOnRowDblClick" />             
        </ClientSettings> 
        <MasterTableView DataKeyNames="AccountFileID, AccountID, FileID, GUID"
            <Columns>                 
                <rad:GridBoundColumn DataField="FileName" HeaderText="Name" />    
        </MasterTableView> 
    </cym:RadGrid> 

I've subscribed to the OnRowCreated/OnRowCreating event as per the documentation's instructions; however, get get_dataItem() and get_dataKeyValue() methods return null.  What am I doing wrong?
Shinu
Top achievements
Rank 2
 answered on 19 Feb 2010
4 answers
114 views
When I use Editor control on the custom user control and try to export PDF, the PDF is not generating. Any Ideas to fix this?
Praveen
Top achievements
Rank 1
 answered on 19 Feb 2010
12 answers
583 views

So I found this example on how create a dropdown and bind it to the grid.

<!--GridDropDownColumn example-->    
<telerik:GridDropDownColumn DataSourceID="SqlDataSource3" ListTextField="City" ListValueField="City"     
          UniqueName="City" HeaderText="RadComboBox Column" DataField="City"     
          DropDownControlType="RadComboBox">     
</telerik:GridDropDownColumn>     
    
<!--New SqlDataSource for DropDownColumn -->    
<asp:SqlDataSource runat="server" ID="SqlDataSource3" ConnectionString="<%$     
          ConnectionStrings:NorthwindConnectionString %>"     
          SelectCommand="SELECT DISTINCT [City] FROM [Employees]">    
</asp:SqlDataSource>    
 

But lets say I have 3 columns:  Col1, Col2 and Col3

Col1 is a drop down with static values.
Col2 is a dropdown as well but the values displayed will be dependent on what value was selected in Col1.
Col3 is a dropdown as well but the values displayed will be dependent on what values were select in Col1 and Col2.

I would need to use a stored procedure for this, no in-line sql code can be used. 
Would you be able to show me an example of how to do this?

Thanks,
Nathan

ps. if you could do vb examples if possilbe
Erwin Floresca
Top achievements
Rank 1
 answered on 19 Feb 2010
1 answer
70 views
To deal with issues of translations for the radGrid I call a routine that looks at the value in various string properties and then do a translation if needed (i.e. the string would be something like %Resource%Mnemonic%) with routines to show the mnemonic on screen for debugging as [Resource].[Mnemonic].

There's a difference in behaviour between how the Grid behaves with these two lines:
  • grid.MasterTableView.CommandItemSettings.RefreshText =
  • ResourceTranslation.TranslateField(grid.MasterTableView.CommandItemSettings.RefreshText);
  • grid.MasterTableView.Caption =
  • ResourceTranslation.TranslateField(grid.MasterTableView.Caption);
    •  

      I would expect them to behave the same...

       

      On the initial get I get:


       

      [CurrentPage].[AccountSummaryTable]

       

    and [MasterPage].[Grid_RefreshText]   
    as expected.

    On a post back, it changes to:
    [Error].[[CurrentPage].[AccountSummaryTable]]
    and [MasterPage].[Grid_RefreshText]   

    In other words -- one property appears to be getting it from the original properties and the other from the current properties.

    The bug is the inconsistancy. I can easily code around it -- but I thought it should be reported.
    Ken Lassesen
    Top achievements
    Rank 2
     answered on 19 Feb 2010
    5 answers
    164 views
    Hey Guys,

    I am attempting to create a schedule that will track nurse jobs/availabilies.

    For this, I have created a resource called 'Facilitator' (the nurse).

    I am trying to implement the Resource Avalability Demo from the telerik site, so that a single Facilitator cannot be double booked, and keep running into the following error with the javascript -

    • appointment.get_resources is not a function

    This is doing me head in, so any assistance would be appeciated.

    BTW - RadControls for ASP.NET AJAX Q2 2009

    in the function isFacilitatorOccupied the first line of code is -

    • var currentFacilitator = appointment.get_resources().getResourcesByType("Facilitator").getResource(0);

    .aspx page

    <%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title></title
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" /> 
        <link href="cssStyle.css" rel="stylesheet" type="text/css" /> 
    </head> 
    <body> 
        <form id="form1" runat="server" method="post"
         
        <h1>Medical Schedule</h1> 
         
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            <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" /> 
            </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" /> 
     
        <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Default" /> 
         
        <script type="text/javascript"
            /* <![CDATA[ */    
                /* 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 isFacilitatorOccupied(scheduler, start, end, appointment)
                {
                    //get the "User" resource associated with the appointment
                    var currentFacilitator = appointment.get_resources().getResourcesByType("Facilitator").getResource(0);
                    
                    //get all appointments in this period which are associated with this resource
                    var appointmentsForThisFacilitator = getAppointmentsInRangeByResource(scheduler, start, end, currentFacilitator, appointment);
                    
                    //if the list of appointments is not empty the user has other appointments besides the specified in this time period
                    return appointmentsForThisFacilitator.get_count() > 0;
                }
                function warnIfOccupied(start, end, sender, args)
                {
                    var slot = args.get_targetSlot();
                    var appointment = args.get_appointment();
                    if (isFacilitatorOccupied(sender, start, end, appointment))
                    {
                        alert("This Facilitator is occupied 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)
                {
                    alert("4");
                    
                    var appointment = args.get_appointment();
                    var slot = args.get_targetSlot();
                    if (isFacilitatorOccupied(sender, start, end, 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 (isFacilitatorOccupied(sender, start, end, slot))
                    {
                        alert("This Facilitator is not available in this time period.");
                        args.set_cancel(true);
                    }
                }
            /* ]]> */ 
            </script> 
         
        <div> 
         
        <table cellspacing="0" cellpadding="5" class="Refinement"
        <tr valign="top"
            <td><h3>State:</h3></td
            <td><h3>Group By:</h3></td
            <td><h3>Direction:</h3></td
            <td><asp:Label ID="lblStates" runat="server" Text="Test Label" Visible="false" /></td
        </tr> 
        <tr valign="top"
            <td> 
                <asp:CheckBoxList runat="server" id="chkState" RepeatLayout="Table" RepeatDirection="Horizontal" RepeatColumns="5" Width="400px"
                <asp:ListItem Text="ACT" Value="ACT" /> 
                <asp:ListItem Text="NSW" Value="NSW" /> 
                <asp:ListItem Text="NT" Value="NT" /> 
                <asp:ListItem Text="NZ" Value="NZ" /> 
                <asp:ListItem Text="QLD" Value="QLD" /> 
                <asp:ListItem Text="SA" Value="SA" /> 
                <asp:ListItem Text="TAS" Value="TAS" /> 
                <asp:ListItem Text="VIC" Value="VIC" /> 
                <asp:ListItem Text="WA" Value="WA" /> 
                </asp:CheckBoxList> 
            </td> 
            <td> 
                <telerik:RadComboBox ID="ddlGroupBy" Runat="server" > 
                <Items> 
                <telerik:RadComboBoxItem runat="server" Selected="True" Text="None" /> 
                <telerik:RadComboBoxItem runat="server" Text="Activity" Value="Activity" /> 
                <telerik:RadComboBoxItem runat="server" Text="Facilitator" Value="Facilitator" /> 
                <telerik:RadComboBoxItem runat="server" Text="Client" Value="Client" /> 
                <telerik:RadComboBoxItem runat="server" Text="State" Value="State" /> 
                </Items> 
                </telerik:RadComboBox> 
            </td> 
            <td> 
                <telerik:RadComboBox ID="ddlGroupingDirection" Runat="server"
                <Items> 
                <telerik:RadComboBoxItem runat="server" Text="Vertical" Value="Vertical" Selected="True" /> 
                <telerik:RadComboBoxItem runat="server" Text="Horizontal" Value="Horizontal" /> 
                </Items> 
                </telerik:RadComboBox> 
            </td> 
            <td><asp:ImageButton runat="server" ID="btnSubmit_Refinement" ImageUrl="images/buttons/btnSubmit_Refinement.jpg" /></td
        </tr> 
        </table>        
         
        <br /> 
         
         
        <br /> 
     
        <telerik:RadScheduler ID="RadScheduler1" runat="server"  
                DataKeyField="ID" DataSourceID="dsSchedule" DataStartField="Start" DataEndField="End" DataSubjectField="Subject"   
                DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" 
                HoursPanelTimeFormat="htt" MinutesPerRow="15"  
                ValidationGroup="RadScheduler1" Height="700px" Skin="WebBlue" 
                Culture="English (Australia)" WorkDayEndTime="18:00:00"  
                FirstDayOfWeek="Monday" RowHeaderWidth="100px" 
                StartInsertingInAdvancedForm="True"  
                OnAppointmentCreated="RadScheduler1_AppointmentCreated" 
                OnClientAppointmentInserting="onAppointmentInserting" 
                OnClientAppointmentMoving="onAppointmentMoving" OnClientAppointmentMoveEnd="onAppointmentMoveEnd" 
                OnClientAppointmentResizing="onAppointmentResizing" OnClientAppointmentResizeEnd="onAppointmentResizeEnd"
                 
                 
            <ResourceTypes> 
                <telerik:ResourceType DataSourceID="dsActivity"    ForeignKeyField="Activity_ID"     KeyField="Activity_ID"    Name="Activity"    TextField="Activity_Name"  /> 
                <telerik:ResourceType DataSourceID="dsFacilitator" ForeignKeyField="Facilitator_ID"  KeyField="Facilitator_ID" Name="Facilitator" TextField="FirstName" /> 
                <telerik:ResourceType DataSourceID="dsClient"      ForeignKeyField="Client_ID"       KeyField="Client_ID"      Name="Client"      TextField="Client_Name" /> 
                <telerik:ResourceType DataSourceID="dsState"       ForeignKeyField="State"           KeyField="State"          Name="State"       TextField="State" /> 
            </ResourceTypes> 
             
            <Localization AdvancedAllDayEvent="All day"></Localization> 
            <AdvancedForm DateFormat="d/MM/yyyy" TimeFormat="h:mm tt"></AdvancedForm> 
            <TimelineView UserSelectable="false" /> 
            <MultiDayView UserSelectable="false" /> 
             
            <AppointmentTemplate> 
                <%# Eval("Client.Text") %> - <%# Eval("Activity.Text") %> - <%# Eval("Facilitator.Text") %> 
            </AppointmentTemplate> 
             
            <InlineInsertTemplate> 
                <asp:TextBox runat="server" ID="SubjectTextBox" Text='<%# Bind("Subject") %>' Width="99%"></asp:TextBox> 
                <div class="UserToolbox"
                 User:&nbsp; 
                 <telerik:RadComboBox runat="server" ID="FacilitatorComboBox" DataTextField="Facilitator_Display" DataValueField="Facilitator_ID" 
                     Width="80px" Skin="Office2007" SelectedValue='<%# Bind("Facilitator_ID") %>' DataSource='<%# GetAvailableFacilitators(Container) %>'
                 </telerik:RadComboBox>&nbsp; 
                 <asp:LinkButton runat="server" ID="InsertLinkButton" CommandName="Insert" Text="Insert"></asp:LinkButton>&nbsp; 
                 <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton> 
                </div> 
            </InlineInsertTemplate> 
             
            <InlineEditTemplate> 
                <asp:TextBox runat="server" ID="SubjectTextBox" Text='<%# Bind("Subject") %>' Width="99%"></asp:TextBox> 
                <div class="UserToolbox"
                 User:&nbsp; 
                 <telerik:RadComboBox runat="server" ID="FacilitatorComboBox" DataTextField="Facilitator_Display" DataValueField="Facilitator_ID" 
                     Width="80px" Skin="Office2007" SelectedValue='<%# Bind("Facilitator_ID") %>' DataSource='<%# GetAvailableFacilitators(Container) %>' > 
                 </telerik:RadComboBox>&nbsp; 
                 <asp:LinkButton runat="server" ID="UpdateLinkButton" CommandName="Update" Text="Update"></asp:LinkButton>&nbsp; 
                 <asp:LinkButton runat="server" ID="CancelLinkButton" CommandName="Cancel" Text="Cancel"></asp:LinkButton> 
                </div> 
            </InlineEditTemplate> 
     
             
        </telerik:RadScheduler> 
     
            <asp:SqlDataSource ID="dsSchedule" runat="server"  
                ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
                SelectCommand="SELECT [ID], [Subject], [Start], [End], [Facilitator_ID], [RecurrenceRule], [RecurrenceParentID], [Annotations], [Activity_ID], [Client_ID], [Comments], [State] FROM [Appointments]"  
                ConflictDetection="CompareAllValues"  
                DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @original_ID AND [Subject] = @original_Subject AND [Start] = @original_Start AND [End] = @original_End AND (([Facilitator_ID] = @original_Facilitator_ID) OR ([Facilitator_ID] IS NULL AND @original_Facilitator_ID IS NULL)) AND (([RecurrenceRule] = @original_RecurrenceRule) OR ([RecurrenceRule] IS NULL AND @original_RecurrenceRule IS NULL)) AND (([RecurrenceParentID] = @original_RecurrenceParentID) OR ([RecurrenceParentID] IS NULL AND @original_RecurrenceParentID IS NULL)) AND (([Annotations] = @original_Annotations) OR ([Annotations] IS NULL AND @original_Annotations IS NULL)) AND (([Activity_ID] = @original_Activity_ID) OR ([Activity_ID] IS NULL AND @original_Activity_ID IS NULL)) AND (([Client_ID] = @original_Client_ID) OR ([Client_ID] IS NULL AND @original_Client_ID IS NULL)) AND (([Comments] = @original_Comments) OR ([Comments] IS NULL AND @original_Comments IS NULL)) AND (([State] = @original_State) OR ([State] IS NULL AND @original_State IS NULL))"  
                InsertCommand="INSERT INTO [Appointments] ([Subject], [Start], [End], [Facilitator_ID], [RecurrenceRule], [RecurrenceParentID], [Annotations], [Activity_ID], [Client_ID], [Comments], [State]) VALUES (@Subject, @Start, @End, @Facilitator_ID, @RecurrenceRule, @RecurrenceParentID, @Annotations, @Activity_ID, @Client_ID, @Comments, @State)"  
                OldValuesParameterFormatString="original_{0}"  
                UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [Facilitator_ID] = @Facilitator_ID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Annotations] = @Annotations, [Activity_ID] = @Activity_ID, [Client_ID] = @Client_ID, [Comments] = @Comments, [State] = @State WHERE [ID] = @original_ID AND [Subject] = @original_Subject AND [Start] = @original_Start AND [End] = @original_End AND (([Facilitator_ID] = @original_Facilitator_ID) OR ([Facilitator_ID] IS NULL AND @original_Facilitator_ID IS NULL)) AND (([RecurrenceRule] = @original_RecurrenceRule) OR ([RecurrenceRule] IS NULL AND @original_RecurrenceRule IS NULL)) AND (([RecurrenceParentID] = @original_RecurrenceParentID) OR ([RecurrenceParentID] IS NULL AND @original_RecurrenceParentID IS NULL)) AND (([Annotations] = @original_Annotations) OR ([Annotations] IS NULL AND @original_Annotations IS NULL)) AND (([Activity_ID] = @original_Activity_ID) OR ([Activity_ID] IS NULL AND @original_Activity_ID IS NULL)) AND (([Client_ID] = @original_Client_ID) OR ([Client_ID] IS NULL AND @original_Client_ID IS NULL)) AND (([Comments] = @original_Comments) OR ([Comments] IS NULL AND @original_Comments IS NULL)) AND (([State] = @original_State) OR ([State] IS NULL AND @original_State IS NULL))"
                <DeleteParameters> 
                    <asp:Parameter Name="original_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Subject" Type="String" /> 
                    <asp:Parameter Name="original_Start" Type="DateTime" /> 
                    <asp:Parameter Name="original_End" Type="DateTime" /> 
                    <asp:Parameter Name="original_Facilitator_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_RecurrenceRule" Type="String" /> 
                    <asp:Parameter Name="original_RecurrenceParentID" Type="Int32" /> 
                    <asp:Parameter Name="original_Annotations" Type="String" /> 
                    <asp:Parameter Name="original_Activity_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Client_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Comments" Type="String" /> 
                    <asp:Parameter Name="original_State" Type="String" /> 
                </DeleteParameters> 
                <UpdateParameters> 
                    <asp:Parameter Name="Subject" Type="String" /> 
                    <asp:Parameter Name="Start" Type="DateTime" /> 
                    <asp:Parameter Name="End" Type="DateTime" /> 
                    <asp:Parameter Name="Facilitator_ID" Type="Int32" /> 
                    <asp:Parameter Name="RecurrenceRule" Type="String" /> 
                    <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> 
                    <asp:Parameter Name="Annotations" Type="String" /> 
                    <asp:Parameter Name="Activity_ID" Type="Int32" /> 
                    <asp:Parameter Name="Client_ID" Type="Int32" /> 
                    <asp:Parameter Name="Comments" Type="String" /> 
                    <asp:Parameter Name="State" Type="String" /> 
                    <asp:Parameter Name="original_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Subject" Type="String" /> 
                    <asp:Parameter Name="original_Start" Type="DateTime" /> 
                    <asp:Parameter Name="original_End" Type="DateTime" /> 
                    <asp:Parameter Name="original_Facilitator_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_RecurrenceRule" Type="String" /> 
                    <asp:Parameter Name="original_RecurrenceParentID" Type="Int32" /> 
                    <asp:Parameter Name="original_Annotations" Type="String" /> 
                    <asp:Parameter Name="original_Activity_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Client_ID" Type="Int32" /> 
                    <asp:Parameter Name="original_Comments" Type="String" /> 
                    <asp:Parameter Name="original_State" Type="String" /> 
                </UpdateParameters> 
                <InsertParameters> 
                    <asp:Parameter Name="Subject" Type="String" /> 
                    <asp:Parameter Name="Start" Type="DateTime" /> 
                    <asp:Parameter Name="End" Type="DateTime" /> 
                    <asp:Parameter Name="Facilitator_ID" Type="Int32" /> 
                    <asp:Parameter Name="RecurrenceRule" Type="String" /> 
                    <asp:Parameter Name="RecurrenceParentID" Type="Int32" /> 
                    <asp:Parameter Name="Annotations" Type="String" /> 
                    <asp:Parameter Name="Activity_ID" Type="Int32" /> 
                    <asp:Parameter Name="Client_ID" Type="Int32" /> 
                    <asp:Parameter Name="Comments" Type="String" /> 
                    <asp:Parameter Name="State" Type="String" /> 
                </InsertParameters> 
            </asp:SqlDataSource> 
     
        </div> 
         
         
         
         
        <asp:SqlDataSource ID="dsActivity" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
            SelectCommand="SELECT [Activity_ID], [Activity_Name], [Description], [Appt_Duration], [Acronym], [Status] FROM [Activity]"
        </asp:SqlDataSource> 
         
        <asp:SqlDataSource ID="dsFacilitator" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
            SelectCommand="SELECT [Facilitator_ID], [FirstName], [LastName], [Phone1], [Phone2], [Phone3], [Email1], [Email2], [Status], [LastName] + ', ' + [FirstName] As [Facilitator_Display] FROM [Facilitator]"
        </asp:SqlDataSource> 
         
        <asp:SqlDataSource ID="dsClient" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
            SelectCommand="SELECT [Client_ID], [Client_Code], [Client_Name], [Client_Address], [Client_Contact_FirstName], [Client_Contact_LastName], [Client_Phone1], [Client_Phone2], [Client_Phone3], [Client_Email1], [Client_Email2], [Client_Status] FROM [Client]"
        </asp:SqlDataSource> 
         
        <asp:SqlDataSource ID="dsState" runat="server"  
            ConnectionString="<%$ ConnectionStrings:ScheduleConnectionString %>"  
            SelectCommand="SELECT [State], [TimeZoneOffset], [HasDaylightSaving] FROM [State]"
        </asp:SqlDataSource> 
     
         
         
         
         
        </form> 
    </body> 
    </html> 
     

    aspx.vb page

    Imports Telerik.Web.UI 
    Imports System.Web.Security 
    Imports System.Web.UI.WebControls 
    Imports System.Data 
    Imports System.Data.Common 
    Imports System.Data.SqlClient 
    Imports System.Drawing 
    Imports System.Collections 
    Imports System.Collections.Generic 
     
    Partial Class _Default 
        Inherits System.Web.UI.Page 
     
        Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
     
        End Sub 
     
        Protected Sub RadScheduler1_AppointmentDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.SchedulerEventArgs) Handles RadScheduler1.AppointmentDataBound 
            If e.Appointment.Resources.GetResourceByType("Client") <> Nothing Then 
                Select Case e.Appointment.Resources.GetResourceByType("Client").Text 
                    Case "Client1" 
                        e.Appointment.CssClass = "rsCategoryBlue" 
                        Exit Select 
                    Case "Client2" 
                        e.Appointment.CssClass = "rsCategoryOrange" 
                        Exit Select 
                    Case "Client13" 
                        e.Appointment.CssClass = "rsCategoryGreen" 
                        Exit Select 
                    Case Else 
                        Exit Select 
                End Select 
            End If 
        End Sub 
         
     
        Protected Sub btnSubmit_Refinement_Click(ByVal sender As ObjectByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSubmit_Refinement.Click 
     
            RadScheduler1.GroupBy = ddlGroupBy.SelectedValue 
     
            RadScheduler1.GroupingDirection = DirectCast([Enum].Parse(GetType(GroupingDirection), ddlGroupingDirection.SelectedValue), GroupingDirection) 
     
            If chkState.SelectedIndex > -1 Then 
     
                Dim myStateRefinement As String = "" 
     
                For Each li As ListItem In chkState.Items 
                    If li.Selected = True Then 
     
                        If myStateRefinement = "" Then 
                            myStateRefinement = "State = '" & li.Value & "'" 
                        Else 
                            myStateRefinement += " OR State = '" & li.Value & "'" 
                        End If 
     
                    End If 
                Next 
     
                dsState.SelectCommand = "Select * FROM State where " & myStateRefinement 
                dsState.DataBind() 
     
                dsSchedule.SelectCommand = "Select * FROM Appointments where " & myStateRefinement 
                dsSchedule.DataBind() 
     
            End If 
     
        End Sub 
     
        Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As ObjectByVal e As AppointmentCreatedEventArgs) 
            Dim Facilitator As Resource = e.Appointment.Resources.GetResourceByType("Facilitator"
     
            'Dim assignedTo As Label = DirectCast(e.Container.FindControl("AssignedTo"), Label) 
            'assignedTo.Text = "Held by: " + Facilitator.Text 
        End Sub 
     
        Protected Function GetAvailableFacilitators(ByVal container As Control) As IEnumerable 
            Dim appointment As Appointment = (DirectCast(container, SchedulerFormContainer)).Appointment 
     
            Dim availableFacilitator As New List(Of Resource)(RadScheduler1.Resources.GetResourcesByType("Facilitator")) 
            For Each appointmentInRange As Appointment In RadScheduler1.Appointments.GetAppointmentsInRange(appointment.Start, appointment.[End]) 
                If appointmentInRange Is appointment Then 
                    Continue For 
                End If 
     
                For Each occupiedFacilitator As Resource In appointmentInRange.Resources.GetResourcesByType("Facilitator"
                    availableFacilitator.Remove(occupiedFacilitator) 
                Next 
            Next 
     
            Return availableFacilitator 
        End Function 
    End Class 
     
     

    If anybody can steer me in the right direction, would fantastic.

    Cheers,
    Steve
    El-Perko
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    4 answers
    219 views
    I have been having a problem on my page where clicking on the button doesn't appear to cause a post-back (although stepping through the code shows that it is going through the lines of code in the code behind page.

    I created a new simple project and have been able to reproduce the issue:

    Default.aspx:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
     
    <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="rad" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title></title>  
    </head> 
    <body> 
        <form id="form1" runat="server">  
            <div> 
                <asp:Panel class="clientheading" ID="Panel1" runat="server" BorderWidth="0px" Visible="False">  
                    <asp:Label ID="header1" runat="server" >Test</asp:Label>&nbsp;  
                </asp:Panel> 
                  
                  
                <rad:RadScriptManager runat="server" ID="RadScriptManager1" /> 
                  
                <rad:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                    <AjaxSettings> 
                        <rad:AjaxSetting AjaxControlID="checkbox1">  
                            <UpdatedControls> 
                                <rad:AjaxUpdatedControl ControlID="label1" /> 
                                <rad:AjaxUpdatedControl ControlID="button1" /> 
                                <rad:AjaxUpdatedControl ControlID="lblMessage" /> 
                            </UpdatedControls> 
                        </rad:AjaxSetting> 
                    </AjaxSettings> 
                </rad:RadAjaxManager> 
                  
              
            </div> 
            <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label> 
            <table id="Table1" runat="server">  
                <tr> 
                    <td><asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" /></td>  
                </tr> 
                <tr> 
                    <td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>  
                </tr> 
            </table> 
            <table id="Table2" runat="server">  
                <tr> 
                    <td><asp:Button ID="Button1" runat="server" Text="Not checked" /></td>  
                </tr> 
            </table> 
          
        </form> 
    </body> 
    </html> 
     

    Code behind file:
    Partial Class _Default  
        Inherits System.Web.UI.Page  
     
        Protected Sub Button1_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles Button1.Click  
     
            If Not Me.CheckBox1.Checked Then 
                Me.lblMessage.Text = "Not checked" 
                Me.lblMessage.Visible = True 
            Else 
                Response.Redirect("page2.aspx")  
            End If 
     
        End Sub 
     
        Protected Sub CheckBox1_CheckedChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged  
            Me.lblMessage.Text = "" 
            Me.Label1.Text = "Checked = " & Me.CheckBox1.Checked.ToString  
            If Me.CheckBox1.Checked Then 
                Me.Button1.Text = "Checked" 
            Else 
                Me.Button1.Text = "Not Checked" 
            End If 
        End Sub 
    End Class 

    What I expect to happen is that when the user clicks on the button with the checkbox un-checked, the lblMessage would show the text "Not checked".  As noted above, stepping through the code shows that the line is executed, but it doesn't show on the page.

    If I comment out or remove the following line on the aspx page and then run the project again, clicking on the button with the checkbox un-checked produces the desired result.

    <

     

    rad:AjaxUpdatedControl ControlID="button1" />

     


    Any ideas as to what could be causing the problem?

    I note that the Telerik Ajax Manager version is v2009.2.826.20 (as shown on the aspx page).


    Rem
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    1 answer
    113 views
    I have created a rule with the rewrite the will allow the user to navigate to the default page for a specific criteria like so.  Website.com/Products  will be rewritten to website.com/Deafult.aspx?type=Products.This works fine the issue is on this page I have a telerik radgrid that allows for grouping.  I have a RadAjaxmanager for the grid.  The problem is when even I try to collapse it will collapse but I get an error on page and I cannot expand or collapse any other groups in the grid. 

    Webpage error details 
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; MDDS; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.5.30729; MSSDMC1.3.1020.3; MSSDMC2.5.2219.1)
    Message: Sys.ScriptLoadFailedException: The script 'http://gofilepointtest.fairviewinvest.com/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_ContentPlaceHolder1_RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b' could not be loaded.

    This only seems to happen in ie due to the fact that in firefox when I hit the collapse button the url changes to show the page and the query string.

    IE show the telrik grid with the skins, but in firefox it does not show the telerik skins

    Eric Klein
    Top achievements
    Rank 1
     answered on 18 Feb 2010
    Narrow your results
    Selected tags
    Tags
    +? more
    Top users last month
    Simon
    Top achievements
    Rank 2
    Iron
    Iron
    Bob
    Top achievements
    Rank 3
    Iron
    Iron
    Veteran
    Marco
    Top achievements
    Rank 4
    Iron
    Iron
    Iron
    Grant
    Top achievements
    Rank 3
    Iron
    Iron
    Iron
    Kao Hung
    Top achievements
    Rank 1
    Iron
    Want to show your ninja superpower to fellow developers?
    Top users last month
    Simon
    Top achievements
    Rank 2
    Iron
    Iron
    Bob
    Top achievements
    Rank 3
    Iron
    Iron
    Veteran
    Marco
    Top achievements
    Rank 4
    Iron
    Iron
    Iron
    Grant
    Top achievements
    Rank 3
    Iron
    Iron
    Iron
    Kao Hung
    Top achievements
    Rank 1
    Iron
    Want to show your ninja superpower to fellow developers?
    Want to show your ninja superpower to fellow developers?