Unplanned
Last Updated: 05 Mar 2024 14:11 by Stenly
Stenly
Created on: 05 Mar 2024 14:11
Category: VirtualGrid
Type: Bug Report
0
VirtualGrid: FilterColumn method does not position the filtering popup on the passed column index when it is opened

The FilterColumn method does not position the filtering popup on the passed column index when it is opened.

A workaround to this behavior would be to manually position the filtering popup using the following approach:

this.virtualGrid.FilterColumn(2);

var virtualizingCanvasBase = this.virtualGrid.ChildrenOfType<VirtualizingCanvasBase>().FirstOrDefault();

var columnsRenderInfoInfo = virtualizingCanvasBase.GetType().GetProperty("ColumnsRenderInfo", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

var columnsRenderInfo = columnsRenderInfoInfo.GetValue(virtualizingCanvasBase);

var offsetMethodInfo = columnsRenderInfo.GetType().GetMethod("OffsetFromIndex");

var filteringPopupPropertyInfo = this.virtualGrid.GetType().GetProperty("FilteringPopup", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

Popup filteringPopup = (Popup)filteringPopupPropertyInfo.GetValue(this.virtualGrid);

filteringPopup.HorizontalOffset = (double)offsetMethodInfo.Invoke(columnsRenderInfo, new object[1] { 2 });

The FilterColumn method should be called, in order for the filtering Popup to be created.

0 comments