Completed
Last Updated: 03 Jan 2018 06:38 by ADMIN
ADMIN
Hristo
Created on: 23 May 2017 06:32
Category: GridView
Type: Bug Report
2
FIX. RadGridView - the RadDateFilterPopup needs to be scaled to a bigger size on systems with high DPI
How to reproduce:
Create a grid with enabled filtering and open the excel-like filter popup of a DateTime column.

Workaround: 
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();

        this.radGridView1.EnableFiltering = true;
        this.radGridView1.ShowFilteringRow = true;
        this.radGridView1.ShowHeaderCellButtons = true;
        this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

        this.radGridView1.FilterPopupInitialized += RadGridView1_FilterPopupInitialized;
    }

    private void RadGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
    {
        RadDateFilterPopup popup = e.FilterPopup as RadDateFilterPopup;
        if (popup != null && popup.Width < 300)
        {
            popup.Width += 100;
            popup.Height += 100;
        }
    }

    private object GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Id", typeof(int));
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Bool", typeof(bool));
        dt.Columns.Add("Date", typeof(DateTime));

        for (int i = 0; i < 100; i++)
        {
            dt.Rows.Add(i, "Name " + i, i % 2 == 0, DateTime.Now.AddDays(1));
        }

        return dt;
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments