Grade Formulas in SharePoint
using (SPSite siteCol = new SPSite("http://server/sites/Contoso”))
{
using (SPWeb web = siteCol.RootWeb)
{
SPList list = web.GetList("/sites/Contoso/Lists/Books");
{
using (SPWeb web = siteCol.RootWeb)
{
SPList list = web.GetList("/sites/Contoso/Lists/Books");
SPListItem item = list.GetItemByIdSelectedFields(3, "calculated column Name");
String myValue = (String)item["calculated column Name"];
if(myValue>91, "A1", if(myValue>82, "A2", if(myValue>74, "B1", if(myValue>66, "B2", if(myValue>58, "C1",if(myValue>50, "C2",if(myValue>42, "D1",if(myValue>34, "D1","F"))))))))
}
}
if(myValue>91, "A1", if(myValue>82, "A2", if(myValue>74, "B1", if(myValue>66, "B2", if(myValue>58, "C1",if(myValue>50, "C2",if(myValue>42, "D1",if(myValue>34, "D1","F"))))))))
}
}