Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
127 views
Hello.
I'm using timelinewiew with resources (people) to develop a planning application. Purpose is to have "events" not assigned to a resource and by moving the event and dropping it on a resource's timeline assign it to that resource. The setup works fine, display of both events and resources works. The events are actually two classes of business objects that both derive from one class that exposes the Appointment attributes (start, end, subject etc.). Both types of events are supplied from database in generic lists. Resources too.

I have implemented the server-side method myScheduler_AppointmentUpdated with logic to update an event if it is dragged from one resource's timeline to another (and then setting the schedulers DataSource to an updated list of events). This seems to work, as at least sometimes when I move an event from one resource to another, the AppointmentUpdate event is fired. But, the event does not fire every time. I have tried to find a pattern for when the event fires and when not, but it seems random.

Not using any client-side stuff at all.

It seems I'm missing something basic here, which is probably correct as I'm a Telerik/scheduler noob :)

Anyone have any ideas?

Attached a screenshot of the timeline layout.
This is my scheduler:
<telerik:RadScheduler ID="schAbsences"
        runat="server"
        HoursPanelTimeFormat="HH:mm"
        SelectedView="TimelineView"
        ShowViewTabs="false"
        ShowResourceHeaders="true"
        TimelineView-EnableExactTimeRendering="true" 
        TimelineView-ShowDateHeaders="true"   
        OnAppointmentDataBound ="schAbsences_AppointmentDataBound"
        OnAppointmentDelete="schAbsences_AppointmentDelete"
        OnAppointmentUpdate="schAbsences_AppointmentUpdate"
        ColumnHeaderDateFormat="h:mm"
        FirstDayOfWeek="Monday"
        LastDayOfWeek="Sunday"
        ShowAllDayRow="true"
        ShowFooter="true"
        OverflowBehavior="Expand"
        OnNavigationComplete="schAbsences_NavigationComplete">
        <TimelineView NumberOfSlots="24" SlotDuration="01:00:00" TimeLabelSpan="1" ColumnHeaderDateFormat="HH:mm tt" />
    </telerik:RadScheduler>
And this is my code-behind:
Resource-types:
ResourceType rt = new ResourceType();
                rt.Name = "Resources";
                rt.ForeignKeyField = "ResourceId";
                rt.KeyField = "Id";
                rt.TextField = "FullName";
                List<Entities.Resource> blapp = new List<Entities.Resource>();
                blapp.AddRange(DBManager.GetExistingResources());
                Entities.Resource r = new Entities.Resource();
                r.firstName = "Inte";
                r.lastName = "tillsatt";
                r.Id = 0;
                blapp.Insert(0, r);
                rt.DataSource = blapp;
                schAbsences.ResourceTypes.Add(rt);
                DateTime startTime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
                schAbsences.SelectedDate = startTime;
                
                schAbsences.TimelineView.GroupBy = "Resources";
                schAbsences.TimelineView.GroupingDirection = GroupingDirection.Vertical;
AppointmentUpdate-method:
protected void schAbsences_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
        {
            String type = e.Appointment.Attributes["appointmentType"];
            if (type.Equals("Absence"))
            {
                //Do update (use Attributes)
                int origRsId = int.Parse(e.Appointment.Resources[0].Key.ToString());
            }
            else
            {
                int origResId = int.Parse(e.Appointment.Resources[0].Key.ToString());
                int newResId = int.Parse(e.ModifiedAppointment.Resources[0].Key.ToString());
                int appointmentId=int.Parse(e.Appointment.ID.ToString());
                DBManager.UpdateMovedPlacementCompetence(appointmentId, newResId);
                e.Cancel = true;
            }
            List<BDEvent> list = DBManager.GetAllAbsencesAsEvents();
            list.AddRange(DBManager.GetAllPlacementCompetences());
            schAbsences.DataSource = list;
             
        }
Plamen
Telerik team
 answered on 20 Jan 2015
4 answers
113 views
Hi..

I'm using batch edit mode on my rad grid.. I need to run some code after last iteration of the UpdateCommand. http://www.telerik.com/help/aspnet-ajax/grid-batch-editing.html...

How can I test for the last iteration of RadGrid.UpdateCommandName when using batch edit.mode?

             protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
                { 
                      if (e.CommandName == RadGrid.UpdateCommandName)
                      {

                       }
                }
Dave
Top achievements
Rank 1
 answered on 20 Jan 2015
14 answers
434 views
Hi,
I have followed the documentation and googled to find way to how to deploy radgrid in my sharepoint page. But I am unable to do it.....can anyone give me a sample code + a webpart file to just upload it in sharepoint and use it? From this, I could get an idea to how to populate Radgrid from within Sharepoint.
And one thing more, do I need to tell Sharepoint like to make Telerik components being used? Well, I know how to add safe controls in web.config.
vijila
Top achievements
Rank 1
 answered on 20 Jan 2015
2 answers
92 views
Hi,
I have my grid setup like this:               

<Columns>
                <telerik:GridBoundColumn DataField="col1" HeaderText="Col 1" UniqueName="mytxt" />
                <telerik:GridDropDownColumn DataField="col2" UniqueName="mydd" DropDownControlType="RadComboBox"  HeaderText="Col 2" />                                     
</Columns>


Now I have some questions relating to this:

1. Do I need to manually handle the populating of the field for 'view' mode? Unless I use the code below in ItemDataBound then in view mode the dropdown column is empty.           

if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                DataRowView row = (DataRowView)e.Item.DataItem;
                item["mydd"].Text = row["col2"].ToString();
            }


2. Why does the drop down column have no controls, in ItemDataBound:           

if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
            GridEditableItem item = (GridEditableItem)e.Item; 
             
            //Controls has one control:
            //RadTextBox = (RadTextBox)item["mytxt"].Controls[0]; 
             
            //Controls is empty:
            //RadComboBox com = (RadComboBox)item["mydd"].Controls[0];
 }


3. Is it possible to use a non-datasource-bound combo? so in ItemDataBound I would do something like this:  
         
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
            GridEditableItem item = (GridEditableItem)e.Item;
 
            RadComboBox com = (RadComboBox)item["mydd"].Controls[0];
            com.Items.Add(new RadComboxItem("a", "a"));
            com.Items.Add(new RadComboxItem("b", "b"));
 }

Eyup
Telerik team
 answered on 20 Jan 2015
6 answers
674 views
I have 2 div's on my form.

One is Home Address Information and one is Mailing Address Information. Each includes a radcombobox for states.  I also have a checkbox that says "Mail Address same as Home Address" and when the person checks this, I need to copy the Home Address fields (address,city,state) to the Mailing Address fields (address,city,state)  and I want to do this client side of course.

When I use the standard <asp: DropDownList, I can just say this and it works:
$("#<%=ddlMState.ClientID %>").val($("#<%=ddlHState.ClientID %>").val());

This does not work with the Telerik control. Can you help? I would rather use your radcombobox

Thanks!
Nencho
Telerik team
 answered on 20 Jan 2015
1 answer
130 views
Hi there

I'm trying to retrieve a some basic related tables using an OpenAccessLinqDatasource control. I can retrieve one table just fine, but I get stuck trying to use the Custom Grouping as described in the documentation.

Basically I would like to have this query (which works just fine in SQL), work in the DataSource on my page:

"Select custorderitems.quantity, prodmain.itemtitle from custorderitems INNER JOIN prodmain on custorderitems.fkstoreitem = prodmain.id"

I've attached screenshots of the configuration screen where I enter the Custom Select Expression etc. Using a custom expression of new(quantity) actually works, I get that column in the RadGrid. The problem comes in when I specify another context with a field.. If I add Prodmain.itemtitle, I get no data at all.

Is there perhaps a clearer guide or tutorial explaining the Custom Grouping option of the OpenAccessLinqDatasource??

Regards
JohannS
Doroteya
Telerik team
 answered on 20 Jan 2015
6 answers
197 views
Hello,

  I am looking to block any kind copy in radeditor control like CTRL+C and Mouse Right Click and copy option.


This is basic requirement of security for clinical prospective.
Please help me to solve this issue.

Thanks.
Ianko
Telerik team
 answered on 20 Jan 2015
3 answers
87 views
Hi,
Greetings!

The application that I am currently working upon was using Telerik 2009 version and we upgrated the same to the latest Telerik 2014 version for ASP.Net after which one of the form containing two RadEditors got distroted. I have attached the screen shot of the form before the upgrade and the form after the upgrade for reference. Also, please refer the code below. .

<telerik:radgrid id="grdFMEAv2" runat="server" autogeneratecolumns="false" onneeddatasource="grdFMEA_NeedDataSource"
onitemdatabound="grdFMEA_OnItemDataBound" oninsertcommand="grdFMEA_InsertCommand"
ondeletecommand="grdFMEA_DeleteCommand" onitemcommand="grdFMEA_ItemCommand" onitemcreated="grdFMEA_ItemCreated"
width="98%" allowpaging="true" pagerstyle-alwaysvisible="true" allowsorting="true">
<mastertableview commanditemdisplay="Bottom" editmode="InPlace" allowsorting="true"
datakeynames="CMSFMEAID">
<Columns>
<telerik:GridEditCommandColumn UniqueName="Edit" UpdateText="Update" ButtonType="ImageButton"
CancelImageUrl="../Images/Cancel.gif" InsertImageUrl="../Images/Update.gif" UpdateImageUrl="../Images/Update.gif"
EditImageUrl="../Images/Edit.gif">
<ItemStyle HorizontalAlign="center" Width="5%"></ItemStyle>
</telerik:GridEditCommandColumn>
<telerik:GridTemplateColumn HeaderText="FMEA Type" UniqueName="FMEAType" DataField="FMEAType"
SortExpression="FMEAType" HeaderStyle-Width="12%" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label runat="server" ID="lblFMEAType" CssClass="gridlabel" Text='<%#Eval("FMEAType")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="rcbFMEATypeEdit" runat="server" DataTextField="FMEAType"
Width="80px" AutoPostBack="true" OnSelectedIndexChanged="rcbFMEATypeEdit_SelectedIndexChanged"
CssClass="normalDropDownList" Skin="Web20" MarkFirstMatch="true">
<Items>
<telerik:RadComboBoxItem runat="server" Text="" Value="" />
<telerik:RadComboBoxItem runat="server" Text="DFMEA" Value="1" />
<telerik:RadComboBoxItem runat="server" Text="PFMEA" Value="2" />
<telerik:RadComboBoxItem runat="server" Text="No FMEA" Value="3" />
</Items>
</telerik:RadComboBox>
<asp:RequiredFieldValidator ID="rfvFMEAType" runat="server" ControlToValidate="rcbFMEATypeEdit"
Display="None" SetFocusOnError="true" ErrorMessage="Please select FMEA Type"
></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="vceFMEAType" runat="server" TargetControlID="rfvFMEAType"
CssClass="AjaxValidatorCalloutExtender">
</ajaxToolkit:ValidatorCalloutExtender>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="12%" VerticalAlign="Top"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="FMEA Name" ItemStyle-HorizontalAlign="Left"
SortExpression="FMEAName" HeaderStyle-Width="12%">
<ItemTemplate>
<asp:Label runat="server" ID="lblFMEAName" CssClass="gridlabel" Text='<%#Eval("FMEAName")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox ID="rcbFMEANameEdit" runat="server" DataTextField="FMEAName"
Width="80px" AutoPostBack="true" OnSelectedIndexChanged="rcbFMEANameEdit_SelectedIndexChanged"
CssClass="normalDropDownList" Skin="Web20" MarkFirstMatch="true">
</telerik:RadComboBox>
<asp:RequiredFieldValidator ID="rfvFMEANameEdit" runat="server" ControlToValidate="rcbFMEANameEdit"
ErrorMessage="Please select FMEA Name" Display="None" InitialValue=""></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="vceFMEAName" runat="server" TargetControlID="rfvFMEANameEdit"
CssClass="AjaxValidatorCalloutExtender">
</ajaxToolkit:ValidatorCalloutExtender>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="10%" VerticalAlign="Top"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="FMEA Owner" DataField="FMEA Owner" ItemStyle-HorizontalAlign="Left"
SortExpression="FMEAOwnerName" HeaderStyle-Width="12%">
<ItemTemplate>
<asp:Label ID="lblFMEAOwner" runat="server" CssClass="gridlabel" Text='<%#Eval("FMEAOwnerName")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="lblFMEAOwnerEdit" runat="server" CssClass="gridlabel" Text='<%#Eval("FMEAOwnerName")%>'></asp:Label>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="10%" VerticalAlign="Top"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Relevant Risk(s)" DataField="Relevant Risk(s)"
ItemStyle-HorizontalAlign="Left" SortExpression="RelevantRisk" HeaderStyle-Width="20%">
<ItemTemplate>
<div id="txtRelevantrisk" runat="server">
<%#Eval("RelevantRisk")%>
</div>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadEditor ID="txtRelevantrisk_Edit" runat="server" Font-Names="Arial" Font-Size="10pt"
Content='<%#Eval("RelevantRisk")%>' EditModes="Design" Height="200px" Width="280px"
ContentFilters="IndentHTMLContent">
<CssFiles>
<telerik:EditorCssFile Value="~/EditorContentArea.css" />
</CssFiles>
<RealFontSizes>
<telerik:EditorRealFontSize Value="8pt" />
<telerik:EditorRealFontSize Value="9pt" />
<telerik:EditorRealFontSize Value="10pt" />
<telerik:EditorRealFontSize Value="11pt" />
<telerik:EditorRealFontSize Value="12pt" />
<telerik:EditorRealFontSize Value="14pt" />
<telerik:EditorRealFontSize Value="16pt" />
<telerik:EditorRealFontSize Value="18pt" />
<telerik:EditorRealFontSize Value="20pt" />
<telerik:EditorRealFontSize Value="22pt" />
<telerik:EditorRealFontSize Value="24pt" />
<telerik:EditorRealFontSize Value="26pt" />
<telerik:EditorRealFontSize Value="28pt" />
<telerik:EditorRealFontSize Value="32pt" />
<telerik:EditorRealFontSize Value="36pt" />
<telerik:EditorRealFontSize Value="48pt" />
<telerik:EditorRealFontSize Value="72pt" />
</RealFontSizes>
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="Copy" />
<telerik:EditorTool Name="Paste" />
<telerik:EditorTool Name="Bold" />
<telerik:EditorTool Name="FontName" Text="Calibri" />
<telerik:EditorTool Name="RealFontSize" Text="12pt" />
<telerik:EditorTool Name="InsertOrderedList" />
<telerik:EditorTool Name="InsertUnorderedList" />
</telerik:EditorToolGroup>
</Tools>
<FontNames>
<telerik:EditorFont Value="Arial" />
<telerik:EditorFont Value="Arial Black" />
<telerik:EditorFont Value="Arial Narrow" />
<telerik:EditorFont Value="Calibri" />
<telerik:EditorFont Value="Comic Sans MS" />
<telerik:EditorFont Value="Courier New" />
<telerik:EditorFont Value="Georgia" />
<telerik:EditorFont Value="Lucida Console" />
<telerik:EditorFont Value="sans-serif" />
<telerik:EditorFont Value="Tahoma" />
<telerik:EditorFont Value="Times New Roman" />
<telerik:EditorFont Value="Verdana" />
</FontNames>
<Content></Content>
</telerik:RadEditor>
<asp:RequiredFieldValidator ID="rfvRelevantrisk_Edit" runat="server" ControlToValidate="txtRelevantrisk_Edit"
ErrorMessage="Please Enter Relevant Risk(s)" Display="None" InitialValue=""></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="vceRelevantrisk" runat="server" TargetControlID="rfvRelevantrisk_Edit"
CssClass="AjaxValidatorCalloutExtender">
</ajaxToolkit:ValidatorCalloutExtender>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="20%" VerticalAlign="Top"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Mitigation Item(s)" DataField="Mitigation Item(s)"
ItemStyle-HorizontalAlign="Left" SortExpression="MitigationAction" HeaderStyle-Width="20%">
<ItemTemplate>
<div id="txtMT" runat="server">
<%#Eval("MitigationAction")%>
</div>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadEditor ID="txtMTEdit" runat="server" Font-Names="Arial" Font-Size="10pt"
Content='<%#Eval("MitigationAction")%>' EditModes="Design" Height="200px" Width="280px"
ContentFilters="IndentHTMLContent">
<CssFiles>
<telerik:EditorCssFile Value="~/EditorContentArea.css" />
</CssFiles>
<RealFontSizes>
<telerik:EditorRealFontSize Value="8pt" />
<telerik:EditorRealFontSize Value="9pt" />
<telerik:EditorRealFontSize Value="10pt" />
<telerik:EditorRealFontSize Value="11pt" />
<telerik:EditorRealFontSize Value="12pt" />
<telerik:EditorRealFontSize Value="14pt" />
<telerik:EditorRealFontSize Value="16pt" />
<telerik:EditorRealFontSize Value="18pt" />
<telerik:EditorRealFontSize Value="20pt" />
<telerik:EditorRealFontSize Value="22pt" />
<telerik:EditorRealFontSize Value="24pt" />
<telerik:EditorRealFontSize Value="26pt" />
<telerik:EditorRealFontSize Value="28pt" />
<telerik:EditorRealFontSize Value="32pt" />
<telerik:EditorRealFontSize Value="36pt" />
<telerik:EditorRealFontSize Value="48pt" />
<telerik:EditorRealFontSize Value="72pt" />
</RealFontSizes>
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="Copy" />
<telerik:EditorTool Name="Paste" />
<telerik:EditorTool Name="Bold" />
<telerik:EditorTool Name="FontName" Text="Calibri" />
<telerik:EditorTool Name="RealFontSize" Text="12pt" />
<telerik:EditorTool Name="InsertOrderedList" />
<telerik:EditorTool Name="InsertUnorderedList" />
</telerik:EditorToolGroup>
</Tools>
<FontNames>
<telerik:EditorFont Value="Arial" />
<telerik:EditorFont Value="Arial Black" />
<telerik:EditorFont Value="Arial Narrow" />
<telerik:EditorFont Value="Calibri" />
<telerik:EditorFont Value="Comic Sans MS" />
<telerik:EditorFont Value="Courier New" />
<telerik:EditorFont Value="Georgia" />
<telerik:EditorFont Value="Lucida Console" />
<telerik:EditorFont Value="sans-serif" />
<telerik:EditorFont Value="Tahoma" />
<telerik:EditorFont Value="Times New Roman" />
<telerik:EditorFont Value="Verdana" />
</FontNames>
<Content></Content>
</telerik:RadEditor>
<asp:RequiredFieldValidator ID="rfvMitigationAction" runat="server" ControlToValidate="txtMTEdit"
ErrorMessage="Please Enter Mitigation Action(s)" Display="None" InitialValue=""></asp:RequiredFieldValidator>
<ajaxToolkit:ValidatorCalloutExtender ID="vceMT" runat="server" TargetControlID="rfvMitigationAction"
CssClass="AjaxValidatorCalloutExtender">
</ajaxToolkit:ValidatorCalloutExtender>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="20%" VerticalAlign="Top"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="URL" DataField="URL" ItemStyle-HorizontalAlign="Left"
HeaderStyle-Width="10%">
<ItemTemplate>
<asp:HyperLink ID="hplnkURL" runat="server" Text="View FMEA here" NavigateUrl='<%#Eval("URL")%>'
Target="_blank" ForeColor="Blue"></asp:HyperLink>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server" ID="txtURL" Text='<%#Eval("URL")%>' CssClass="textboxCalibri"></asp:TextBox>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Left" Width="15%"></ItemStyle>
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn UniqueName="Delete" CommandName="Delete" ButtonType="ImageButton"
ImageUrl="..\Images\delete.gif" ConfirmText="Do you want to delete this row?">
<ItemStyle HorizontalAlign="Left" Width="4%"></ItemStyle>
</telerik:GridButtonColumn>
</Columns>
<ItemStyle VerticalAlign="Top" />
<ItemStyle CssClass="gridlabel" />
<AlternatingItemStyle CssClass="gridlabel" />
<HeaderStyle CssClass="gridlabel" />
<CommandItemSettings RefreshText="" ShowRefreshButton="false" AddNewRecordImageUrl="../Images/AddRecord.gif" />
<NoRecordsTemplate>
No Records to display.</NoRecordsTemplate>
</mastertableview>
</telerik:radgrid>
 
Ianko
Telerik team
 answered on 20 Jan 2015
1 answer
113 views
Hi,

Is is possible to create cue points in a video file using Telerik Media Player? I have a requirement to integrate media player in a webpage and to create a XML file which defines cue points with time interval. At the time of playing video file using media player it will take the cue points from XML file and create cue points in the video player and links as shown in attached image. 

Please help me to achieve this feature. Thank you .
Konstantin Dikov
Telerik team
 answered on 20 Jan 2015
3 answers
270 views
Hello,

I have the following questions about the view of imported RTF or DOCX documents inside the editor:

1. Is there a possibility to show page information (current page number) and page separations like in Word?

2. Is there a possibility to show/edit header and footer of documents like in Word? When I tried to import RTF or DOCX files, header and footer got completely lost and were not displayed in the editor.

Thanks,
Felix
Ianko
Telerik team
 answered on 20 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?