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; }
I tried version 9.1 and it works fine there. But I cant use version 9.1 as this grid is in a lot of forms. You mentioned a service release. How do I get it ? and How do I apply it. Do I have to unload all my grids ? What's the process?
Satish,
In order to download the latest service release for NetAdvantage 8.1, go to www.infragistics.com and navigate to your "My Keys and Downloads" page. You will need to log in to get to this page. Once logged in, go to the NetAdvantage tab, which will contain a list of all the products you have registered and their keys. Find NetAdvantage for .NET 2008 Vol. 1 and click it; you will see group boxes with links appear below the tab. Once you see the group boxes, scroll down and find the "Hot Fixes" group box. This group box will contain links to the latest service releases for NetAdvantage for .Net 8.1. Click on the appropriate link (ex: if you have Windows Forms only, click "NetAdvantage for Windows Forms 2008 Vol. 1 Service Release") to download the files.
Once you have downloaded the zip file, you will need to extract the files and then run the .msp file, which will install the latest service release onto your machine. Once that is complete, you will need to run the Project Upgrade Utility in order to ensure that your application is using the correct version of the Infragistics assemblies. For detailed instructions on how to use the Project Upgrade Utility, please see this article in our online documentation.
You will also need to run the Toolbox Utility in order to get the correct version of the NetAdvantage controls into your Visual Studio toolbox tabs. For detailed instructions on how to run the Toolbox Utility, please see this article in our online documentation.
Once you have downloaded & installed the latest service release and also upgraded your project, you should be all set.
~Kim~
Hi Kim,
Thanks for the detailed reply. Was quite useful. I did upgrade to the newer version. But I have one issue. The Layoust do not load. When I try to load layout using the following code,
MemoryStream stream = new MemoryStream(LayoutArray);grid.DisplayLayout.Load(stream, PropertyCategories.All);
I get the following error.
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Here is the stack trace
at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) at System.Reflection.Assembly.GetTypes() at Infragistics.Shared.Serialization.Binder.FindType(Assembly assembly, String assemblyName, String typeName) at Infragistics.Shared.Serialization.Binder.BindToTypeImpl(String assemblyName, String typeName) at Infragistics.Shared.Serialization.Binder.BindToType(String assemblyName, String typeName) at Infragistics.Win.Serialization.Binder.BindToType(String assemblyName, String typeName) at Infragistics.Win.UltraWinGrid.Serialization.Binder.BindToType(String assemblyName, String typeName) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Bind(String assemblyString, String typeString) at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) at Infragistics.Win.UltraWinGrid.UltraGridLayout.LoadHelper(Stream stream, PropertyCategories propertyCategories, IFormatter formatter) at Infragistics.Win.UltraWinGrid.UltraGridLayout.Load(Stream stream, PropertyCategories propertyCategories)
The error message here seems to indicate that your project might have mixed references - that is, it might be referencing more than one version of the same assembly.
Check out the references in all of the projects in the solution and make sure they are all right version. You might also want to try clearing out the contents of the licx files in your project to make sure they are not referring to older versions of the controls.
Another, less likely, option is that you are trying to load a layout that was created in a newer version of the grid into an older version. You can load an older layout into a new version of the grid, but you can't go the other way.