3 Answers, 1 is accepted
0

Dean
Top achievements
Rank 2
answered on 12 Apr 2011, 08:45 PM
Hi Naveen,
Please try the following ASP Markup, it will allow you to double click on a file or folder and show the rename window. Please let me know if this works ok.
ASP Markup
Please try the following ASP Markup, it will allow you to double click on a file or folder and show the rename window. Please let me know if this works ok.
ASP Markup
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
Width
=
"300px"
LoadingPanelID
=
"RadLoadingPanel1"
>
<
telerik:RadCodeBlock
runat
=
"server"
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
function OnClientFileOpen(sender, args) {
// Cancel the request to open the file/folder
args.set_cancel(true);
var explorer = $find("<%=RadFileExplorer1.ClientID %>"); //get reference to the fileexplorer
if (!explorer) return;
var grid = explorer.get_grid(); //get reference to the grid component
var treeView = explorer.get_tree(); //get reference to the treeview component
var gridSelectedItems = grid.get_selectedItems();
if (grid.get_selectedItems().length > 1) return; //in case multiple items are selected cancel the execution of the rename
if (grid.get_selectedItems().length == 1) {
explorer._gridContextMenuSelectedItem = grid.get_selectedItems()[0];
explorer.get_gridContextMenu().findItemByValue("Rename").click();
return;
}
if (grid.get_selectedItems().length <
1
) {
treeView.get_selectedNode().startEdit();
return;
}
}
</script>
</
telerik:RadCodeBlock
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadLoadingPanel1"
runat
=
"server"
Skin
=
"Default"
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadFileExplorer
ID
=
"RadFileExplorer1"
runat
=
"server"
OnClientFileOpen
=
"OnClientFileOpen"
>
<
Configuration
ViewPaths
=
"~/Images"
UploadPaths
=
"~/Images"
/>
</
telerik:RadFileExplorer
>
</
telerik:RadAjaxPanel
>
0

Naveen
Top achievements
Rank 1
answered on 13 Apr 2011, 08:02 AM
Hi Dean,
I have tried the below code.It is working as expected.
But here we are overriding the onClientFileOpen functionality.
I don't want to override it.
When I will select a item(say picture) in Grid and click on Open icon on File Explorer Tool Bar it should show me Preview Window and if I double click the same item it should show me Rename Confirmation Box rather than Preview Window.
Can you please help?
Thanks & Regards,
Naveen.
I have tried the below code.It is working as expected.
But here we are overriding the onClientFileOpen functionality.
I don't want to override it.
When I will select a item(say picture) in Grid and click on Open icon on File Explorer Tool Bar it should show me Preview Window and if I double click the same item it should show me Rename Confirmation Box rather than Preview Window.
Can you please help?
Thanks & Regards,
Naveen.
0
Hi Naveen,
You can assign a handler to the RowDoubleClick event of RadGrid component to execute the rename functionality, but please note that navigating to a folder from the grid is also executed on the double click event and this may cause side effects. You can assign handler to the double click event using the following approach:
Best wishes,
Dobromir
the Telerik team
You can assign a handler to the RowDoubleClick event of RadGrid component to execute the rename functionality, but please note that navigating to a folder from the grid is also executed on the double click event and this may cause side effects. You can assign handler to the double click event using the following approach:
<telerik:RadFileExplorer ID=
"RadFileExplorer1"
runat=
"server"
OnClientLoad=
"OnClientLoad"
>
<Configuration ViewPaths=
"~/Files"
UploadPaths=
"~/Files"
DeletePaths=
"~/Files"
/>
</telerik:RadFileExplorer>
<script type=
"text/javascript"
>
function
OnClientLoad(explorer, args)
{
var
grid = explorer.get_grid();
grid.add_rowDblClick(
function
(sender, args)
{
//implement custom functionality here
});
}
</script>
Best wishes,
Dobromir
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.