I am tweaking the MyCustomFilteringColumn to filter a RadGrid. The data is populating the
comboboxes just fine, however, I cannot seem to add an "All" item at the top of each
combobox. Below is the code. Thanks for any help provided.
comboboxes just fine, however, I cannot seem to add an "All" item at the top of each
combobox. Below is the code. Thanks for any help provided.
| public class MyCustomFilteringColumnCS : GridBoundColumn | |
| { | |
| //RadGrid will call this method when it initializes the controls inside the filtering item cells | |
| protected override void SetupFilterControls(TableCell cell) | |
| { | |
| RadGrid RadGrid2 = (RadGrid)cell.Page.FindControl("RadGrid1"); | |
| base.SetupFilterControls(cell); | |
| cell.Controls.RemoveAt(0); | |
| RadComboBox combo = new RadComboBox(); | |
| combo.ID = ("ComboBox_" + this.UniqueName); | |
| combo.ShowToggleImage = false; | |
| combo.Skin = "Office2007"; | |
| combo.AutoPostBack = true; | |
| combo.Items.Add(new RadComboBoxItem("All", "%")); | |
| combo.DataSource = RadGrid2.DataSource; | |
| combo.DataTextField = this.UniqueName; | |
| combo.DataValueField = this.UniqueName; | |
| combo.Items.Insert(0, new RadComboBoxItem("All","%")); | |
| combo.DataBind(); | |
| combo.SelectedIndexChanged += this.list_SelectedIndexChanged; | |
| cell.Controls.AddAt(0, combo); | |
| cell.Controls.RemoveAt(1); | |
| } | |