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

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"];
share|improve this question

1 Answer 1

up vote 2 down vote accepted

I think it's actually:

listitem["columnname"]

in SharePoint 2007/WSS 3.0

share|improve this answer
    
the one I added does work as well :) –  Muhammad Raja Jul 30 '12 at 13:53
    
I meant to say "as well as". Thanks! –  Mike Jul 30 '12 at 14:02

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.