Welcome to the Xceed Community | Help
Community Search  
More Search Options

how to use binding dynamic data to combobox in DataGrid???

Sort Posts: Previous Next
  •  07-03-2009, 5:24 AM Post no. 22243

    how to use binding dynamic data to combobox in DataGrid???

    i use xceed datagrid for project.

    i want to insert dynamic data to combobox.

    but i don't find dynamic data sample in xceed . only fixed data sample(below...)

    help me....-.-;;; 

     

    Xaml >......................................................................My Code

            <xcdg:CellEditor x:Key="UnitTypeEditor">
                <xcdg:CellEditor.EditTemplate>
                    <DataTemplate>
                        <ComboBox
                                ItemsSource="{Binding Path=DataTypes}"  <== -DataTypes: ObservableCollection<string>, don't show data in DataTypes Collection 


                                BorderThickness="0"
                                MinHeight="22"
                                VerticalContentAlignment="Top"
                                FocusVisualStyle="{x:Null}"
                                >
                        </ComboBox>
                    </DataTemplate>
            ......
     

    xaml>.......................................................fixed comboxbox data

            <xcdg:CellEditor x:Key="dataTypeEditorEcv">
                <xcdg:CellEditor.EditTemplate>
                    <DataTemplate>
                        <ComboBox BorderThickness="0"
                                MinHeight="22"
                                VerticalContentAlignment="Top"
                                SelectedValue="{xcdg:CellEditorBinding}"
                                FocusVisualStyle="{x:Null}">
                            <ComboBox.Resources>
                                <Style TargetType="Popup">
                                    <Setter Property="TextElement.Foreground"
                                       Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
                                </Style>
                            </ComboBox.Resources>
                            <system:String>A</system:String>
                            <system:String>BIN</system:String>
                            <system:String>BOOL</system:String>
                        </ComboBox>
                    </DataTemplate>
                </xcdg:CellEditor.EditTemplate>

     

     

  •  07-03-2009, 5:57 AM Post no. 22245 in reply to 22243

    Re: how to use binding dynamic data to combobox in DataGrid???

    Just replace your

    <ComboBox ItemsSource="{Binding Path=DataTypes}"

     with

    <TextBlock Text="{Binding FallbackValue=UNBOUND, TargetNullValue=NULL}"

     to see where the problems lies.

    (The binding will be either NULL or the value of your column; both being useless)


    /\/\arkus.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.