Hi all,
I have a asp.net page with a Telerik Radgrid control with dynamically generated columns.
I cannot disable the filtering function on a column, even using the AllowFiltering option set to false.
I send you the C# code that generates the columns. There are many columns that are not visible, but editable in the edit form. I don't know whether this can affect the filtering function.
The shown column "Key Control" displays the filter even if I have disabled it. The filter doesn't even work.
this.RadGrid_Processes.MasterTableView.EditMode = GridEditMode.EditForms;
this.RadGrid_Processes.Width = Unit.Pixel(855);
if (controlState.Equals(STATE_NAVIGATING) || controlState.Equals(STATE_LINKING))
{
this.pnlInstructions.Visible = true;
}
else
{
this.pnlInstructions.Visible = false;
this.lblInstructions.Text = "";
}
this.RadGrid_Processes.AllowFilteringByColumn = true;
this.RadGrid_Processes.MasterTableView.AllowFilteringByColumn = true;
boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Id";
boundColumn.HeaderText = "Id";
boundColumn.UniqueName = "Id";
boundColumn.Visible = false;
boundColumn.ReadOnly = true;
boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Code";
boundColumn.HeaderText = "Code";
boundColumn.SortExpression = "Code";
boundColumn.UniqueName = "Code";
boundColumn.HeaderStyle.Width = Unit.Pixel(90);
boundColumn.CurrentFilterValue = String.Empty;
boundColumn.ShowFilterIcon = false;
boundColumn.CurrentFilterFunction = GridKnownFunction.Contains;
boundColumn.AutoPostBackOnFilter = false;
boundColumn.FilterDelay = 1000;
boundColumn.FilterControlWidth = 80;
boundColumn.AllowFiltering = true;
boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Description";
boundColumn.HeaderText = "Description";
boundColumn.SortExpression = "Description";
boundColumn.UniqueName = "Description";
boundColumn.HeaderStyle.Width = Unit.Pixel(650);
boundColumn.CurrentFilterValue = String.Empty;
boundColumn.ShowFilterIcon = false;
boundColumn.CurrentFilterFunction = GridKnownFunction.Contains;
boundColumn.AutoPostBackOnFilter = false;
boundColumn.FilterDelay = 1000;
boundColumn.FilterControlWidth = 600;
boundColumn.AllowFiltering = true;
boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "TestMode";
boundColumn.HeaderText = "Test Mode";
boundColumn.SortExpression = "TestMode";
boundColumn.UniqueName = "TestMode";
boundColumn.Visible = false;
//boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlType";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlType.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Type";
dropDownColumn.UniqueName = "Control Type";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(90);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_KeyControl";
dropDownColumn.DataSourceID = this.LinqDataSource_YesNo.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Key Control";
dropDownColumn.UniqueName = "KeyControl";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(70);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
//dropDownColumn.Visible = true;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.ShowFilterIcon = false;
boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_Formalized";
dropDownColumn.DataSourceID = this.LinqDataSource_YesNo.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Formalized";
dropDownColumn.UniqueName = "Formalized";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(70);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlEvaluation";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlEvaluation.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Evaluation";
dropDownColumn.UniqueName = "ControlEvaluation";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(140);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlFrequency";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlFrequency.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Frequency";
dropDownColumn.UniqueName = "ControlFrequency";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(135);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;
this.RadGrid_Processes.MasterTableView.EditFormSettings.ColumnNumber = 2;
this.RadGrid_Processes.MasterTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.PushButton;
The telerik version I am currently using in Q3 2009 SP1. If it is a bug, is it solved in the newest version?
Thanks in advance.
Best regards,
Dario Zanelli
I have a asp.net page with a Telerik Radgrid control with dynamically generated columns.
I cannot disable the filtering function on a column, even using the AllowFiltering option set to false.
I send you the C# code that generates the columns. There are many columns that are not visible, but editable in the edit form. I don't know whether this can affect the filtering function.
The shown column "Key Control" displays the filter even if I have disabled it. The filter doesn't even work.
this.RadGrid_Processes.MasterTableView.EditMode = GridEditMode.EditForms;
this.RadGrid_Processes.Width = Unit.Pixel(855);
if (controlState.Equals(STATE_NAVIGATING) || controlState.Equals(STATE_LINKING))
{
this.pnlInstructions.Visible = true;
}
else
{
this.pnlInstructions.Visible = false;
this.lblInstructions.Text = "";
}
this.RadGrid_Processes.AllowFilteringByColumn = true;
this.RadGrid_Processes.MasterTableView.AllowFilteringByColumn = true;
boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Id";
boundColumn.HeaderText = "Id";
boundColumn.UniqueName = "Id";
boundColumn.Visible = false;
boundColumn.ReadOnly = true;
boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Code";
boundColumn.HeaderText = "Code";
boundColumn.SortExpression = "Code";
boundColumn.UniqueName = "Code";
boundColumn.HeaderStyle.Width = Unit.Pixel(90);
boundColumn.CurrentFilterValue = String.Empty;
boundColumn.ShowFilterIcon = false;
boundColumn.CurrentFilterFunction = GridKnownFunction.Contains;
boundColumn.AutoPostBackOnFilter = false;
boundColumn.FilterDelay = 1000;
boundColumn.FilterControlWidth = 80;
boundColumn.AllowFiltering = true;
boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Description";
boundColumn.HeaderText = "Description";
boundColumn.SortExpression = "Description";
boundColumn.UniqueName = "Description";
boundColumn.HeaderStyle.Width = Unit.Pixel(650);
boundColumn.CurrentFilterValue = String.Empty;
boundColumn.ShowFilterIcon = false;
boundColumn.CurrentFilterFunction = GridKnownFunction.Contains;
boundColumn.AutoPostBackOnFilter = false;
boundColumn.FilterDelay = 1000;
boundColumn.FilterControlWidth = 600;
boundColumn.AllowFiltering = true;
boundColumn = new GridBoundColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "TestMode";
boundColumn.HeaderText = "Test Mode";
boundColumn.SortExpression = "TestMode";
boundColumn.UniqueName = "TestMode";
boundColumn.Visible = false;
//boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlType";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlType.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Type";
dropDownColumn.UniqueName = "Control Type";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(90);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_KeyControl";
dropDownColumn.DataSourceID = this.LinqDataSource_YesNo.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Key Control";
dropDownColumn.UniqueName = "KeyControl";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(70);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
//dropDownColumn.Visible = true;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.ShowFilterIcon = false;
boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_Formalized";
dropDownColumn.DataSourceID = this.LinqDataSource_YesNo.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Formalized";
dropDownColumn.UniqueName = "Formalized";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(70);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlEvaluation";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlEvaluation.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Evaluation";
dropDownColumn.UniqueName = "ControlEvaluation";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(140);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;
dropDownColumn = new GridDropDownColumn();
this.RadGrid_Processes.MasterTableView.Columns.Add(dropDownColumn);
dropDownColumn.DataField = "FK_ControlFrequency";
dropDownColumn.DataSourceID = this.LinqDataSource_ControlFrequency.ID;
dropDownColumn.ListValueField = "Id";
dropDownColumn.ListTextField = "Description";
dropDownColumn.HeaderText = "Control Frequency";
dropDownColumn.UniqueName = "ControlFrequency";
dropDownColumn.HeaderStyle.Width = Unit.Pixel(135);
dropDownColumn.EnableEmptyListItem = true;
dropDownColumn.EmptyListItemText = "Select...";
dropDownColumn.Visible = false;
dropDownColumn.EditFormColumnIndex = 1;
//boundColumn.AllowFiltering = false;
this.RadGrid_Processes.MasterTableView.EditFormSettings.ColumnNumber = 2;
this.RadGrid_Processes.MasterTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.PushButton;
The telerik version I am currently using in Q3 2009 SP1. If it is a bug, is it solved in the newest version?
Thanks in advance.
Best regards,
Dario Zanelli