Hi,
I have a WebDataGrid 10.2 with paging enabled and I want to display something like that: "Row 10 to 20 of 500 rows".
I tried to do it in code behind but I do not get a postback on PageIndexChanged. Additionally I don't know where to get the total row count. In the moment I get this info from data source but I want to display the "filtered" row count. That means if someone applies a filter I want to display the rows which are not filtered out.
Any ideas?
Let me know if you have any questions wiht this matter.
Thanks.
Hallo Radoslav Minchev,
sorry for late reply. Your solutions works good with one exception: If I add the paging behavior again, the settings for paging are gone. Even if I copy the settings again, paging uses default settings.
protected void storesView_DataFiltered(object sender, FilteredEventArgs e) { FilteredRowsCount = storesView.Rows.Count; storesView.GridResponse.AdditionalProperties["filteredRowCount"] = FilteredRowsCount; storesView.GridResponse.AdditionalProperties["totalRowCount"] = TotalRowsCount; storesView.Behaviors.CreateBehavior<Paging>(); storesView.Behaviors.Paging.PageSize = _oldPagingBehavior.PageSize; storesView.Behaviors.Paging.FirstPageText = _oldPagingBehavior.FirstPageText; storesView.Behaviors.Paging.LastPageText = _oldPagingBehavior.LastPageText; storesView.Behaviors.Paging.QuickPages = _oldPagingBehavior.QuickPages; storesView.Behaviors.Paging.PagerMode = _oldPagingBehavior.PagerMode; }
Hi stegerwald,
It appears to have a more elegant solution than that was previously proposed. So, take a look at the code below, as you can see it is not required to create the Paging again anymore. Now you should be able to persists all your settings
void Filtering_DataFiltering(object sender, Infragistics.Web.UI.GridControls.FilteringEventArgs e) { //Disable Paging behavior ((WebDataGrid)sender).Behaviors.Paging.Enabled = false; } //This property will be transferred to the client int filteredRowsCount = 0; void Filtering_DataFiltered(object sender, Infragistics.Web.UI.GridControls.FilteredEventArgs e) { //Once the filtering has been done we can get the real rows count filteredRowsCount = ((WebDataGrid)sender).Rows.Count; ((WebDataGrid)sender).GridResponse.AdditionalProperties.Add("rowCount", filteredRowsCount); // Enable Paging behavior ((WebDataGrid)sender).Behaviors.Paging.Enabled = true; }
Hope this helps.
Thanks. This solution works perfect
Hello Shym,
The shown approach here can be used for versions of the toolset prior to 10.3, because in 10.3 there is a feature set that will allow you to use "Footer summaries" with little configuration.
Hi
I want to update column total after filtering in footer. Is there any way to do this?