Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Programatically modifying the property of a SPList field

  Asked By: Christina    Date: Aug 31    Category: Sharepoint    Views: 2499

I would like to programatically modify the property of a field of
SPList item Requiered = false.

I am not sure what I am missing?

SPGlobalAdmin globaladmin = new
[SPGlobalAdmin.RequestFromAdminPort] = true;

globaladmin.AllowUnsafeUpdates = true;

//SPWeb site_rating =
SPControl.GetContextWeb (Context);
SPSite my_site_add_user = new SPSite
Proposal/default.aspx") ;

SPWeb my_web = my_site_add_user.AllWebs[""];

my_web.AllowUnsafeUpdates = true;

SPList my_list_Vote = my_web.Lists["Vote and

// get the list item and change the property
of the list item
my_list_Vote.Fields["Please rate this
Proposal"].Required = false;


has anybody achieved in modifying the properties of a list



2 Answers Found

Answer #1    Answered By: Natasha Bennett     Answered On: Aug 31

I used the SPFiled class and it worked.........

Answer #2    Answered By: Angel Matthews     Answered On: Aug 31

please if any one can tell me please help me.

I am trying to change  some of the Properties values like for
ex:SELinkData,SEStatus of the document. I thought changing the Hashtable will
direclly make change but it's not working properlly.

will the SPList class help me for the same? If it will please tell me in detail
how to do with it.

Didn't find what you were looking for? Find more on Programatically modifying the property of a SPList field Or get search suggestion and latest updates.