Hi,
I need to have FilterRow to filter some columns. But I need also to filter two columns by checkboxes out of the grid (toogle checkboxes add / remove filter descriptor for this columns). That's why I have to hide Filter Box for this two columns. I did it by ViewCellFormatting event:
void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
GridFilterCellElement filterCell = e.CellElement as GridFilterCellElement;
if (e.RowIndex == -1 && filterCell != null && filterCell.ColumnInfo.Name == "COLUMN_NAME")
{
filterCell.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
}
}
It works fine, but, as mentioned in documentation, significantly slow down rendering - especially for grid with 20 columns / 100000 rows with sorting.
My question: is there any other solution?
I tried:
1) Attach / Detach this event - I tried to realize when cell with this filter box is redrawn ( because then by default it is again draw with filter box visible ). It speed up interacting with grid, but still there are situation when I see this filter box visible ( minimize Window, ColumnShooser Activate / Deactivate, DataBind, Click on filterRow ...) . Is it good way? Can I found and serve all situation in this way ?
2) Use EditorRequired / Editor Initialized instead ViewCellFormatting. But It helps only not to display filter text box - filter description and button of dropdown list still are visible.
void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
{
if (radGridView1.CurrentCell.ColumnInfo.Name == "COLUMN_NAME")
{
e.Editor = null;
e.EditorType = null
}
}
3) I was think about override GridViewTextBoxColumn - to find properties responsible for displaing filterbox but I can find such thing
Could you give me some solution?
Thanks in advance!
I need to have FilterRow to filter some columns. But I need also to filter two columns by checkboxes out of the grid (toogle checkboxes add / remove filter descriptor for this columns). That's why I have to hide Filter Box for this two columns. I did it by ViewCellFormatting event:
void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
GridFilterCellElement filterCell = e.CellElement as GridFilterCellElement;
if (e.RowIndex == -1 && filterCell != null && filterCell.ColumnInfo.Name == "COLUMN_NAME")
{
filterCell.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
}
}
It works fine, but, as mentioned in documentation, significantly slow down rendering - especially for grid with 20 columns / 100000 rows with sorting.
My question: is there any other solution?
I tried:
1) Attach / Detach this event - I tried to realize when cell with this filter box is redrawn ( because then by default it is again draw with filter box visible ). It speed up interacting with grid, but still there are situation when I see this filter box visible ( minimize Window, ColumnShooser Activate / Deactivate, DataBind, Click on filterRow ...) . Is it good way? Can I found and serve all situation in this way ?
2) Use EditorRequired / Editor Initialized instead ViewCellFormatting. But It helps only not to display filter text box - filter description and button of dropdown list still are visible.
void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
{
if (radGridView1.CurrentCell.ColumnInfo.Name == "COLUMN_NAME")
{
e.Editor = null;
e.EditorType = null
}
}
3) I was think about override GridViewTextBoxColumn - to find properties responsible for displaing filterbox but I can find such thing
Could you give me some solution?
Thanks in advance!