FilterTemplates breaking RadzenGrid inline editing

I am currently having difficulty with using FilterTemplates in RadzenGridColumns when using a RadzenGrid inline editing. The presence of a FilterTemplate for any column seems to cause a behavior where the filters are cleared when the grid's EditRow function is called. The following scenario seems to reliably reproduce this behavior:

  1. Create a grid with pagination against a data set large enough to generate several pages on rendering. Each row should have an edit button present which will call the grid's EditRow function.
  2. The data set should have one (or more) columns containing enumerated data requiring a drop down box for a filter.
  3. Implement this drop down in a FilterTemplate.
  4. Modify the Data property of the data grid to account for this filter template with the typical Where pattern as demonstrated on the custom filter demonstration.
  5. Filter the grid by the data of a column such that the row count is reduced, but still several pages of data are still available. Note that this does not have to be filtered on the column having the FilterTemplate, it can be any column.
  6. Page forward one or more pages, such that the page visible is not the first page.
  7. Click the edit button in a row to edit.
  8. What will happen at this point is that any filters that have been applied will be cleared. Because of this, the grid will be re-rendered and it is very likely that the row to be edited has been moved to another page. If you note the row and page to the row you will also find that it is still in edit mode.

What seems to be happening is that when you define the Data as being a data set that can be dynamically changed by filters (i.e. through the Where pattern), rather than having it defined as a static data set upon which the built-in filtration operates(such as a single property in the demo), calling EditRow for some reason causes a re-render of the grid, but part of this re-render process seems to be the clearing of all filters.

When this happens, the page of the row selected can change, which is really an unacceptable behavior because now the user has to search for the row on whatever page it now resides! It seems to me that the filters should not be cleared unless the user clears them manually, or the page developer clears them programmatically.

I have tested this out in both Simple and Advanced filter modes and it occurs in both. There appears to be no way to correct this behavior other than removing the FilterTemplates from columns and restoring the Data property in the grid to a static data set, which isn't always possible depending on the desired display of the data.

Can someone please let me know if there are plans to fix this behavior?

Perhaps am I using FilterTemplates incorrectly (missing a step, possibly)? Any assistance would be appreciated as I am otherwise extremely happy with the RadzenGrid functionality.

Thanks!

Our online demo has filtering enabled and it does not clear during inline editing. I don't know what you have done as you didn't provide any code.

Your online demo does not use a FilterTemplate for any column, so it does not match the scenario that I have described. Please examine the scenario that I have described. If you require a code sample to take a deeper look at this issue, I will endeavor to provide you with one, however, I will not be able to provide one for several days.

Thanks.

The FilterTemplate does not affect the inline editing in any way.

We troubleshoot customer projects only as part of the dedicated support plans. If you own a Radzen subscription you can send us your project to info@radzen.com

Perhaps, but it appears that if the Data property is set to a function (as is necessary for FilterTemplates to do their filtration, i.e. with a Where method) which can change the number of displayed rows, it absolutely can.

That's fine, but that's not what I'm asking for. I've already done the necessary troubleshooting and I believe I've located a bug in the Radzen code. As such, I am attempting to provide you with a bug report such that you can investigate this on your side and decide whether/how to address it. To whit, I am presenting you with a modification to your own demo code which demonstrates the issue. I have uploaded a zip file containing a modification to the DataGridInLineEditPage.razor demonstration page which places in a FilterTemplate and modifies the Data source to account for the drop down that the FilterTemplate implements. Use the following method to produce the bug behavior.

  1. In the Ship Name column, filter by the word 'Around'. This should give the list of orders having a Ship Name of 'Around The Horn'. Please note: do NOT filter by Company Name, this will not reproduce the issue.

  2. Select any row on any page of the results. Make a note of the Order ID. Click the edit button for that row.

  3. What will immediately be visible is that the filter on the Ship Name column will be reset and the grid will be re-rendered without any filtration applied. This will cause the row which you selected for edit to be rendered on a page that is not currently visible. This is the bug behavior: the row selected for edit should remain visible, but because the filters are being cleared in this scenario, the row is now on a different page.

  4. The row IS, however, still in edit mode. Using the Order ID that you made a note of in step 2, either filter by the Order ID in question or page forward to the correct page on which that Order ID resides and you will note that row is currently in edit mode.

  5. If you found the row by filtering by Order ID, and you click the cancel button to end edit mode without applying the changes, again the filters clear.

Note that this filter clearing behavior does NOT occur UNLESS the Data property of the grid must be modified in the manner that is indicated by FilterTemplate demonstration example. If standard filtration is used for all columns, the filters are retained for edit and a re-render does not occur, ensuring the row will remain visible.

If you require any further information regarding this behavior, please do not hesitate to ask.

DataGridInLineEditPage.zip (1.6 KB)

Using an expression for the Data property will reset the DataGrid state every time the expression changes. We will update our filter template demo to use a different approach.