2014-01-28 24 views
0

我有一個顯示用戶列表的Telerik網格。在我的數據庫中,我有一個確定用戶是否優先的位域。我有一個問題顯示它在Telerik窗口中的複選標記。它始終是一個下降。我能夠將它顯示爲文本框;但是,此選項不允許用戶根據優先級手動分組。我嘗試的第二種方法失敗了,並且說'CS1660:不能將lambda表達式轉換爲'string'類型,因爲它不是委託類型'請參閱下面的示例代碼。將位值顯示爲Telerik Grid中的複選框

//the below example works fine, but it won't allow the user to sort. The automatic sort option is not available since it is an template. 
@* columns.Template(
       @<text> 
        <input type="checkbox" name="prioprity" id="chkPriority" @(item.Users.PriorityUser == true ? "checked" : "unchecked") disabled="disabled"/> 
       </text>) 
      .Width(60) 
      .Title("Priority User");*@ 

//The below example should allow sorting. However, it throwing an exception 'CS1660: Cannot convert lambda expression to type 'string' because it is not a delegate type' 

columns.Bound(x => x.Users.PriorityUser).Width(50) 
      .ClientTemplate(
      @<text> 
       <input type='checkbox' name='prioprity' id='chkPriority' @(item.User.PriorityUser == true ? "checked" : "unchecked") disabled='disabled'/> 
      </text> 
      ).Title("Priority User") 

//This attempt displays the data, but it is showing as a dropdown. 

columns.Bound(x => x.Users.PriorityUser).Width(50) 
       .ClientTemplate("<input type='checkbox' name='prioprity' id='chkPriority'@(item.Users.PriorityUser == true ? 'checked' : 'unchecked') disabled='disabled'/>" 
       ).Title("Priority User"); 

任何幫助或建議將不勝感激。

回答

0

問題已解決。 columns.Bound(x => x.Users.PriorityUser).Width(50)在我刪除.edmx文件並重新創建後工作得很好。以前,我只是從數據庫進行更新以更新.edmx文件。