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

working on custom web part. I included SPGridView to this web part. I know there is an option at the begining define menu items, however I would like to add/delete/modify the menu items dynamically. I would like to do that on event SPGridView.RowDataBound. Reason is that here Iam accessing items from various lists. I am able to access the Menu from this event hander, however I am not able to add/delete/modify MenuItem's. Is this possible at all? I would not like to just show/hide menu items, I would like to modify them.

share|improve this question

I think you are looking for this,

grdAnnouncements.RowDataBound += new GridViewRowEventHandler(grdAnnouncements_RowDataBound);

You can add a event to rows and then access them using,

protected void grdAnnouncements_RowDataBound(object sender, GridViewRowEventArgs e)
            if (e.Row.RowType == DataControlRowType.DataRow)


share|improve this answer
well actually i know about this handler, however from here i need to access the menu for the current row item and alter items in menu. – Ivan Feb 26 '13 at 10:18

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.