Exception

Dec 25, 2012 at 9:44 AM

Hi,

  I have just downloaded this component and started to evaluate the Listbox control. I find it very good, but I am running in to an issue, I have figured, why this could be happening, however I have no idea how to fix it. 

Here is the issue with the code

XAML - note that I have a collection of View model(s) that makes SaleProposals property bound to ItemsSource, the reason for this is I have a list view item that uses multiple properties from the ViewModel to bind the view. So the Grouping property belongs to CurrentSaleProposal which is defined in the View Model of type SaleProposal (to which the items source points.

                <sllb:ListBox

                    Margin="5"

                    Grid.Column="1"

                    ToolPaneVisibility="Collapsed"

ItemsSource="{Binding SaleProposals}"

                    ItemTemplate="{StaticResource SaleProposalSummaryViewTemplate}">

 

                    <sllb:ListBox.GroupDescriptions>

                        <PropertyGroupDescription PropertyName="CurrentSaleProposal.proposalState"/>

                    </sllb:ListBox.GroupDescriptions>

                </sllb:ListBox>

 

All works fine and data is shown, grouping is done etc. however when I click on an item in the listbox, I get the following error -

 

ExceptionObject: {Xceed.Silverlight.Data.DataSourceProviderException: An unhandled exception was raised by the DataSourceProvider. Refer to the InnerException for more information. ---> System.ArgumentException: Object must be of type Int32.

   Message: "Object must be of type Int32."

    StackTrace: "   at System.Int32.CompareTo(Object value)\r\n   at lambda_method(Closure , Object )\r\n   at Xceed.Silverlight.Data.ListDataItemIndexConfiguration.<>c__DisplayClass7.<CreateFilterPredicate>b__1(RawDataItem item)\r\n   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\r\n   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)\r\n   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()\r\n   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n   at Xceed.Silverlight.Data.ListDataItemIndex..ctor(ListDataItemCollection dataSource, ListDataItemIndexConfiguration configuration)\r\n   at Xceed.Silverlight.Data.ListDataSourceProvider.GetIndex(IEnumerable`1 sortOrder, IEnumerable`1 groupValueComparers, Predicate`1 filter, FilterExpressionBase filterExpression, Boolean allowSubset)\r\n   at Xceed.Silverlight.Data.ListDataSourceProvider.GetIndex(SortRequest sortRequest, FilterRequest filterR

 

Any ideas?

 

Regards

Baliga

Developer
Jan 10, 2013 at 7:22 PM

Can you create a simple app that reproduce the problem ?