Unplanned
Last Updated: 02 Jul 2024 13:58 by ADMIN
lucas
Created on: 02 Jul 2024 13:41
Category: VirtualGrid
Type: Bug Report
0
RadVirtualGrid: Filter cell editor does not show the filter value when the filter cell goes outside of the view

In this case, we filter a column by typing in a filter cell. If we have a horizontal scroll move the filter cell out of the view and then go back to it and try to change the value of the filter cell, the editor has an empty string.

1 comment
ADMIN
Dinko | Tech Support Engineer
Posted on: 02 Jul 2024 13:58

Hi Lucas,

Thank you for reporting this. We could workaround this by manually setting the Value property of the editor.

string filterCellValue = "";
private void RadVirtualGrid1_EditorRequired(object sender, VirtualGridEditorRequiredEventArgs e)
{
    if (e.Editor is VirtualGridTextBoxEditor textBoxEditor)
    {

        var virtualGridFilterRowElement = this.radVirtualGrid1.TableElement.ViewElement.TopPinnedRows.Children[2];
        VirtualGridFilterCellElement filterCellElement = virtualGridFilterRowElement.Children[2].Children.FirstOrDefault(x  => (x as  VirtualGridFilterCellElement).ColumnIndex == e.ColumnIndex) as VirtualGridFilterCellElement;
        if (filterCellElement != null)
        {
            filterCellValue = filterCellElement.Text;
        }
    }
}

private void RadVirtualGrid1_CellEditorInitialized(object sender, VirtualGridCellEditorInitializedEventArgs e)
{
    var textBoxEditor = e.ActiveEditor as VirtualGridTextBoxEditor;
       
    if (filterCellValue != "")
    {
        textBoxEditor.Value = filterCellValue;
    }  
}

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.