Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
125 views

Dear,

always i m getting error when i work on Client side Datetimepicker.

very simple criteria. datetpicker1 date become the selected and minimumdate of datepicker2.

WIn7 VS2010 IE8 and telerik 2009 Version Q2 2009 released 08/26/2009
ERROR:

Message: Object doesn't support this property or method
Line: 72
Char: 13
Code: 0
URI: http://localhost:49204/WebSite1/ 

var DateFrom;
var DateTo;
var RDP1;
var RDP2;
 

function pageLoad() {

        

            myLabel = document.getElementById("lblNts");

            RDP1 = document.getElementById("RadDatePicker1");
            RDP2 = document.getElementById("RadDatePicker2");

        }
 

function DateSelected(sender, e) {
 
           var minDate = new Date();
            var nMonth;
           
            DateFrom = e.get_newDate().toDateString();
           
            var myFDate = DateFrom.split(" ");
           
           
            if (myFDate[1] == 'Jan') {
                nMonth = '01';
            } else if (myFDate[1] == 'Feb') {
                nMonth = '02';
            } else if (myFDate[1] == 'Mar') {
                nMonth = '03';
            } else if (myFDate[1] == 'Apr') {
                nMonth = '04';
            } else if (myFDate[1] == 'May') {
                nMonth = '05';
            } else if (myFDate[1] == 'Jun') {
                nMonth = '06';
            } else if (myFDate[1] == 'Jul') {
                nMonth = '07';
            } else if (myFDate[1] == 'Aug') {
                nMonth = '08';
            } else if (myFDate[1] == 'Sep') {
                nMonth = '09';
            } else if (myFDate[1] == 'Oct') {
                nMonth = '10';
            } else if (myFDate[1] == 'Nov') {
                nMonth = '11';
            } else if (myFDate[1] == 'Dec') {
                nMonth = '12';
            } else {
                nMonth = 'NA';
            }

            minDate.setFullYear(myFDate[3], nMonth - 1, myFDate[2]);

            RDP2.set_selectedDate(minDate);

}

 
<telerik:RadDatePicker ID="RadDatePicker1" Runat="server" MinDate="<%#DateTime.Now %>">
<ClientEvents OnDateSelected="DateSelected" />
<DateInput DateFormat="dd-MM-yyyy"></DateInput>
</telerik:RadDatePicker>

 

waseem
Top achievements
Rank 2
 answered on 09 Feb 2010
0 answers
202 views
Hi all,
 I read the tutorials hoe to use inline templates to create appointment, but I have some bit confusion using it.Because my application using a resource grouping and I only need Inline insert and edit templates no advanced form needed.As my code looks like

<telerik:RadScheduler ID="scheduler" runat="server" Width="100%" Height="80%" Skin="Office2007" 
                  DataKeyField="Name" DataStartField="Start" DataEndField="End" DataSubjectField="Subject" 
                  ShowFooter="false" MinutesPerRow="15" TimeLabelRowSpan="4" RowHeaderWidth="40px" 
                  ShowFullTime="true" OverflowBehavior="Scroll" ShowAllDayRow="false" Font-Names="Segoe UI" 
                  Font-Size="12px" GroupBy="Provider" GroupingDirection="Horizontal" HoursPanelTimeFormat="h ttt" 
                  MinimumInlineFormHeight="180" MinimumInlineFormWidth="250" OnAppointmentCreated="OnAppointmentCreated" 
                  OnAppointmentCommand="OnAppointmentCommand" OnFormCreated="OnFormCreated" OnFormCreating="OnFormCreating"
                  <InlineInsertTemplate> 
                    <fieldset> 
                      <table> 
                        <tr> 
                          <td><label>Subject</label> </td> 
                          <td> 
                            <asp:TextBox ID="txtSubject" runat="server" Width="160px" Height="50px" /> 
                          </td> 
                        </tr> 
                        <tr> 
                          <td><label>Type</label> </td> 
                          <td> 
                            <asp:DropDownList ID="ddlType" runat="server" Width="160px" /> 
                          </td> 
                        </tr> 
                        <tr> 
                          <td><label>Start</label> </td> 
                          <td> 
                            <telerik:RadDateTimePicker ID="tpStartTime" runat="server" Width="160px" Skin="Office2007" /> 
                          </td> 
                        </tr> 
                        <tr> 
                          <td><label>End</label> </td> 
                          <td> 
                            <telerik:RadDateTimePicker ID="tpEndTime" runat="server" Width="160px" Skin="Office2007" /> 
                          </td> 
                        </tr> 
                        <tr> 
                          <td></td
                          <td align="right"
                            <table> 
                              <tr> 
                                <td> 
                                  <asp:Button ID="btnSave" Text="Save" runat="server" CommandName="Insert" /> 
                                </td> 
                                <td> 
                                  <asp:Button ID="btnCancel" Text="Cancel" runat="server" CommandName="Cancel" CausesValidation="false" /> 
                                </td> 
                              </tr> 
                            </table> 
                          </td> 
                        </tr> 
                      </table> 
                    </fieldset> 
                  </InlineInsertTemplate> 
                  <InlineEditTemplate> 
                    <fieldset> 
                      <table> 
                        <tr> 
                          <td><label>Subject</label> </td> 
                          <td> 
                            <asp:TextBox ID="txtSubject" runat="server" Width="160px" Height="50px" Text='<%# Bind("Subject") %>' /> 
                          </td> 
                        </tr> 
                        <tr> 
                          <td><label>Type</label> </td> 
                          <td> 
                            <asp:DropDownList ID="ddlType" runat="server" Width="160px" /> 
                          </td> 
                        </tr> 
                        <tr> 
                          <td><label>Date</label> </td> 
                          <td> 
                            <telerik:RadDateTimePicker ID="dpStartDate" runat="server" Width="160px" Skin="Office2007" /> 
                          </td> 
                        </tr> 
                        <tr> 
                          <td><label>End Date</label> </td> 
                          <td> 
                            <telerik:RadDateTimePicker ID="dpEndDate" runat="server" Width="160px" Skin="Office2007" /> 
                          </td> 
                        </tr> 
                        <tr> 
                          <td></td
                          <td align="right"
                            <table> 
                              <tr> 
                                <td> 
                                  <asp:Button ID="btnUpdate" Text="Save" runat="server" CommandName="Update" /> 
                                </td> 
                                <td> 
                                  <asp:Button ID="btnCancel" Text="Cancel" runat="server" CommandName="Cancel" CausesValidation="false" /> 
                                </td> 
                              </tr> 
                            </table> 
                          </td> 
                        </tr> 
                      </table> 
                    </fieldset> 
                  </InlineEditTemplate> 
                  <AppointmentTemplate> 
                    <br /> 
                    <%# Eval( "Subject" )%> 
                    <br /> 
                    <asp:Label runat="server" ID="lblType" /> 
                  </AppointmentTemplate> 
                  <TimelineView UserSelectable="false" /> 
                  <TimeSlotContextMenuSettings EnableDefault="true" Skin="Office2007" /> 
                  <AppointmentContextMenuSettings EnableDefault="true" Skin="Office2007" /> 
                </telerik:RadScheduler> 
The CS code contains
protected void Page_Load( object sender, EventArgs e ) 
  if( !IsPostBack ) 
  { 
    ResourceType resType = new ResourceType( "Provider" ); 
    resType.ForeignKeyField = "ProviderID"
    resType.TextField = "FullName"
    resType.KeyField = "ProviderId"
    resType.DataSource = providerList; // A list of providers with name and Id
    scheduler.ResourceTypes.Add( resType ); 
  } 
protected void OnAppointmentCreated( object sender, AppointmentCreatedEventArgs e ) 
protected void OnAppointmentCommand( object sender, AppointmentCommandEventArgs e ) 
appointmentData = new DTO.AppointmentData(); // User defined Class to store appointment 
appointmentData.HospitalId = 1; 
appointmentData.CreatedBy = 9; 
appointmentData.Date = scheduler.SelectedDate; 
appointmentData.ProviderID = Convert.ToUInt32( e.Container.Appointment.Resources.GetResourceByType( "Provider" ).Key.ToString() ); 
TextBox reason = (TextBox) e.Container.FindControl( "txtSubject" ); 
appointmentData.VisitReason = reason.Text.Trim(); 
RadDateTimePicker startTime = (RadDateTimePicker) e.Container.FindControl( "tpStartTime" ); 
appointmentData.StartTime = Convert.ToDateTime( startTime.SelectedDate ); 
RadDateTimePicker endTime = (RadDateTimePicker) e.Container.FindControl( "tpEndTime" ); 
appointmentData.EndTime = Convert.ToDateTime( endTime.SelectedDate ); 
DropDownList type = (DropDownList) e.Container.FindControl( "ddlType" ); 
appointmentData.AppointmentType = type.SelectedValue; 
BookAppointment( appointmentData ); 
 
protected void OnFormCreated( object sender, SchedulerFormCreatedEventArgs e ) 
if( e.Container.Mode == SchedulerFormMode.Insert ) 
RadDateTimePicker startInput = (RadDateTimePicker) e.Container.FindControl( "tpStartTime" ); 
startInput.SelectedDate = DateTime.Now; 
RadDateTimePicker endInput = (RadDateTimePicker) e.Container.FindControl( "tpEndTime" ); 
endInput.SelectedDate = DateTime.Now.AddMinutes( 30 ); 
DropDownList type = (DropDownList) e.Container.FindControl( "ddlType" ); 
type.DataTextField = "Name"
type.DataValueField = "ConsultationDuration"
type.DataSource = GetAllAppointmentTypes(); // Returns a list of appointments 
type.DataBind(); 
 
protected void OnFormCreating( object sender, SchedulerFormCreatingEventArgs e ) 

But when I insert a appointment the form created event fires twice and I don't get the start time and end time as I given, Also the Edit is not working. Another problem is when I insert a appointment for Resource3 it will come under both Resource1 and Resource3 in GUI

My requirement is to call a function to insert the appointment values to a DB table on click save or update.
I am stuck for three days for this. Can you please give me a guide to do this stuff?


Prajeesh Prabhakar
Top achievements
Rank 1
 asked on 09 Feb 2010
2 answers
397 views
in aspx file:
...
<telerik:RadGrid
        ID="grdList" runat="server"
        EnableViewState="false"
        Height="328px"
        AllowPaging="true"
        AllowSorting="true"
        AllowFilteringByColumn="true"
        AutoGenerateColumns="False"
        PageSize="12"
        Skin="WebBlue">
    <MasterTableView ClientDataKeyNames="Col1" EnableViewState="False">
        <Columns>
            <telerik:GridBoundColumn DataField="Col1"
                HeaderText="COL1" Visible="false">
                <HeaderStyle Width="80px" HorizontalAlign="left" />
                <ItemStyle Width="80px" HorizontalAlign="left" />
            </telerik:GridBoundColumn>                        
...

in aspx.cs file => Page_Load:
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        ...
        GridBoundColumn col;
        col = (GridBoundColumn)grdList.MasterTableView.Columns[i];
        col.HeaderText = colHdrs[i];
        // colDataTypes[i].Equals array containing "date" or "string" or ...
        if (colDataTypes[i].Equals("date"))
        {
            col.DataType = Type.GetType("System.DateTime");
            col.DataFormatString = "{0:MM/dd/yyyy}";
        }
        col.Visible = true;
        ...
    }
}

I tried different values for DataFormatString and it always displays long date time format
when i set to bogus value: [0:MM/dd/yyyy] => all rows displayed the string [0:MM/dd/yyyy]

So i know the DataFormatString is being set for date column.
Murray
Top achievements
Rank 1
 answered on 08 Feb 2010
8 answers
230 views
When i export to "Word/CSV/Excel" the images on the grid are getting disabled. I have a RadGrid with FilteringByColumn enabled. This makes the grid to display a Filtering Menu which has a text box and an image button which can be clicked to filter. I also have buttons which allows the user to click and download to different formats. Once i download, the filtering image button gets disabled and does not show the filtering menu. Please can anybody show me how to enable the Filtering Menu.
Daniel
Telerik team
 answered on 08 Feb 2010
2 answers
242 views
My site is both used internally by our company (intranet) and externally by our clients (internet).  I would like to use the Telerik CDN, but disable it for our intranet users.  Is there a way to programmatically enable/disable CDN on the RadScriptManager and RadStyleSheetManager?
mlandauer
Top achievements
Rank 1
 answered on 08 Feb 2010
3 answers
219 views
Hi,

I am using Radgrid for Asp.net Ajax 2008 Q3 version. I am trying to display data hierarchically by using nested view template relations as explained in http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplatedeclarativerelations/defaultcs.aspx.

However, after adding my radgrid I cannot see the <NestedViewSettings> tag, but can see <NestedViewtemplate>.

Is it because I am using an older version?

many thanks,

Anu
Daniel
Telerik team
 answered on 08 Feb 2010
3 answers
158 views
Hi,

Looking for RadInput like CheckBox and Button functionality, in particular client side  onvaluechanging support similar to RadTextBox

This is part of a solution based on DNN 5.2.x

Best regards
Espen Harlinn
Sebastian
Telerik team
 answered on 08 Feb 2010
5 answers
303 views
In my dnn web site,I have two modules.
moduleA : Client side will call ajaxmanager.ajaxRequest or ajaxmanager.ajaxRequestWithTarget function to refresh some information in server side.
moduleB : There is a RadAjaxPanel.
When moduleA raises an ajaxRequest, at the same time moduleB does some action to trigge RadAjaxPanel.
In this situation, both moduleA and moduleB stop working(server side function cannot complete).
moduleA's Server side event
        protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)  
        {  
            AddMsg(HiddenMsg.Value);  
        }  
          
        protected void RadRotator1_Load(object sender, EventArgs e)  
        {  
            AddMsg(HiddenMsg.Value);  
        } 
moduleA's javascript
        function SuccessHandler(message) {  
            try 
            {  
                var hidden = document.getElementById("<%=HiddenMsg.ClientID %>");  
                hidden.value= message;  
                ajaxManager.ajaxRequestWithTarget("<%=RadRotator1.UniqueID %>",'');  
                  
                //ajaxManager.ajaxRequest(message);  
                  
            }  
            catch (e)  
            {  
            }  
        } 
rubenhak
Top achievements
Rank 1
 answered on 08 Feb 2010
1 answer
93 views
Hi

In the ItemCreated event of a RadGrid I have the fiollowing:

Me

 

.rgJobPlans.MasterTableView.CommandItemSettings.AddNewRecordText = "Add New Template"

 


It works OK with the bar at the bottom, but now I would like to have the bar at the top, and the line doesn't work unless I hit the refresh icon.

Whats going on?

Andy
Daniel
Telerik team
 answered on 08 Feb 2010
2 answers
186 views

Hi,

I am able to use the Paste Context Menu only if the items are copied from the RadFile Explorer.

What do I need to do if I want to paste items into the RadFile Explorer window that are copied outside from the File Explorer(i.e., from my desktop or something...)?

 

 

Rumen
Telerik team
 answered on 08 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?