Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
111 views
I am using FileExplorer "out of the box"

 

<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>

 


When I try to drag-and-drop a .pdf file it works, when I try to do the same with a .gif or .htm between the same directories I get a "no permission to move file" error.

Any idea what I am doing wrong?

John
Petio Petkov
Telerik team
 answered on 28 Jul 2010
1 answer
86 views
Hi All:
I have RadGrid which conatin GridButtonColumn  with Groupable="true" and GroupByExpression="FullName Group By FullName" , But the grouping on this column doesn't work .

Best Regards


MBM
Rosen
Telerik team
 answered on 28 Jul 2010
2 answers
110 views
Hi guys!
[client side] I've added a keypress-hook to the <delete> button and added a call to the "FileExplorer.deleteSelectedItems".
Problem is; when editing(renaming) folder in treeview and pressing <delete>-button this is interpreted as "deleteSelectedItems".
I've tried to use the item.get_isUpdating() method, but this always returns "false". How do I figure out if an element is
in "edit-mode"? Do you have any other solution(s) to how this may be solved?

$(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();
}

BR
-Gard
Petio Petkov
Telerik team
 answered on 28 Jul 2010
1 answer
105 views
Hi there,
     I am customizing rotator, i have looked into pager integration in demos at telerik but my requirement is a little bit different. I want to add navigation links to the bottom of the rotator control as highlighted in the attached document, so that when hover it will take end-user to the hovered slide as well as when not hovered on any navigation link at the bottom of the rotator  it will retain its slide show. Hope i clear myself on this. Rest of the work is done except the navigation links at the bottom of the rotator. Any help in this regards will be highly appreciated.
     Moreover i have also tried following code, but i am sorry to say that client side function "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>

Regards,
Muhammad Yasir.
Pero
Telerik team
 answered on 28 Jul 2010
3 answers
67 views
Hello,

I have followed this example to build a SelfHierarchy RadGrid:
http://www.telerik.com/help/aspnet/grid/grdselfreferencinghierarchy.html
and it went well, except for the filters.

What's happening is that when I add a filter condition it displays the root item and the child items as it should and then again child items as if they were root items.

Here is the aspx code of the grid:
<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> 


Best regards,
Tomaž Lovrec


Tomaž Lovrec
Top achievements
Rank 1
 answered on 28 Jul 2010
4 answers
218 views
I am using the Drag and Drop integration example. When I drag a row from the RadGrid onto the scheduler while the scheduler is group by resources I get the error "Resource index out of range: 1". This is the sample default.aspx.cs code I am trying to use. I have noted that when grouped by resources the slotTargetindex format goes from "1:0:0" to "0:1:0:0". Any help would be appreciated.

Thanks, Tom

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;  
        } 
Ashley
Top achievements
Rank 1
 answered on 28 Jul 2010
3 answers
156 views
Hi,

Is it possible to arrange the inner nodes in two columns rather than default one column? For example,

Rather than following default look, 

Node1
        InnerNode1
InnerNode2
InnerNode3
Node2 
       InnerNode1
       InnerNode2
       InnerNode3
       InnerNode4

Is it possible to have it re-arranged to like below?

Node1
       InnerNode1  Inner Node2 
       InnerNode3
Node2
      InnerNode1  InnerNode2
      InnerNode3  InnerNode4


Any help is highly appreciated.

Many thanks.

M G



Yana
Telerik team
 answered on 28 Jul 2010
1 answer
86 views

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

Rumen
Telerik team
 answered on 28 Jul 2010
1 answer
74 views

Hello Sir,
i want to change spliter property like

DockOnOpen

 

="true" ClickToOpen="true"

 


on spliter client side event how can i achive it.
please help me.

Thanks
Chandan

for example :- if i write following event
function OnClientCollapsed(sender,args)
        {
            what code should written for set Property

            DockOnOpen="true" ClickToOpen="true"

 


        }
Dobromir
Telerik team
 answered on 28 Jul 2010
1 answer
213 views
Hi there --

I've built a little Javascript function to properly set the height of my Splitters when they're loaded on a TabPanel that keeps them hidden at the completion of the page's load event.  However, there's trouble in paradise: When I try to grab the new height variable with a call to pane.getContentElement().scrollHeight... I get zero as a result!

This definitely isn't right; there's a 600-pixel tall image in the pane.  What's going on?

Thanks,

Jesse

function ResetRadPaneHeight(splitterID, paneID) {
    var splitter = $find(splitterID);
    if (splitter) {
        splitter.repaint();
        var pane = splitter.getPaneById(paneID);
        var height = pane.getContentElement().scrollHeight;
        if (height != 0) { // if height is 0, something is amiss...
            splitter.set_height(height);
            pane.set_height(height);
        }
        else
        {
            alert('For some reason ' + paneID + '.getContentElement().scrollHeight = 0');
        }
    } else {
        // recursively try this function again in 1 second
        setTimeout('ResetRadPaneHeight(\'' + splitterID + '\', \'' + paneID + '\');', 1000);
    }
}

Dobromir
Telerik team
 answered on 28 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?