This is a migrated thread and some comments may be shown as answers.

[Solved] How to disable context menu item with DialogOpener

5 Answers 179 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rachael L
Top achievements
Rank 1
Rachael L asked on 15 Dec 2009, 10:26 PM
Morning all,

I just follow the example ( http://www.telerik.com/support/kb/aspnet-ajax/editor/using-the-image-and-document-managers-outside-radeditor.aspx) using DialogOpener, and I have been asked to disable 'Delete' from context menu. I can not find a way to access to default RadContextMenu. Does anybody know how to do this?  BTW: I am working on RadControls_for_ASP.NET_AJAX_2009_1_402.

Q2: I use subversion for version control, so that I can see the .svn hidden folder after setting up dialogParams.ViewPaths. Is there any way to not show such hidden folders except implementing customer FileSystemContentProvider.

Q3: How can I show image thumbnails after loading image manager with my current version (have no chance to upgrade to higher version recently)

Q4: When trying to delete one .jpg file, it has been removed from image treeview, but still been shown in image previewer, is that possible to clear image previewer when deleting files?

Many thanks in advance.

Cheers,
Rachael

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 16 Dec 2009, 03:11 PM
Hi Rachael,

Straight to the questions:
1) if the DeletePaths property is not set
imageManagerParameters.DeletePaths = new string[] { "~/Images" };
documentManagerParameters.DeletePaths = new string[] { "~/Documents" };
then the Image manager will not render the Delete button and the Delete item in the context menu.

Another way to hide the delete context menu item is to set the DialogsCssFile property
imageManager.Parameters["DialogsCssFile"] = "~/fix.css"; 
and load a fix.css file with the following content:

.rmItem.rmFirst { display: none !important; }

which will hide the Delete item in the right click context menu.

2) It is not possible to hide some folders by setting the ViewPaths property only. You can see how to implement this feature in this KB article: Hide certain directories and files in RadFileExplorer.

3) The Image Manager does not offer the required thumbnails view (image gallery mode).

4) You should not experience this problem. Are you able to reproduce it with the current official version in the default example?


Regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Rachael L
Top achievements
Rank 1
answered on 16 Dec 2009, 08:06 PM
Hi, Rumen

Thank you very much for the reply.

Q1: Yes, I have set DeletePaths value, but how can I disable 'Delete' context menu for folders declared in DeletePaths property. Because those folders not included in DeletePaths property, delete function will be disabled both from context menu and from toolbar.

Q2: Thanks for clear my mind, I have implemented customer FileSystemContentProvider but just wanting to know whether there has some shortcut :)

Q3: :(

Q4: tried to reproduce on live demo but failed with error like 'Sorry, we couldn't find the page you're looking for'. I reproduced it on my dev box. I deleted Bluehills.jpg, but the preview panel was not refreshed although treeview and grid panel had been refreshed. Do you know how to fix it?

Many many thanks.
0
Rumen
Telerik team
answered on 18 Dec 2009, 12:07 PM
Hi Rachael,

1) Did you tried the second approach to hide the Delete context menu item? The example uses the DialogsCssFile property to import the fix.css file in the context menu and apply the .rmItem.rmFirst { display: none !important; } class to hide the delete item.

4) Thank you for reporting this behavior. I logged it in our ToDo list for enhancement in one of the next versions of the control. I added 500 Telerik points to your account for your feature request.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Rachael L
Top achievements
Rank 1
answered on 21 Dec 2009, 12:53 AM
Hi, Rumen,

Thanks for your reply. Actually I have tested it following the second approach, but none successful.  The bellowed is my code, do you think there is anything wrong?

    DialogDefinition dialogDef = new DialogDefinition(typeof(ImageManagerDialog), dialogParams);
            dialogDef.ClientCallbackFunction = "imageManagerCallback";
            dialogDef.Width = Unit.Pixel(694);
            dialogDef.Height = Unit.Pixel(478);
            dialogDef.Title = "Photo Library";
            dialogDef.Modal = true;
            dialogDef.Parameters["DialogsCssFile"] = "~/Preivew/Styles/fix.css";        
            
    dialogOpener.DialogDefinitions.Add("ImageManager", dialogDef);

Cheers,
Rachael
0
Accepted
Rumen
Telerik team
answered on 21 Dec 2009, 03:44 PM
Hi Rachael,

I noticed that you have a typo in the name of the Preview folder:

dialogDef.Parameters["DialogsCssFile"] = "~/Preivew/Styles/fix.css";

Is this the reason for the problem?

For your convenience I have attached my test project where the Delete item is removed from the context menu.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Rachael L
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Rachael L
Top achievements
Rank 1
Share this question
or