[英]Ext.net How to check row GridPanel with CheckboxSelectionModel
我有一個GridView
<ext:GridPanel ID="GridPanelRoles" runat="server" StoreID="StoreUserTypes" ForceFit="true"
Title="">
<View>
<ext:GridView ID="GridViewRoles" runat="server" LoadMask="false" />
</View>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionModelMemTypes" runat="server" />
</SelectionModel>
<ColumnModel>
<Columns>
<ext:Column ID="col_type_desc" runat="server" DataIndex="description" Text="" />
</Columns>
</ColumnModel>
</ext:GridPanel>
和一家商店
<ext:Store ID="StoreUserTypes" runat="server">
<Reader>
<ext:JsonReader IDProperty="id" />
</Reader>
<Model>
<ext:Model ID="ModelUserTypes" runat="server" IDProperty="id">
<Fields>
<ext:ModelField Name="id" />
<ext:ModelField Name="description" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
我想檢查第二行(通過c#)填充網格后的某些行,具體取決於它們的ID(ID未出現在網格上)。 我努力了
CheckboxSelectionModel sm = GridPanelRoles.GetSelectionModel() as CheckboxSelectionModel;
sm.Select(id);
但這不起作用。
我將不勝感激。
嘗試這個
sm.SelectedRows.Add(new SelectedRow(id));
注意:確保變量id
為字符串類型
在3.3版中,您需要添加
GridPanelRoles.Render();
要么
sm.UpdateSelection();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.