Home Forums WPF controls Xceed DataGrid for WPF Code no longer works after upgrading to 1.2

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #25194 |

    I didn’t change a line of my code, but now it no longer works with data grid version 1.2. I have a data template for a cell that uses a converter (converts an integer to a color), and a blank value (i.e. “”) is now being sent into the converter. Have you had any other users with similar problems?

    Imported from legacy forums. Posted by Brad (had 3285 views)

    User (Old forums)
    Member
    Post count: 23064

    I am specifying my cell template as follows at runtime:

    DataGridCollectionView view = new DataGridCollectionView( AlertStore.Instance );
    view.ItemProperties.Clear();
    view.ItemProperties.Add( new DataGridItemProperty( “Priority”, “Priority”, typeof( int ) ) );
    view.ItemProperties.Add( new DataGridItemProperty( “Status”, “Active”, typeof( bool ) ) );
    dataGrid.ItemsSource = view;

    dataGrid.Columns[ “Priority” ].CellContentTemplate = this.FindResource( “alertPriorityDataTemplate” ) as DataTemplate;
    dataGrid.Columns[ “Status” ].CellContentTemplate = this.FindResource( “alertStatusDataTemplate” ) as DataTemplate;

    My data template is simply defined in my resources as:

    <DataTemplate x:Key=”alertPriorityDataTemplate”>
    <DockPanel>
    <Grid>
    <Rectangle x:Name=”priorityRect” Height=”16″
    Width=”Auto”
    VerticalAlignment=”Center”
    Margin=”1″
    DockPanel.Dock=”Left”
    Stroke=”Black”
    Fill=”{Binding Converter={StaticResource priorityColorConverter}}”>
    </Rectangle>
    <TextBlock Foreground=”Black” x:Name=”priorityText”
    Text=”{Binding Converter={StaticResource priorityTextConverter}}” TextAlignment=”Center”/>
    </Grid>
    </DockPanel>
    </DataTemplate>

    Imported from legacy forums. Posted by Brad (had 362 views)

    User (Old forums)
    Member
    Post count: 23064

    I got it to work but had to set the cell templates after everything in the grid was loaded… interesting… perhaps something to test or look into.

    Imported from legacy forums. Posted by Brad (had 432 views)

    Xceed Support
    Member
    Post count: 5658

    To ensure that such behavior is not impacting your application, I suggest making sure that all your converters supports the input of the binding’s ‘fallback’ value.

    This might simply be caused by a slightly ‘later’ internal data binding scenario from the DataGridControl’s OM. I have notified the appropriate people to take a look into this, but there is no changes to be expected concerning this at the moment.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 272 views)

    User (Old forums)
    Member
    Post count: 23064

    I actually tried specifying a fallback value for my bindings, but same result. Maybe I’m doing something wrong…

    Imported from legacy forums. Posted by Brad (had 4395 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.