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

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
add comment

1 Answer

I think you are looking for this,

grdAnnouncements.RowDataBound += new GridViewRowEventHandler(grdAnnouncements_RowDataBound);
                BindGrid(dtResultData);

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)
            {

Source

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
add comment

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.