Hello,
I am using an Infragistics grid (8.1.20081.1000, C#, VS2008, .Net3.5) and I save the layout in a database when the user exits the form where the grid is located. When the user tries to start the form again, i load the layout from the database. This works fine except when I have a dropdownlist column with a filter on it.
The filter works fine when when I am working on the grid. i.e. the filter is applied correctly on the grid data. But when I save the layout (with the filter) and load it again, the filters are not applied on the grid data even though the filter condition is correctly set when you try to view it. Once I click OK on the filter window, it works again.
This happens only when I have with a dropdownlist column
Hope this is Clear. Any ideas ?
Thanks
Satish
Hi Satish,
I'm a little unclear on what you are describing. Are you referring to filtering applied to the grid? Or filtering applied to the dropdown list within the grid?
Filtering in the grid should be saved and loaded in the layout.
Filtered in the DropDown would have to be saved separately along with the layout of the UltraDropDown control.
You might also want to make sure that you have the latest service release. I think there may be a bug in the release version regarding the filtering not being initially applied when you load a layout that is already fixed.
Hi Mike,
I have two Columns in the grid. The first Column is bound to a drop downlist as shown below. The grid has say 5 rows. I select the filter on the header of the first column. It filters properly. It returns two rows. I save the layout. Load it back again. The grid does not show 2 rows. It shows no rows.
Instead of a dropdownlist, if i use the ValueList (which i have commented below), it works fine.
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e) { ultraGrid1.DisplayLayout.Bands[0].Columns[0].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; //Infragistics.Win.ValueList PhList1 = new Infragistics.Win.ValueList(); //PhList1.ValueListItems.Add("0", "OK"); //PhList1.ValueListItems.Add("1", "Cancel"); //PhList1.ValueListItems.Add("2", "Reset"); DataTable dt = new DataTable(); dt.Columns.Add("key"); dt.Columns.Add("val"); DataRow dr; dr = dt.NewRow(); dr["key"] = 0; dr["val"] = "OK"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["key"] = 1; dr["val"] = "Cancel"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["key"] = 2; dr["val"] = "Reset"; dt.Rows.Add(dr); UltraDropDown ddl = new UltraDropDown(); ddl.SetDataBinding(dt, null); ddl.ValueMember = dt.Columns[0].ColumnName; ddl.DisplayMember = dt.Columns[1].ColumnName; //ddl.DisplayLayout.Bands[0].Columns[0].Hidden = true; //ddl.DisplayLayout.Bands[0].ColHeadersVisible = false; //ddl.DisplayLayout.Override.BorderStyleRow = UIElementBorderStyle.None; //ddl.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.None; //ultraGrid1.DisplayLayout.Bands[0].Columns[0].ValueList = PhList1; ultraGrid1.DisplayLayout.Bands[0].Columns[0].ValueList = ddl; e.Layout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.True; e.Layout.ViewStyleBand = ViewStyleBand.OutlookGroupBy; }