Posted 22 December 2019, 9:59 pm EST - Updated 4 October 2022, 12:00 am EST
In my C1DataGrid, I want to make it filter icon as always visible is there any possible way to achieve ?
Look like this
Forums Home / ComponentOne / WPF Edition
Posted by: jagdeeshk on 22 December 2019, 9:59 pm EST
Posted 22 December 2019, 9:59 pm EST - Updated 4 October 2022, 12:00 am EST
In my C1DataGrid, I want to make it filter icon as always visible is there any possible way to achieve ?
Look like this
Posted 23 December 2019, 9:24 pm EST
Hello,
You can use the following lines of code to achieve your requirement:
public static IEnumerable<T> FindVisualChildren<T>(DependencyObject depObj) where T : DependencyObject
{
if (depObj != null)
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++)
{
DependencyObject child = VisualTreeHelper.GetChild(depObj, i);
if (child != null && child is T)
{
yield return (T)child;
}
foreach (T childOfChild in FindVisualChildren<T>(child))
{
yield return childOfChild;
}
}
}
}
private void Window_ContentRendered(object sender, EventArgs e)
{
foreach (C1.WPF.C1DropDown item in FindVisualChildren<C1.WPF.C1DropDown>(gcgrid))
{
item.Visibility = Visibility;
}
}
private void Gcgrid_MouseMove(object sender, MouseEventArgs e)
{
foreach (C1.WPF.C1DropDown item in FindVisualChildren<C1.WPF.C1DropDown>(gcgrid))
{
item.Visibility = Visibility;
}
}
Thanks,
Mohit