Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
92 views
When the user clicks the arrows on the top left to navigate to the next or previous period, I want to move the calendar a specified number of days.  The default behavior is for it to move the number of days that you show.  Here's what I came up with which isn't working.

What I'd really like to do is add 7 days to the currently visible start date.

function clientNavigationCommandHandler(sender, eventArgs) {
            if (eventArgs.get_command() == Telerik.Web.UI.SchedulerNavigationCommand.NavigateToNextPeriod) {
                    var d = new Date();
                       d.setDate(d.getDate() + 7);
 
                sender.set_selectedDate(d);
            }
        }
Boyan Dimitrov
Telerik team
 answered on 28 Mar 2013
2 answers
242 views
Hello,

I am able to dynamically create and resize the RadEditor within a RadGrid with the code listed below.  Although, if any of the previous RadEditors contain content they will not resize to the specified height of 25px, when dynamically adding a new instance of the RadEditor in the RadGrid.

UI:




Code:
 <script type="text/javascript">
         function OnClientLoad(editor) {
             editor.get_text();

             /* Increase height of Instruction Editor */
             editor.attachEventHandler("onfocus", function (e) {
                 editor.setSize("225", "200");
             });
             /* Reset to default height of Instruction Editor */
             editor.attachEventHandler("blur", function (e) {
                 editor.setSize("225", "25");
                 editor.set_html(editor);
             });
         }
    </script>
    <style type="text/css">
    .reContentArea
    {
        white-space: pre-line !important;
        word-wrap: break-word !important;
        max-width: 200px;
        text-align: left;
    }

 <telerik:GridTemplateColumn HeaderText="Instructions" UniqueName="Instructions" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="false">
                <ItemTemplate>
                    <telerik:RadEditor ID="txtInstruction" runat="server" MaxTextLength="1000" Style="overflow:auto; overflow-x: hidden; overflow-y: scroll;" AutoResizeHeight="true" EditModes="Design" ContentAreaMode="Div" ToolbarMode="Default" OnClientLoad="OnClientLoad" Width="220px" Height="25px" ToolsWidth="130px">
                    <Tools>
                        <telerik:EditorToolGroup>
                            <telerik:EditorTool  Name="ForeColor" />
                            <telerik:EditorTool Name="Bold" />
                            <telerik:EditorTool Name="Italic" />
                            <telerik:EditorTool Name="Underline" />
                        </telerik:EditorToolGroup>
                    </Tools>
                    </telerik:RadEditor>
                </ItemTemplate>
            </telerik:GridTemplateColumn>

How do I dynamically collaps2 all previous RadEditors, that contain content, to 25px when creating a new RadEditor row within the RadGrid?

Thank You in Advance!
Rengo
Top achievements
Rank 1
 answered on 28 Mar 2013
8 answers
180 views
Dear dude
I want to use RadScheuduler to design clinic scheduler with different doctors. I want to set doctors times in RadScheduler. Then Patient set specified work time in another form. doctor can work in different place. Please see the diagram. Now I have a problem in patient Appointment. I should set time slot disable/enable based on doctorAppointment And Then patient insert appointment for special doctor based on timeslot. I used entityframework but I got may error. How can I Access doctorAppointment in PatientAppointment?
I defiened resourceType for Room,Doctor,DoctorAppointment,AppointmentType but in insertForm I can not Access roomID and DoctorID which are in DoctorAppointmentTable.
RadScheduler:
<telerik:RadScheduler runat="server" ID="PatientsScheduler" GroupBy="Doctor"
                DataSourceID="PatientsAppointmentEntityDataSource" DataKeyField="Id" DataSubjectField="FirstName"
                DataStartField="Start" DataEndField="End"  ....>
InsertTemplate Which has error to find FirstName:
    <InlineInsertTemplate>                 
                            <asp:Label ID="Label4" AssociatedControlID="FirstNameTextBox" runat="server" CssClass="inline-label"/>
                            <asp:TextBox ID="FirstNameTextBox" Rows="2" Columns="20" runat="server" Text='<%# Bind("FirstName") %>'
                                Width="97%" TextMode="MultiLine"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="FirstNameRequiredFieldValidator" runat="server" ValidationGroup="Insert"
                                ControlToValidate="FirstNameTextBox" ErrorMessage="نام بیمار اجباری">*</asp:RequiredFieldValidator>
                            <br />                      
                            <asp:Label ID="Label5" AssociatedControlID="StartInput" runat="server" CssClass="inline-label"/>
                            <telerik:RadDateInput ID="StartInput" SelectedDate='<%# Bind("Start") %>' runat="server"
                                EnableSingleInputRendering="false">
                            </telerik:RadDateInput>                            
                            <br />                    
                            <asp:Label ID="Label3" AssociatedControlID="AppointmentTypeComboBox" runat="server" />
                            <telerik:RadComboBox runat="server" ID="AppointmentTypeComboBox" DataTextField="Name"
                                DataValueField="Id" Width="90%" Skin="Office2007" SelectedValue='<%# Bind("AppointmentTypeId") %>'
                                DataSourceID="AppointmentTypesEntityDataSource">
                            </telerik:RadComboBox>                                    
                </InlineInsertTemplate>
ResourceTypes are:
   <ResourceTypes>                 
                    <telerik:ResourceType KeyField="Id" Name="Doctor" TextField="Name" ForeignKeyField="DoctorId"
                        DataSourceID="DoctorsEntityDataSource"></telerik:ResourceType>
                    <telerik:ResourceType KeyField="Id" Name="Room" TextField="Name" ForeignKeyField="RoomId"
                        DataSourceID="RoomsEntityDataSource"></telerik:ResourceType>
                    <telerik:ResourceType KeyField="Id" Name="AppointmentType" TextField="Name" ForeignKeyField="AppointmentTypeId"
                        DataSourceID="AppointmentTypesEntityDataSource"></telerik:ResourceType>
                         <telerik:ResourceType KeyField="Id" Name="DoctorAppointment" TextField="Subject" ForeignKeyField="DoctorAppointmentId"
                        DataSourceID="DoctorAppointmentsEntityDataSource"></telerik:ResourceType>
                </ResourceTypes>
And EntityDataSources Are:
  <asp:EntityDataSource ID="DoctorAppointmentsEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
            DefaultContainerName="DatabaseEntities" EntitySetName="DoctorAppointments" EnableInsert="True">
        </asp:EntityDataSource>
        <asp:EntityDataSource ID="PatientsAppointmentEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
            DefaultContainerName="DatabaseEntities"
            EnableInsert="True" EntitySetName="PatientAppointments">
        </asp:EntityDataSource>
        <asp:EntityDataSource ID="RoomsEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
            DefaultContainerName="DatabaseEntities" EntitySetName="Rooms">
        </asp:EntityDataSource>
        <asp:EntityDataSource ID="DoctorsEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
            DefaultContainerName="DatabaseEntities" CommandText="SELECT it.[Id] , it.[FirstName] + ' ' + it.[LastName] as Name From DatabaseEntities.Doctors as it">
        </asp:EntityDataSource>
        <asp:EntityDataSource ID="AppointmentTypesEntityDataSource" runat="server" ConnectionString="name=DatabaseEntities"
            DefaultContainerName="DatabaseEntities" EntitySetName="AppointmentTypes">
        </asp:EntityDataSource> 


Please guide me on that. If you think it's better to change my method I would be glad for your kindness
Plamen
Telerik team
 answered on 28 Mar 2013
2 answers
326 views
Hi all i wanted to remove selected row in my grid using javascript. I know it by serverside but i want to do it using clientside.
can you give code for asp.net ajax and for radcontrols classic..

Thanks in advance,
RJ
RJ
Top achievements
Rank 1
 answered on 28 Mar 2013
6 answers
124 views
I've got a RadTimePicker in Grid EditForm, and I need to set the Min/Max and Interval/StartTime/EndTime

I've tried setting them in the ItemDatabound of the grid when in edit mode, and on PreRender of the control itself, if I step through debugger, I can see the value get's changed.  But when the editform is rendered, I get the default 1 hour interval.

I'm at a loss as what else to try.

Thanks in advance.

Roger

<telerik:RadTimePicker ID="txtcmps_StartTime" runat="server" Width="175px" TimeView-Columns="4" OnPreRender="txtcmps_StartTime_PreRender" TimeView-Height="300" TimeView-Width="325" DbSelectedDate='<%# Bind("cmps_StartTime") %>'  TimeView-CssClass="TimePicker" FocusedDate="1/1/1900 12:00:00 AM" MinDate="1/1/1900 12:00:00 AM" DateInput-MinDate="1/1/1900 12:00:00 AM" >       </telerik:RadTimePicker>
 
Code
 Public Sub txtcmps_StartTime_PreRender(sender As Object, e As System.EventArgs)
        'We'll set our start and end times and interval for txtcmps_StartTime
        If Not IsNothing(ViewState("cmp_StartTime")) Then
            Dim txtcmps_StartTime As Telerik.Web.UI.RadTimePicker = CType(sender, Telerik.Web.UI.RadTimePicker)
            txtcmps_StartTime.MinDate = CType(ViewState("cmp_StartTime"), DateTime)
            txtcmps_StartTime.MaxDate = CType(ViewState("cmp_EndTime"), DateTime)
 
            txtcmps_StartTime.TimeView.Interval = New TimeSpan(0, CType(ViewState("cmp_EnrollmentInterval"), Integer), 0)
            txtcmps_StartTime.TimeView.StartTime = New TimeSpan(CType(ViewState("cmp_StartTime"), DateTime).Hour, CType(ViewState("cmp_StartTime"), DateTime).Minute, CType(ViewState("cmp_StartTime"), DateTime).Second)
            txtcmps_StartTime.TimeView.EndTime = New TimeSpan(CType(ViewState("cmp_EndTime"), DateTime).Hour, CType(ViewState("cmp_EndTime"), DateTime).Minute, CType(ViewState("cmp_EndTime"), DateTime).Second)
 
        End If
    End Sub
RBarnes
Top achievements
Rank 1
 answered on 28 Mar 2013
1 answer
183 views
I have a simple template column with a hyperlink in it:

<telerik:GridTemplateColumn FilterControlAltText="Filter AMRLink column" HeaderText="AMR Link" UniqueName="AMRLink" FilterControlWidth="92%">
    <HeaderStyle Width="420px" />
        <ItemTemplate>
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("AMRLink", "\\localserver.com\Department_Shares\Manufacturing\Engineering\GSIS AMR-MR\{0}") %>'
                                    Text='<%# Eval("AMRLink", "{0}") %>' Target="_blank"></asp:HyperLink>
        </ItemTemplate>
        <EditItemTemplate>
            <asp:TextBox ID="txtAMRLink" runat="server" Text='<%# Bind("AMRLink") %>' Width="98%" />
        </EditItemTemplate>
</telerik:GridTemplateColumn>

It works great - it links to the correct file, and I can edit/insert just fine.

The thing is, when the user inserts/edits, they have to type in a couple more folders depths plus the file name
(e.g., "Shift1\Testers\TestReport_03_25_2013.pdf").  The directory where the file may be located is not consistent, hence their need to type in the directory names.

So, is it possible to have them click on a button, navigate around to the correct file, select it, and have that file path saved as the new hyperlink?

Thanks ahead of time...
Marin
Telerik team
 answered on 28 Mar 2013
4 answers
236 views
 we have wrote the localized codes for strings "today", "day", "week" and "month" shown in radscheduler control,and the strings will be read from database to get the localized strings. for example:                   _view.ResourceScheduler.Localization.AdvancedCalendarCancel = I18N.Tag("Cancel");
            _view.ResourceScheduler.Localization.AdvancedCalendarOK = I18N.Tag("OK");
            _view.ResourceScheduler.Localization.AdvancedCalendarToday = I18N.Tag("Today");
            _view.ResourceScheduler.Localization.HeaderToday = I18N.Tag("today");
            _view.ResourceScheduler.Localization.HeaderDay = I18N.Tag("Day");
            _view.ResourceScheduler.Localization.HeaderMonth = I18N.Tag("Month");
            _view.ResourceScheduler.Localization.HeaderWeek = I18N.Tag("Week");
            _view.ResourceScheduler.Localization.ShowMore = I18N.Tag("more...");
when we first load the pages which contain radscheduler control and don't do any operations for this control, it will be shown the correct localized strings, but when we click the navigation tab Day/Week/Month or select an event scheduler the localzied strings will be returned to English ones. Please see the attachment, how to fix this issue? 
Plamen
Telerik team
 answered on 28 Mar 2013
5 answers
244 views
Hi,

I have a RadGrid in my Page and with in ItemTemplate i have RadTimePicker Control.

I need to display 24 hrs in 15 min interval hence i need vertical scroll bar.

Request you to please suggest  any event with in with i can wire up my style for height and ovrflow or any other alternatiove way of having vertical scroll bar.

Thanks and regards,
Manish Patel
Vasil
Telerik team
 answered on 28 Mar 2013
15 answers
297 views
I've just upgraded to 2011.3.1115.35 and my RadGrid now crashes.

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index 
   
   System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index) +7602287
   Telerik.Web.UI.GridGroupByExpressionCollection.get_Item(Int32 index) +48

I've tracked this to having multiple <GroupByFields> defined in the aspx. Delete either of the <GroupByFields> children and it works fine.  I did not have this problem in Q1 2011

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false">
    <MasterTableView>
        <GroupByExpressions>
            <telerik:GridGroupByExpression>
                <SelectFields>
                    <telerik:GridGroupByField FieldName="Group1" ></telerik:GridGroupByField>
                    <telerik:GridGroupByField FieldName="Group2" ></telerik:GridGroupByField>
                </SelectFields>
                <GroupByFields>
                    <telerik:GridGroupByField FieldName="Group1" SortOrder="Descending"></telerik:GridGroupByField>
                    <telerik:GridGroupByField FieldName="Group2" SortOrder="Descending"></telerik:GridGroupByField>
                </GroupByFields>
            </telerik:GridGroupByExpression>
        </GroupByExpressions>
        <Columns>
            <telerik:GridBoundColumn DataField="Group1" HeaderText="1" ></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Group2" HeaderText="2" ></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

For completeness here is the VB for the page

Partial Class TestArea_Test
    Inherits System.Web.UI.Page
  
    Protected Sub RadGrid1_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        Dim result As New List(Of Test)
        result.Add(New Test("first", "second"))
        RadGrid1.DataSource = result
    End Sub
  
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        RadGrid1.Rebind()
    End Sub
End Class
  
Class Test
    Private _Group1 As String
    Private _Group2 As String
  
    Public Sub New(ByVal g1 As String, ByVal g2 As String)
        Group1 = g1
        Group2 = g2
    End Sub
    Public Property Group1 As String
        Get
            Return _Group1
        End Get
        Set(value As String)
            _Group1 = value
        End Set
    End Property
    Public Property Group2 As String
        Get
            Return _Group2
        End Get
        Set(value As String)
            _Group2 = value
        End Set
    End Property
End Class

Cedric
Top achievements
Rank 2
 answered on 28 Mar 2013
1 answer
96 views
I want to change the column's text like an enum from an int to a value.  For example I get a data field "CompanyId" for 1 I want to display "ACME Inc" for 2 I want to display "Bike Shop"
Now I could change it on the object I've sent over, but I've been living in the XAML world for a while and I was wondering if there was an easy way to convert it.  I guess almost like a calculated column but that looks like it's only for numbers.
Radoslav
Telerik team
 answered on 28 Mar 2013
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?