<telerik:RadFileExplorer ID="FileExplorer" runat="server" EnableCreateNewFolder="True"
OnClientItemSelected="OnClientItemSelected" EnableCopy="True">
<Configuration ViewPaths="~/Documents/Site Documents" UploadPaths="~/Documents/Site Documents"
DeletePaths="~/Documents/Site Documents" MaxUploadFileSize="2048000" />
</telerik:RadFileExplorer>
$(function() { hookDeleteEvent();});
var keyCodeForDeleteButton = 46;function hookDeleteEvent() { $(document).keyup(function(e) { if (e.keyCode == keyCodeForDeleteButton) { runDeleteOnSelectedElement(); } });}function runDeleteOnSelectedElement() { var explorer = $find("<%=DocumentBrowser.ClientID %>"); if (userMayDeleteSelectedFiles(explorer)) explorer.deleteSelectedItems();}function userMayDeleteSelectedFiles(explorer) { if (isInEditMode(explorer)) return false; return true;}function isInEditMode(explorer) { var item = explorer.get_selectedItem(); return item.get_isUpdating();}set_currentItemIndex" failed work. Help needed.function showItemByIndex(index) {<br> // gets reference to the rotator object<br> var oRotator = $find("<%= RadRotator1.ClientID %>");<br> // Sets currently shown item by its index<br> oRotator.set_currentItemIndex(index);<br> }<br>| <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlTask" OnColumnCreated="RadGrid1_ColumnCreated" |
| OnItemCreated="RadGrid1_ItemCreated" OnInsertCommand="taskInsertCommand" OnItemCommand="RadGrid1_ItemCommand" |
| OnUpdateCommand="taskUpdateCommand" OnDeleteCommand="taskDeleteCommand" |
| OnItemDataBound="RadGrid1_ItemDataBound" GridLines="None" Skin="Sunset" Width="100%"> |
| <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="ServerBind" AllowSorting="true" AllowFilteringByColumn="true" |
| DataKeyNames="id, deadline, percent_complete, id_prioritete" Width="100%" AutoGenerateColumns="False" |
| DataSourceID="SqlTask" GridLines="None" AllowPaging="False" EditMode="PopUp"> |
| <SelfHierarchySettings ParentKeyName="id_parent" KeyName="id" /> |
| <Columns> |
| <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Preview" Text="Predogled" ImageUrl="~/members/images/magnifier.png" UniqueName="Preview"> |
| <HeaderStyle Width="25px" /> |
| </telerik:GridButtonColumn> |
| <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelText="Preklici" |
| InsertText="Dodaj" UpdateText="Shrani"> |
| <HeaderStyle Width="32px" /> |
| </telerik:GridEditCommandColumn> |
| <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" |
| ConfirmDialogType="RadWindow" ConfirmText="Ali si preprican da želiš izbrisati vnos?" |
| Text="Briši" UniqueName="column"> |
| <HeaderStyle Width="32px" /> |
| </telerik:GridButtonColumn> |
| <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="StartTask" Text="Začni z nalogo" |
| UniqueName="StartTask" ImageUrl="~/members/images/calendar.gif"> |
| <HeaderStyle Width="25px" /> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn HeaderText="P" ReadOnly="true" UniqueName="priority" AllowFiltering="false" HeaderStyle-Width="25px" DataField="priority"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="P" ReadOnly="true" UniqueName="id_prioritete" |
| AllowFiltering="false" HeaderStyle-Width="25px" DataField="id_prioritete" Visible="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="EndTask" Text="Končaj nalogo" |
| UniqueName="EndTask" ImageUrl="~/members/images/cancel.gif"> |
| <HeaderStyle Width="25px" /> |
| </telerik:GridButtonColumn> |
| <telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="ID" |
| ReadOnly="True" SortExpression="id" UniqueName="id" Visible="false"> |
| <HeaderStyle Width="200px" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="title" DataType="System.String" |
| HeaderText="NASLOV" SortExpression="title" |
| UniqueName="title" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="start_date" DataType="System.DateTime" |
| HeaderText="DATUM ZAČETKA" SortExpression="start_date" UniqueName="start_date" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="task_creator" DataType="System.Guid" |
| HeaderText="USTVARJALEC" SortExpression="task_creator" |
| UniqueName="task_creator" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="task_assigned" DataType="System.Guid" |
| HeaderText="IZVAJALEC" SortExpression="task_assigned" |
| UniqueName="task_assigned" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="deadline" DataType="System.DateTime" |
| HeaderText="ROK" SortExpression="deadline" UniqueName="deadline" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="percent_complete" DataType="System.Int32" |
| HeaderText="KONČANO V %" SortExpression="percent_complete" |
| UniqueName="percent_complete" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="end_date" DataType="System.DateTime" |
| HeaderText="DATUM KONCA" SortExpression="end_date" UniqueName="end_date" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="predecessors" HeaderText="PREDHODNIKI" |
| SortExpression="predecessors" UniqueName="predecessors" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="id_parent" DataType="System.Int32" |
| HeaderText="id_parent" SortExpression="id_parent" UniqueName="id_parent" Visible="false" HeaderStyle-Width="150px"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| <EditFormSettings CaptionFormatString="UREJANJE NALOG" UserControlName="user_controls/insertTask.ascx" |
| EditFormType="WebUserControl" PopUpSettings-Width="600"> |
| <EditColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1"> |
| </EditColumn> |
| <PopUpSettings ScrollBars="None"></PopUpSettings> |
| </EditFormSettings> |
| </MasterTableView> |
| <ClientSettings AllowExpandCollapse="true" /> |
| </telerik:RadGrid> |
| protected void RadGrid1_RowDrop(object sender, GridDragDropEventArgs e) |
| { |
| GridDataItem dataItem = e.DraggedItems[0]; |
| Hashtable values = new Hashtable(); |
| dataItem.ExtractValues(values); |
| int id = (int) dataItem.GetDataKeyValue("AppointmentID"); |
| string subject = (string) values["Subject"]; |
| string targetSlotIndex = TargetSlotHiddenField.Value; |
| if (targetSlotIndex != string.Empty) |
| { |
| HandleSchedulerDrop(id, subject, targetSlotIndex); |
| TargetSlotHiddenField.Value = string.Empty; |
| } |
| RadScheduler1.Rebind(); |
| RadGrid1.Rebind(); |
| RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadGrid1, RadScheduler1); |
| } |
| private void HandleSchedulerDrop(int id, string subject, string targetSlotIndex) |
| { |
| RadScheduler1.Rebind(); |
| ISchedulerTimeSlot slot = RadScheduler1.GetTimeSlotFromIndex(targetSlotIndex); |
| TimeSpan duration = TimeSpan.FromHours(1); |
| if (slot.Duration == TimeSpan.FromDays(1)) |
| { |
| duration = slot.Duration; |
| } |
| ScheduleAppointment(id, subject, slot.Start, slot.Start.Add(duration), slot.Resource); |
| } |
| protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e) |
| { |
| if (e.CommandName == "Unschedule") |
| { |
| int id = (int)e.Container.Appointment.ID; |
| DateTime dueDate = DateTime.Now; |
| if (!string.IsNullOrEmpty(e.Container.Appointment.Attributes["Due"])) |
| dueDate = Convert.ToDateTime(e.Container.Appointment.Attributes["Due"]); |
| string priority = "Medium"; |
| if (!string.IsNullOrEmpty(e.Container.Appointment.Attributes["Priority"])) |
| priority = e.Container.Appointment.Attributes["Priority"]; |
| UnscheduleAppointment(id, dueDate, priority); |
| RadScheduler1.Rebind(); |
| RadGrid1.Rebind(); |
| RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadScheduler1, RadGrid1); |
| } |
| } |
| private void UnscheduleAppointment(int id, DateTime dueDate, string priority) |
| { |
| IDataSource dataSource = SqlDataSource2; |
| DataSourceView view = dataSource.GetView("DefaultView"); |
| IOrderedDictionary data = new OrderedDictionary(); |
| data.Add("Start", null); |
| data.Add("End", null); |
| data.Add("Due", dueDate); |
| data.Add("Priority", priority); |
| IDictionary keys = new OrderedDictionary(); |
| keys.Add("AppointmentID", id); |
| view.Update(keys, data, new OrderedDictionary(), OnDataSourceOperationComplete); |
| } |
| private void ScheduleAppointment(int id, string subject, DateTime start, DateTime end, Resource res) |
| { |
| IDataSource dataSource = SqlDataSource1; |
| DataSourceView view = dataSource.GetView("DefaultView"); |
| IOrderedDictionary data = new OrderedDictionary(); |
| data.Add("Subject", subject); |
| data.Add("Start", start); |
| data.Add("End", end); |
| data.Add("employeeid", res); |
| IDictionary keys = new OrderedDictionary(); |
| keys.Add("AppointmentID", id); |
| view.Update(keys, data, new OrderedDictionary(), OnDataSourceOperationComplete); |
| } |
| private static bool OnDataSourceOperationComplete(int count, Exception e) |
| { |
| if (e != null) |
| { |
| throw e; |
| } |
| return true; |
| } |
Hello,
I am evaluating the Editor control for possible use. I would like to know if this scenario can be accomplished using it.
1. There will be some RTF files on the web server, the files would contain tags or merge fields for a database merge. These RTF files would serve as templates. Admin users could edit the content using the RichTextBox and save the changed RTF file to the same folder.
2. Other users would fill out a form, the form data is stored in a database.
3. The form data is merged with the RTF template and the resulting new RTF file is stored in a new folder on the web server that is specific to the user.
4. The RTF from step 3 is converted to a PDF in the same folder.
If possible, steps 3 and 4 would be done programitically and the process would be invisible to the user. In other words the user does not need to open the document in the Editor choose a location, and save. They simply fill out the form in step 2, click a button, and steps 3 and 4 are performed.
Thank you very much,
Randy

DockOnOpen
="true" ClickToOpen="true"
DockOnOpen="true" ClickToOpen="true"