Clear particular column values in a list using SPUpdateMultipleListItems

Dec 26, 2011 at 6:36 PM

Hi,

I had a data sheet view in my custom list. I'm planning put a button in that form and once I click on the button then I need to remove one of the column values in that list without asking for any specific condition. I mean to say, it has to take list count and replace the specified column with blank or delete the values which is there previously to that particular column.... 

Below one is my Programmatic approach.. (But I need this one with Client side..)

SPList myList = myWeb.Lists["MyList"];

for (int i == 0; i < myList.Count; i++)
{
SPListItem myItem = myList.Items[i];
myItem["Value"] = "Some value or blank";
myItem.Update();
}

Please suggest me is it possible through Client side using our SPServices....

Thanks in advance !..

-

Rao

Coordinator
Dec 26, 2011 at 6:39 PM
DataSheet view is an entirely different animal. It's an ActiveX control and you can't get "inside" it.

I'd suggest building your own custom form with a DVWP instead. You can display multiple rows and have full control over the display and behavior.

M.
Dec 26, 2011 at 6:50 PM

Thanks for the Quick response sympmarc.

With my curiosity I'm asking this Question.. Is it possible if I had a normal standard view?

Just take an example, in Allitems.aspx page If I wrote my code in document.ready function to this task (with SPServices).. Is it possible ?

Please suggest me...

-

Rao.

Coordinator
Dec 26, 2011 at 6:53 PM
Certainly. You can use SPServices to do the updates, but you'll have to write your logic in JavaScript/jQuery, of course.

M.
Dec 26, 2011 at 7:04 PM

You mean to say, catch the Column (in our case Col_3) which is having some value and call SPService to change the column value to Blank. Is it correct ?

If so, then I have worry if I have more values... :(    Correct ?

-

Rao.

Coordinator
Dec 26, 2011 at 7:08 PM
You've lost me. SPServices is more of a toolset. You'll need to write your own logic for the functionality you want.

M.
Dec 26, 2011 at 7:34 PM

Thanks for your suggestion sympmarc...

-

Rao