SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a question regarding Custom actions:

Basically what I would like to have is a custom action to shown only when the list.RootFolder.Properties.ContainsKey().

This action is located in the ribbon.

Any idea on how I can do that?

share|improve this question
up vote 1 down vote accepted

To answer my own question, I found a solution by creating custom action automatically when my feature by anyway is activated.

I used SPUserCustomAction, here is a piece of code for someone who will be interested, the code is shortned, but you will see the idea:

 SPUserCustomAction action = list.UserCustomActions.Add();
                action.Title = "";
                action.Description = "";
                action.Location = "CommandUI.Ribbon";
                action.Sequence = 10000;

                action.CommandUIExtension = @"<CommandUIExtension>
        <CommandUIDefinition Location="">
          <Button />
        <CommandUIHandler />
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.