我收到以下錯誤工作gradrid頁腳總計「‘fitem’是‘變量’,而是使用類似‘法’」如何解決「x是一個變量,但在C#中使用像一個方法」的語法錯誤?
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridFooterItem)
{
GridFooterItem fitem = (e.Item as GridFooterItem);
string value1 = fitem("CALENDAR_DAYS_MTD").Text;
string value2 = fitem("WEEKENDS_MTD").Text;
string value3 = fitem("HOLIDAYS_MTD").Text;
string value4 = fitem("BUSINESS_DAYS_MTD").Text;
int footervalue1 = Convert.ToInt32(value1.Split(':')[1]);
int footervalue2 = Convert.ToInt32(value2.Split(':')[1]);
int footervalue3 = Convert.ToInt32(value3.Split(':')[1]);
int footervalue4 = Convert.ToInt32(value4.Split(':')[1]);
//to get the value only.
if (footervalue2 + footervalue3 + footervalue4 > footervalue1)
{
fitem("WEEKENDS_MTD").Style("color") = "Black";
fitem("HOLIDAYS_MTD").Style("color") = "Black";
fitem("BUSINESS_DAYS_MTD").Style("color") = "Black";
}
else
{
fitem("WEEKENDS_MTD").Style("color") = "Red";
fitem("HOLIDAYS_MTD").Style("color") = "Red";
fitem("BUSINESS_DAYS_MTD").Style("color") = "Red";
}
}
}
您可以至少用您正在使用的庫標記您的問題。看起來像Telerik什麼的。 –
歡迎來到Stack Overflow!請修改您的帖子以詢問實際問題。目前,您只是表示您收到了錯誤消息。你做了什麼來解決這個問題?告訴我們你想要知道什麼。 – Greg
我*刪除了* Telerik標籤。這與Telerik無關(假設'GridFooterItem'不是某種神奇的'Func'的子類,它不是''object x = new object(); x(「foo」)'會導致語法錯誤。) – 2012-08-22 21:02:01