用逗号分隔值过滤后,radgrid显示为空,但是datasource中有值。如果在过滤器中尝试使用单个值,则可以正常工作
<telerik:RadGrid ID="gvTask" runat="server" AutoGenerateColumns="False" CellSpacing="0" ShowStatusBar="false" Width="936px" Height="364px" Visible="true" AllowFilteringByColumn="true" AllowSorting="true" OnItemDataBound="gvTask_ItemDataBound" OnInit="gvTask_Init"
OnItemCommand="gvTask_ItemCommand" GridLines="None" OnSortCommand="gvTask_SortCommand" AllowPaging="true" AllowCustomPaging="true" OnPageIndexChanged="gvTask_PageIndexChanged" OnNeedDataSource="gvTask_NeedDataSource" EnableLinqExpressions="false" PageSize="50"
AllowMultiRowSelection="true" OnItemCreated="gvTask_ItemCreated" Skin="Office2010Silver" AllowNaturalSort="false">
<ClientSettings>
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
<ClientEvents OnFilterMenuShowing="OnFilterShowing" OnRowCreated="RadGrid1_RowCreated" OnRowSelected="RadGrid1_RowSelected" OnRowDeselected="RadGrid1_RowDeselected" OnGridCreated="GridCreated" OnRowSelecting="RowSelecting" OnRowDeselecting="RowSelecting"
/>
<Selecting AllowRowSelect="true" />
</ClientSettings>
<GroupingSettings CaseSensitive="false" />
<MasterTableView GridLines="Both" Width="100%" HierarchyLoadMode="Client" AllowFilteringByColumn="true" DataKeyNames="TaskID,DocTypeId" AllowSorting="true" ClientDataKeyNames="TaskID">
<ItemStyle Wrap="True" />
<FilterItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Center" Font-Bold="true" Wrap="true" />
<SortExpressions>
<telerik:GridSortExpression FieldName="InternalId" SortOrder="Ascending" />
</SortExpressions>
<Columns>
<telerik:GridBoundColumn DataField="AssociateID" HeaderText="Emp ID" UniqueName="AssociateID" ShowFilterIcon="true" FilterControlWidth="34px" SortExpression="AssociateID" AutoPostBackOnFilter="false" DataType="System.String">
<ItemStyle Width="65px" />
<HeaderStyle Width="65px" />
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<SortingSettings EnableSkinSortStyles="false"></SortingSettings>
<FilterMenu EnableImageSprites="False"></FilterMenu>
<PagerStyle AlwaysVisible="true" Position="Bottom" />
</telerik:RadGrid>
protected void gvTask_ItemCommand(object sender, GridCommandEventArgs e)
{
try
{
if (e.CommandName == RadGrid.FilterCommandName)
{
PagedListResult<List<TaskSearchBO>> taskList = ListTickets(pageIndex, pageCount, sortExpression, sortDirection, filtrCriteria);
gvTask.DataSource = taskList.Result;
gvTask.PageSize = pageCount;
gvTask.VirtualItemCount = taskList.TotalRowCount;
}
}
}
我是否需要添加数据绑定或重新绑定