Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Accessing ComboBoxes created by TitleTemplate

  •  06-30-2008, 2:10 PM

    Accessing ComboBoxes created by TitleTemplate

    I have a combobox in the TitleTemplate of a grid.  When a button click event fires, I want to loop through all of the comboboxes created by the TitleTemplate (x:Name="ThisComboBox" in the XAML below).  Can you please tell me how access these comboboxes in the code-behind?  (The XAML is listed below):

    <xcdg:DataGridControl x:Name="DetailDataGrid"

    Grid.Row="0"

    AutoCreateColumns="False"

    SelectionMode="Extended"

    ItemScrollingBehavior="Deferred"

    Margin="0,0,0,0"

    ItemsSource="{Binding Source={StaticResource FieldsDataSource}}"

    FontFamily="Arial">

     

    <xcdg:DataGridControl.Resources>

    <DataTemplate x:Key="ColumnTitleDataTemplate">

    <StackPanel Orientation="Vertical">

    <ComboBox x:Name="ThisComboBox">

    <ComboBoxItem IsSelected="True">One</ComboBoxItem>

    <ComboBoxItem>Two</ComboBoxItem>

    <ComboBoxItem>Three</ComboBoxItem>

    </ComboBox>

    <TextBlock Text="{Binding}" />

    </StackPanel>

    </DataTemplate>

    </xcdg:DataGridControl.Resources>

     

    <xcdg:DataGridControl.Columns>

    <xcdg:Column FieldName="One" Title="Title 1" TitleTemplate="{StaticResource ColumnTitleDataTemplate}" />

    <xcdg:Column FieldName="Two" Title="Title 2"

    TitleTemplate="{StaticResource ColumnTitleDataTemplate}" />

    <xcdg:Column FieldName="Three" Title="Title 3"

    TitleTemplate="{StaticResource ColumnTitleDataTemplate}" />

    <xcdg:Column FieldName="Four" Title="Title 4"

    TitleTemplate="{StaticResource ColumnTitleDataTemplate}" />

    </xcdg:DataGridControl.Columns>

    <xcdg:DataGridControl.View>

    <xcdg:TableView ShowScrollTip="True"

    UseDefaultHeadersFooters="False"

    ShowRowSelectorPane="True"

    ShowFixedColumnSplitter="True">

    <xcdg:TableView.FixedHeaders>

    <DataTemplate>

    <xcdg:ColumnManagerRow />

    </DataTemplate>

    </xcdg:TableView.FixedHeaders>

    </xcdg:TableView>

    </xcdg:DataGridControl.View>

    </xcdg:DataGridControl>

    Filed under: , ,
View Complete Thread
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.