0
我正在處理應用程序,我想通過SharePoint中的某些按鈕字段更改listitem。編譯查詢時,獨自一人我不斷收到一個錯誤,更改複選框listitem bij單擊按鈕
我想,當我按下按鈕「hidekfinal_click」,在該領域的複選框「禁用」將checkt
當我調試的代碼,我看到它會收集無一不從我所制定的查詢
誰能幫助我,我的代碼是:
BTN =新按鈕(); btn.Click + = new EventHandler(this.hidekfinal_click);
btn.Text = "1verberg kwart finale";
btn.CssClass = "ms-ButtonHeightWidth";
btn.Width = Unit.Pixel(100);
cell.Controls.Add(btn);
row.Cells.Add(cell);
無效hidekfinal_click(對象發件人,EventArgs的){
SPWeb web = SPContext.Current.Site.RootWeb;
SPList list = web.Lists["wedstrijden"];
SPQuery oQuery = new SPQuery();
oQuery.Query = ("<Where><Eq><FieldRef Name='Disabled' /></Value></Eq></Where>");
SPListItemCollection collListItems = list.GetItems(oQuery);
foreach (SPListItem item in collListItems)
{
item["Disabled"] = true;
item.Update();
bool enabled = true;
if (item["Disabled"] != null)
enabled = !(bool)item["Disabled"];
item.Update();
}
}