Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
151 views
Hi,

I have configured a scheduler in timeline view to start at 7am and have 39 20min slots, however when the page first loads the timeline view starts strange times (usually based loosely around the number of minutes ) and only corrects after reloading of the page.
I have attached the before and after screen shots.

Here is the aspx scheduler configuration.

<telerik:RadScheduler ID="rsAppointments" runat="server"
                DataEndField="AppointmentEndDate"
                DataKeyField="ID"
                DataStartField="AppointmentStartDate"
                DataSubjectField="AppointmentTypeID"
                DataDescriptionField="AppointmentTypeID"
                Height="600px"
                onnavigationcomplete="rsAppointments_NavigationComplete"
                OnClientAppointmentInserting="OnInsertAppointment"
                OnClientAppointmentEditing="OnEditAppointment"
                OnClientAppointmentContextMenuItemClicked="OnAppointmentMenuClicked"
                OnClientAppointmentContextMenu="OnAppointmentMenu"
                OnClientTimeSlotContextMenuItemClicked="OnTimeslotMenuClicked"
                GroupingDirection="Vertical" SelectedView="TimelineView"
                DayEndTime="20:00:00"
                DayStartTime="07:00:00"
                WorkDayEndTime="20:00:00"
                WorkDayStartTime="07:00:00"
                onappointmentcreated="rsAppointments_AppointmentCreated"
                onappointmentupdate="rsAppointments_AppointmentUpdate"
                onappointmentdelete="rsAppointments_AppointmentDelete">
                <WeekView UserSelectable="False" />
                <DayView UserSelectable="False" />
                <MonthView UserSelectable="False" />
                <TimelineView GroupBy="Resources" GroupingDirection="Vertical" UserSelectable="false"
                    NumberOfSlots="39" StartTime="07:00:00" ShowResourceHeaders="true" EnableExactTimeRendering="true"
                    ColumnHeaderDateFormat="HH:mm" SlotDuration="00:20:00" ShowInsertArea="false" />
                <ResourceTypes>
                    <telerik:ResourceType Name="Resources" KeyField="AppointmentResourceID" TextField="AppointmentResource" ForeignKeyField="AppointmentResourceID" />
                </ResourceTypes>
                <AppointmentTemplate>
                    <table border="0" cellpadding="3" cellspacing="0" width="100%">
                        <tr>
                            <td style="border: none;"><asp:Literal ID="litContent" runat="server"></asp:Literal></td>
                        </tr>
                    </table>
                </AppointmentTemplate>
                <AppointmentContextMenus>
                    <telerik:RadSchedulerContextMenu runat="server" ID="cmAppointment">
                        <Items>
                            <telerik:RadMenuItem Text="Open" Value="CommandEdit" />
                            <telerik:RadMenuItem IsSeparator="True" />
                            <telerik:RadMenuItem Text="Delete" Value="CommandDelete" />
                            <telerik:RadMenuItem IsSeparator="True" />
                            <telerik:RadMenuItem Text="Attended" Value="Attended" />
                            <telerik:RadMenuItem Text="Cancel" Value="Cancel" />
                            <telerik:RadMenuItem IsSeparator="True" />
                            <telerik:RadMenuItem Text="Go to Record Summary" Value="PatientRecord"></telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Go to Demographics" Value="Patient"></telerik:RadMenuItem>
                        </Items>
                    </telerik:RadSchedulerContextMenu>
                </AppointmentContextMenus>
                <TimelineView HeaderDateFormat="dddd, dd MMMM yyyy" />             
                <TimeSlotContextMenus>
                    <telerik:RadSchedulerContextMenu runat="server" ID="cmTimeSlot">
                        <Items>
                            <telerik:RadMenuItem Text="New Appointment" Value="CommandAddAppointment"></telerik:RadMenuItem>
                            <telerik:RadMenuItem IsSeparator="true" />
                            <telerik:RadMenuItem Text="Go to today" Value="CommandGoToToday" />
                        </Items>
                    </telerik:RadSchedulerContextMenu>
                </TimeSlotContextMenus>
                <TimeSlotContextMenuSettings />
            </telerik:RadScheduler>

We are using 2013 Q1 of the Telerik controls.

Thanks
Gavin.
Gavin
Top achievements
Rank 1
 answered on 07 Feb 2014
7 answers
440 views
Can someone provide code for using the AsyncUpload control in an ASP web page built entirely at runtime?  NO aspx/ashx.  All CS, except the master page, which is about 5 levels up from my user control.  I can't get past a bunch of Javascript errors - likely related to the httpHandlers section, but I can't find a definitive configuration doc for that, either.

The need is simple: drop a user control down that will allow uploads (and thus backend processing of uploaded files) without performing a full postback on the page.  

Thanks,
JD
JD
Top achievements
Rank 1
 answered on 06 Feb 2014
2 answers
89 views
I'm trying to assign a date to a raddatepicker from javascript, but he throws the following error:

    0x800a01b6 - Runtime Error in JavaScript: Object does not support property or 'getFullYear' method.

The code I'm using is:

$find('<%=rdpFchNacimiento.ClientID%>').set_selectedDate(MasterTable.getCellByColumnUniqueName(row, "FchNacimiento").textContent);

Thanks for any help you can give me.

Juan Carlos
Juan Carlos
Top achievements
Rank 1
 answered on 06 Feb 2014
2 answers
346 views
This is the Grid where i need to add the button (with arrow mark in the place of the Text) in the Master Table View before the GridBound column (ListName) . Please help me to add this .
<st:STGrid ID="stGrdNotesMaster" runat="server" TabIndex="212" AutoGenerateColumns="false" AllowSorting="false" AllowPaging="false" ClientSettings-AllowColumnsReorder="false" ClientSettings-AllowDragToGroup="false" ShowGroupPanel="false" >
                                            <MasterTableView DataKeyNames="ID" HierarchyDefaultExpanded="false" NoMasterRecordsText="" NoDetailRecordsText="" GroupLoadMode="Client" HierarchyLoadMode ="Client" >
                                                <Columns>
                                                    <telerik:GridBoundColumn HeaderText="ListName" DataField="Name" UniqueName="ListName" />
                                                    <telerik:GridTemplateColumn UniqueName="Reorder">
                                                        <ItemTemplate><st:STButton ID="btnReorder" runat="server" CommandName="reorder" Text="Reorder based on sort" /></ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                </Columns>
                                                <DetailTables>
                                                    <telerik:GridTableView Name="Detail" AllowSorting="true" AllowPaging="false" DataKeyNames="ID" NoMasterRecordsText="" NoDetailRecordsText="" EditMode="InPlace">
                                                        <Columns>
                                                            <telerik:GridHyperLinkColumn UniqueName="Subject" HeaderText="Subject" DataNavigateUrlFormatString="~/notedisplay.aspx?id={0}" DataNavigateUrlFields="ID" DataTextField="Subject" SortExpression="Subject" ItemStyle-CssClass="gridhyperlink" HeaderStyle-Width="500px" />
                                                            <telerik:GridHyperLinkColumn UniqueName="Attachment" HeaderText="Attachment" DataNavigateUrlFormatString="javascript:void(window.open('imageviewer.aspx?a=3&b=Attachment&c={0}', '_blank', 'left=0, top=0, width=785, height=585, titlebar=yes, location=no, status=no, toolbar=no, menubar=no, scrollbars=no, resizable=yes'));" DataNavigateUrlFields="ID" DataTextField="AttachmentName" SortExpression="AttachmentName" ItemStyle-CssClass="gridhyperlink" />
                                                            <telerik:GridBoundColumn UniqueName="AddDate" HeaderText="Created" DataField="AddDate" SortExpression="AddDate" ReadOnly="true" />
                                                            <telerik:GridNumericColumn  HeaderText="Position" DataField="SortOrder" SortExpression="SortOrder" UniqueName="SortOrder" />
                                                            <telerik:GridEditCommandColumn UniqueName="EditColumn">
                                                                <ItemStyle CssClass="gridhyperlink" />
                                                            </telerik:GridEditCommandColumn>
                                                        </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                            </MasterTableView>
                                            <ClientSettings AllowExpandCollapse="true">
                                            </ClientSettings>
                                        </st:STGrid>


Thanks
Joselina
Joselina
Top achievements
Rank 1
 answered on 06 Feb 2014
6 answers
185 views
Hi I fairly new to using Telerik and I want to find a way of limiting the number of radDocks in a RadDockZone is there a general way of doing this and if so how.

regards,

Ash
Justin
Top achievements
Rank 1
 answered on 06 Feb 2014
3 answers
150 views
I have a client who wants just about every grid enabled for Excel and PDF export. The mechanisms that come with the grid are basic. Unfortunately there are many considerations for doing exports from the grid. And then the final document is subject to be treated differently depending on the browser: Does the document get saved or is it opened by an application? Does the PDF launch in the same page, a new page, or in a reader app?

Rather than using the built-in exports, I usually add my own Export buttons and call my own routines for custom reports with fine-tuned formatting. I can completely control all of the above details and all formatting requirements with custom code, but this must be done for each grid and its diverse and unique requirements. But I'd like to know if folks here are getting more "mileage" from the built-in controls.

The most common requirement is that the Excel and PDF should be as WYSIWYG as possible. The user sorts and groups the grid, then clicks Export, and they expect the document to look just like the grid. What we get are documents with columns mis-aligned, funky formatting, awkward grouping indentation, and other artifacts that make the results unusable. I understand the complexities involved in making this stuff work but it looks like this functionality is incomplete in the product, never quite up to speed with the rest of the grid functionality.

So do we just lump it and roll our own? Or is there some other common technique that people use to approach grid exports?

Thanks!
Angel Petrov
Telerik team
 answered on 06 Feb 2014
3 answers
286 views
I have a menu with menuitems.   Each menuitem click even points to a server side method that determines which menuitem was clicked and does the appropriate code block.  I want to put a confirm dialog on the menus so that they have to confirm after they click any of the menuitems.  I can do this easily with any control by adding this to the onclick event :   onclick = "return myFunction()".

I cannot get this to work for the life of me with the new rad menu.  Here's what I have so far:
this is the javascript to bring up the dialog based on the item clicked:
        function onClick(sender, eventArgs) { 
            var item = eventArgs.get_item(); 
            if (item.get_value() != "Action") { 
                switch (item.get_value()) 
                { 
                    case "Export"
                        if (confirm("Are you sure you want to export the selected Employee's to Excel?") == true) { 
                            return true
                        } 
                        else { 
                            return false
                        } 
                         
                        break
                    case "Terminate"
                        return confirm("Are you sure you want to Terminate the selected Employee's?"); 
                        break
                     
                } 
            } 
        } 
   
I think everything is ok with the javascript.
Here's the menu control:
<telerik:RadMenu ID="RadMenu1" Width="100%" runat="server"  
                         Skin="Web20"  
                         OnClientItemClicked="onClick" 
                         onitemclick="RadMenu1_ItemClick"
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
            <Items> 
                <telerik:RadMenuItem runat="server" PostBack="False" Text="Action"  
                    Value="Action" ImageUrl="~/images/cog.png"
                    <Items> 
                        <telerik:RadMenuItem runat="server" Text="Export Selected" Value="Export"
                        </telerik:RadMenuItem> 
                        <telerik:RadMenuItem runat="server" Text="Term Selected" Value="Terminate"
                        </telerik:RadMenuItem> 
                        <telerik:RadMenuItem runat="server" Text="Import from Excel" Value="Import"
                        </telerik:RadMenuItem> 
                    </Items> 
                </telerik:RadMenuItem> 
            </Items> 
        </telerik:RadMenu> 

Now with this, it does popup the confirm, but regardless if you hit OK or CANCEL it still runs the server method.  I tried changing OnClientItemClicked = "return onClick():" but when i render the page it says Syntax Error.

Can someone please help me solve this?  I'm assuming I'm missing something very simple


Geoffrey
Top achievements
Rank 1
 answered on 06 Feb 2014
1 answer
172 views
Hi,

I would like to change Scheduler's  TimelineView range to certain Date and Time on button click event. I was able to change the start time but cannot change both at a time.How can I set Scheduler's  Timeline  date range and start time using c#?

                            DateTime start   = ......SomeDate                        
                            DateTime  selectedDate = new DateTime(start.Year, start.Month, start.Day);
                       
                            
                            rsTicketsSchedule.SelectedDate = selectedDate;
                            rsTicketsSchedule.SelectedView = SchedulerViewType.TimelineView;
                             
                             TimeSpan tt = new TimeSpan(0, 600, 0);
                            rsTicketsSchedule.TimelineView.StartTime = rsTicketsSchedule.TimelineView.StartTime.Subtract(tt);
                            
                        


Thanks,
Prava
Boyan Dimitrov
Telerik team
 answered on 06 Feb 2014
0 answers
71 views
 
Hello,

I'm trying to custom selected appointment and the resource matched with.

the javascript bellow works when onclientappointmentclick is called ;
i can custom the selected appointment but the resource doesn't change !!!

                function appointmentclicked(sender, eventArgs) {
 
                  var  selectedAppointment = eventArgs.get_appointment();
                    selectedAppointment.set_cssClass("TimeSlotCssForUser");
                    var resourcesList= selectedAppointment.get_resources();
                    var myresource= resourcesList.getResource(0);
                    myresource.set_cssClass("TimeSlotCssForUser");
                }

thank you for the help ;)

Ala eddine
Top achievements
Rank 1
 asked on 06 Feb 2014
2 answers
64 views
Hi,

I have a radGrid with a GridTemplateColumn which has a unique name. For that column, I defined a FilterTemplate that contains several input fields (combobox, textbox, raddatepicker and so on).

When one of these filters fires a filterCommad, I know its column name and the filter option from the Pair of the commandArgument. However, I need to specifically know which one of these controls did fire the filtercommand.

Any help would be appreciated.

Patrice
Top achievements
Rank 1
 answered on 06 Feb 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?