Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

is there a way how to obtain the default list of custom actions in ECB ? I tried list.UserCustomActions but it returns only custom actions added by user. In my case it returned 0. I would like to obtain custom actions like Edit, View CustomAction objects. I using SPGridView and I would like to make o copy of them because the data come from search engine. I would like to this look close to list view. It is possible? Thanks

share|improve this question

1 Answer 1

If I understood you properly, you want ECB for your list, if yes then you don't need to copy default ones but just this code to create a new ECB column and add it to SPGridView,

      SPMenuField colMenu = new SPMenuField();
      colMenu.HeaderText = "Presenter Name";
      colMenu.TextFields = "PresenterName";
      colMenu.MenuTemplateId = "PresenterListMenu";
      colMenu.NavigateUrlFields = "ID,PresenterName";
      colMenu.NavigateUrlFormat = "do.aspx?p={0}&q={1}";
      colMenu.TokenNameAndValueFields = "EDIT=ID,NAME=PresenterName";
      colMenu.SortExpression = "PresenterName";
      this.Controls.Add(presenterListMenu);
      oGrid.Columns.Add(colMenu);

Source

Don't think you can get default ones, you might need to re-create them, here's the tutorial.

share|improve this answer

Your Answer

 
discard

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.