views:

151

answers:

2

I am using spgridview for showing listdata,also using spmenufield.

I need to perform approve operation on any selected/clicked item from spgridview.

Can you please help,how can i achieve this?

A: 

It sounds like you already have the code set up so all you need to do is update the list item.

To approve the item, update the _ModerationStatus to 0.

Or, I believe you can use the API (simply wraps the above into the SPModerationInformation class):

SPListItem item = list.GetItemById(id);
item.ModerationInformation.Status = SPModerationStatusType.Approved;
item.Update();
Kit Menke
A: 

There are no options to directly Approve the items using the SPMenuField, what you can do is to write up a JavaScript call that will get the details of the Item and redirect to the default Approval Page.

By default SharePoint approval page will be of format

_layouts/approve.aspx?List={F723A0FD-9072-46C6-A4B6-BBB21538CB68}&ID=112

Refer to this link for more details on SPGridView

Kusek
Thanks for your answer...It takes me to correct approve.aspx with list item reference.Can you also help me to identify parameter required to pass for approving?Because wht I am looking for reducing no of click to approve list item.I guess process u mention takes 2 mouse clicks.
Troops