To reproduce:
- Create load on demand hierarchy.
- Open the excel filter popup.
- The RowSourceNeeded event fires for all rows.
Workaround:
public class MyGridHeaderCellElement : GridHeaderCellElement
{
public MyGridHeaderCellElement(GridViewDataColumn col, GridRowElement row) : base(col, row)
{
}
protected override Type ThemeEffectiveType
{
get { return typeof(GridHeaderCellElement); }
}
protected override IGridFilterPopup CreateFilterPopup()
{
this.GridControl.Tag = "FileterInitializing";
return base.CreateFilterPopup();
}
}
// in the main forms you cab skip the event code execution while the popup is initialized
private void RadGridView1_FilterPopupInitialized(object sender, FilterPopupInitializedEventArgs e)
{
this.radGridView1.Tag = null;
}
private void RadGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
{
if (object.ReferenceEquals(e.CellType, typeof(GridHeaderCellElement)))
{
e.CellType = typeof(MyGridHeaderCellElement);
}
}
void radGridView1_RowSourceNeeded(object sender, GridViewRowSourceNeededEventArgs e)
{
if (radGridView1.Tag != null && radGridView1.Tag == "FileterInitializing")
{
return;
}
//other code
}