使用逗号分隔值过滤后,Telerik radgrid没有数据显示

时间:2016-12-21 14:12:08

标签: c# telerik-grid

用逗号分隔值过滤后,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;
}
}
}

我是否需要添加数据绑定或重新绑定

0 个答案:

没有答案