Hello,
Am using Rad Grid with NeedDataSource for databinding, and also used paging and filter.
I have set filtering only for "Contains" without filter icon just by pressing enter
Please find my aspx below,
I added paging drop down values in Grid_ItemCreated Event,
Filtering works fine when the page size is 50 or less than that,
Now my problem is when I select page size as 100, filtering is not working for any of the columns.
Using the browser Mozilla Firefox,
.aspx
Am using Rad Grid with NeedDataSource for databinding, and also used paging and filter.
I have set filtering only for "Contains" without filter icon just by pressing enter
Please find my aspx below,
I added paging drop down values in Grid_ItemCreated Event,
Filtering works fine when the page size is 50 or less than that,
Now my problem is when I select page size as 100, filtering is not working for any of the columns.
Using the browser Mozilla Firefox,
protected void Managegridview_ItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridPagerItem) { var dropDown = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); var totalCount = ((GridPagerItem)e.Item).Paging.DataSourceCount; var sizes = new Dictionary<string, string>() { {"10", "10"}, {"20", "20"}, {"50", "50"} }; if (totalCount > 100) { sizes.Add("100", "100"); } if (totalCount > 200) { sizes.Add("200", "200"); } sizes.Add("All", totalCount.ToString()); dropDown.Items.Clear(); foreach (var size in sizes) { var cboItem = new RadComboBoxItem() { Text = size.Key, Value = size.Value }; cboItem.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); dropDown.Items.Add(cboItem); }
dropDown.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;- NullreferenceException in this line(object reference not set to instance of object)
} }.aspx
<telerik:RadGrid ID="Managegridview" runat="server" AllowPaging="true" AllowSorting='true' GridLines="None" OnNeedDataSource="Managegridview_NeedDataSource" OnItemDataBound="Managegridview_ItemDataBound" AllowFilteringByColumn="true" CellSpacing="0" Skin="WebBlue" OnItemCreated="Managegridview_ItemCreated" PageSize="50"> <GroupingSettings CaseSensitive="false"/> <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" ReorderColumnsOnClient="true" AllowColumnHide="true" ColumnsReorderMethod="Reorder"> <Resizing AllowColumnResize="true" AllowResizeToFit="true" ResizeGridOnColumnResize="false" /> <Selecting AllowRowSelect="true" /> </ClientSettings> <MasterTableView GridLines="None" Width="100%" AllowMultiColumnSorting="true"> <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> </RowIndicatorColumn> <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"> </ExpandCollapseColumn> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> <PagerStyle PageSizeControlType="RadComboBox" Mode="NextPrevAndNumeric" EnableSEOPaging="True" AlwaysVisible="true"></PagerStyle> </MasterTableView> <HeaderStyle Width="100px" /><%--<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>--%> <FilterMenu EnableImageSprites="False"> </FilterMenu> </telerik:RadGrid>