2

I added a new column to Sharepoint Custom list which is boolean type, now each time I upload a item to list, it displays that column to check or leave it blank, by default its checked, I wanna access this property programmatically but can't remember how to do it.

public void Documents(string URL)
{
    using (SPSite site = new SPSite(URL))
    using (SPWeb web = site.OpenWeb())
    {
        SPList list = web.Lists["Mes"];

        if (list.ItemCount != 0)
        {
            foreach (SPListItem listItem in list.Items)
            {
                if(listItem.)
            }
        }
    }
}

Edited

I guess using this statement

listItem.Properties["columnName"];

1 Answer 1

2

I think it's actually:

listitem["columnname"]

in SharePoint 2007/WSS 3.0

2
  • the one I added does work as well :) Jul 30, 2012 at 13:53
  • I meant to say "as well as". Thanks!
    – Mike
    Jul 30, 2012 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.