This question is locked. New answers and comments are not allowed.
We have the following scenario in our application.
To visualize...
The datagrid columns are defined as follows...
And my converter is as follows...
I'm trying my best to replicate this problem outside of our solution and having a difficult time... If we create the columns dynamically, the user will crash the browser by scrolling horizontally. Creating the columns directly in XAML, or creating the columns dynamically after inserting a blank column in XAML works fine.
Has anybody seen behavior like this before?
- The page's DataContext is an instance of "MyDataObject".
- The grid's ItemsSource is a property of "MyDataObject" called "Results".
- "Results" is defined as an "ObservableCollection<object>". Each item in "Results" is actually a "Dictionary<key,value>" pair.
- Each column is bound to the same converter, which will parse the Dictionary for a specific key based on the converter parameter...
To visualize...
| Results[0] = { {"name", "Rob"}, {"age", "17"}, {"country", "Canada"} }; |
| Results[1] = { {"name", "Dave"}, {"age", "5"}, {"country", "England"} }; |
| Results[2] = { {"name", "Mary"}, {"age", "31"}, {"country", "Australia"} }; |
The datagrid columns are defined as follows...
| <rg:GridViewDataColumn DataMemberBinding="{Binding Converter={StaticResource MyConv}, ConverterParameter='name'}" /> |
| <rg:GridViewDataColumn DataMemberBinding="{Binding Converter={StaticResource MyConv}, ConverterParameter='age'}" /> |
| <rg:GridViewDataColumn DataMemberBinding="{Binding Converter={StaticResource MyConv}, ConverterParameter='country'}" /> |
And my converter is as follows...
| public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
| { |
| Dictionary<string, object> x = (Dictionary<string, object>)value; |
| return x[parameter.ToString()]; |
| } |
I'm trying my best to replicate this problem outside of our solution and having a difficult time... If we create the columns dynamically, the user will crash the browser by scrolling horizontally. Creating the columns directly in XAML, or creating the columns dynamically after inserting a blank column in XAML works fine.
Has anybody seen behavior like this before?
