none
xaml itemtemplate control event handler not firing for all instances, just one

    Question

  • I have a tab control bound to a ObservableCollection generating a tab/tabItem for each item. There should be and is multiple instances of the grid below, but the Initialized event is only firing on the first instance, according to the debugger. I need it to fire for all instances, does anyone know what is wrong? thanks


    <TabControl ItemsSource="{Binding InventoryChipsets}">
      <!-- ... -->
    
      <TabControl.ContentTemplate>
        <DataTemplate>
          <Grid>
            <Grid.ColumnDefinitions>
              <ColumnDefinition/>
            </Grid.ColumnDefinitions>
    
            <Grid.RowDefinitions>
              <RowDefinition/>
              <RowDefinition/>
            </Grid.RowDefinitions>
    
            <igDP:XamDataGrid Grid.Row="1" 
                              Initialized="XamDataGrid_Initialized" 
                              DataSource="{Binding Path=InventoryCollection}"/>
          </Grid>
        </DataTemplate>
      </TabControl.ContentTemplate>
    </TabControl>

    Also tried subclassing the grid and putting a breakpoint in the constructor, only called once even though there are 3 tabs with a grid on each tab????

     

     

    Friday, December 04, 2009 12:02 AM

All replies