Hello,
I have a few questions/problems in regards to the WPF datagrid. I am evaluating your program and we are ready to buy it if I can solve these little problems. I created a sample originally based on your sample LargeDataSets. My real application currently uses Xceed grids (winform). We want to change to datagrid WPF mostly because of performances issues, of uniformity with the rest of our application and for some nice features (i.e. the data filters). Our grid have a lot of rows (for now it ranges at around 100 000 lines) and about 20 to 60 columns.
I will send you a sample application through email in a few minutes (support@xceed.com).
1- I am concerned about performances. Scrolling is great, but if there is a group (i.e.FamilyId) the sorting is really, really slow (the grid freezes for several minutes). Do you have any suggestions about improving performances? I would like to start on good basics and that freeze is not acceptable.
2- Since we have a huge amount of columns, is it possible to have sub menus in the columns chooser or does it have to be fully custom made?
3- I would like to detect changes as soon as edit begun in order to activate an “Apply” button (in my sample it is just a checkbox). By example, I want to detect changes as soon as the user started typing, not when he exited the cell (like it is now). I am listening to dataTable.RowChanged and I am using UpdateSourceTrigger=”CellContentChanged”but it doesn’t seem to change anything.
4- I used to be bound to an ObservableList. Since I switched to DataTable, the “LineType” column (with combo box in edit mode) doesn’t display the text anymore. SelectedItem="{xcdg:CellEditorBinding}" never seemed to work (the selected value in edit mode doesn’t show the selection).
5- Do you have any suggestions about merging 2 data types? In my sample, I have a food that references a family. When displaying foods in my grid, instead of displaying “FamilyId”, I would like to display its name, description and address in 3 different columns. All my data is loaded in memory and stored in lists by data type (i.e. IList<Food> & IList<Family>). It comes from a database but to avoid database requests, everything is in memory.
6- Text wrapping in view mode doesn’t work. I use:
<Style TargetType="{x:Type xcdg:Column}">
<Setter Property="TextWrapping"Value="Wrap" />
</Style>
Thank you very much,
Marie
Note: DataGridxaml:
<xcdg:DataGridControlx:Name="grid"
ItemScrollingBehavior="Immediate"
Grid.Row="0"
Grid.RowSpan="2"
IsDeleteCommandEnabled="True"
UpdateSourceTrigger="CellContentChanged"
ItemsSource="{Binding Source={StaticResource cvs_objects}}">
<xcdg:DataGridControl.Columns>
<xcdg:Column FieldName="LineType">
<xcdg:Column.CellEditor>
<xcdg:CellEditor>
<xcdg:CellEditor.EditTemplate>
<DataTemplate>
<ComboBoxItemsSource="{Binding RelativeSource={RelativeSourceFindAncestor,AncestorType=local:MainPage},
Path=LineTypeValues}"
SelectedItem="{xcdg:CellEditorBinding}"/>
</DataTemplate>
</xcdg:CellEditor.EditTemplate>
</xcdg:CellEditor>
</xcdg:Column.CellEditor>
</xcdg:Column>
</xcdg:DataGridControl.Columns>
<xcdg:DataGridControl.Resources>
<Style TargetType="{x:Type xcdg:TableView}">
<SetterProperty="AllowColumnChooser" Value="True" />
<SetterProperty="IsAlternatingRowStyleEnabled" Value="True" />
</Style>
<Style TargetType="{x:Type xcdg:AutoSelectTextBox}">
<SetterProperty="SpellCheck.IsEnabled" Value="True" />
<SetterProperty="Language" Value="en" />
<SetterProperty="TextWrapping" Value="Wrap" />
<SetterProperty="AcceptsReturn" Value="True" />
</Style>
<Style TargetType="{x:Type xcdg:Column}"> <!--TODO Text wrapping does notwork...-->
<SetterProperty="TextWrapping" Value="Wrap" />
</Style>
</xcdg:DataGridControl.Resources>
</xcdg:DataGridControl>