Completed
Last Updated: 21 Nov 2014 17:39 by Joao
ADMIN
Dimitar
Created on: 17 Nov 2014 16:07
Category: GridView
Type: Bug Report
1
FIX. RadGridView - when paging is used the excel like filter popup does not contain all distinct values.
To reproduce:
- Add several rows to a grid where the paging is enabled (make sure that last row has unique values)
- Use the excel like filtering in the first page, notice that the last value is missing.

Workaround:
void radGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
{
    RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup;
    if (popup != null)
    {
        foreach (GridViewRowInfo row in radGridView1.Rows)
        {
            var value = row.Cells[e.Column.Name].Value;
            if (!(popup.MenuTreeElement.DistinctListValues.Contains(value)))
            {
                popup.MenuTreeElement.DistinctListValues.Add(value.ToString(), value.ToString()) ;
            }
        }
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
2 comments
Joao
Posted on: 21 Nov 2014 17:39
Correction: 
...
foreach (GridViewRowInfo row in ((GridHeaderCellElement)sender).GridControl.Rows)
{
...
Joao
Posted on: 21 Nov 2014 17:28
You should use sender object and not radGridView1 directly to make this fix dynamic to every calling grid ;) 

void fixradgridview_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
{
RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup;
if (popup != null)
{
foreach (GridViewRowInfo row in radGridView1.Rows)
{
var value = row.Cells[e.Column.Name].Value;
if (!(popup.MenuTreeElement.DistinctListValues.Contains(value)))
{
popup.MenuTreeElement.DistinctListValues.Add(value.ToString(), value.ToString()) ;
}
}
}
}