Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
636
Multiple Indexers Result in AmbiguousMatchException
posted

Hi,

If you're using bound columns in the XamGrid and you are using indexers as your keys, is there someway to specify to you which indexer you want to use?

We've got a data type that has two indexers on it.  One a type-safe class that's nice for confirming that you're not passing garbage into the class as a key and one that takes a string and works well for binding expressions. 

The problem is that everytime we add a column to the grid with an indexed expression, under the hood an exception's getting thrown.  It's getting trapped internally to Infragistics code and it's eventually resolving properly, but I'm getting eaten alive by QA because WinDbg is showing the errors.  The AmbiguousMatchException gets thrown in this stack ...

042f1d8 6a35f8e4 System.RuntimeType.GetPropertyImpl(System.String, System.Reflection.BindingFlags, System.Reflection.Binder, System.Type, System.Type[], System.Reflection.ParameterModifier[])

0042f200 6a0f161e System.Type.GetProperty(System.String)

0042f20c 036fa558 Infragistics.DataManagerBase.ResolveIndexerPropertyInfo(System.String, Int32, Int32, System.Type, System.Collections.Generic.List`1<System.Object>)

0042f264 036fa259 Infragistics.DataManagerBase.BuildPropertyExpressionFromPropertyName(System.String, System.Linq.Expressions.ParameterExpression)

0042f29c 036f9cb4 Infragistics.Controls.Grids.ColumnLayout.OnColumnAdded(Infragistics.Controls.Grids.ColumnBase)

0042f2d8 036f99d2 Infragistics.Controls.Grids.ColumnBaseCollection.AddItem(Int32, Infragistics.Controls.Grids.ColumnBase)

0042f2f0 037b8ef1 Infragistics.Collections.CollectionBase`1[[System.__Canon, mscorlib]].Add(System.__Canon)

The general way to resolve this error is to provide a type to the GetProperty() method to indicate what you're looking for.  Do you support anything other than int and string?  Is there anyway to designate to you which indexer is being targeted?

Parents
No Data
Reply Children
No Data