Home Forums WPF controls Xceed DataGrid for WPF Data Template

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

    Hi,

    <DataTemplate>
    <ComboBox Name=”cmbTblFields” BorderThickness=”0″ Background=”Transparent”
    Foreground=”{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(TextElement.Foreground)}”
    MinHeight=”22″
    VerticalContentAlignment=”Top”
    IsEditable=”True”
    SelectedValue=”{xcdg:CellEditorBinding}”>
    <ComboBox.Resources>
    <Style TargetType=”Popup”>
    <Setter Property=”TextElement.Foreground”
    Value=”{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}” />
    </Style>
    </ComboBox.Resources>
    </ComboBox>
    </DataTemplate>

    In the Above Code, when i am trying to insert values into the combobox using the name “cmbTblFields”, but in code behind file it is not showing. how can i access the data template combobox name in code behind file. i.e i want to be add items dynamically.

    Thanks

    Imported from legacy forums. Posted by rajendernag (had 1938 views)

    User (Old forums)
    Member
    Post count: 23064

    You could do what I did –
    I added a resouce (to a datatable, list, array, etc…)from code behind before the xaml is loaded
    then set the source of the combobox items to the resource in xaml
    throws warnings at compile because the resource is not found in the xaml but at runtime the resource is there and no problems
    see this thread
    http://forums.xceed.com/forums/ShowPost.aspx?PostID=6115

    Imported from legacy forums. Posted by MiddleTommy (had 2832 views)

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