如题,C1FlexGrid绑定下拉时,如何绑定?
如下代码,绑定失败,请帮忙看一下。
- <c1:C1FlexGrid Name="_processFlowFlexGrid" Grid.Row="1" Grid.Column="0" Grid.RowSpan="2"
- AutoGenerateColumns="False" AllowAddNew="False" AllowSorting="False"
- IsReadOnly="False" HeadersVisibility="Column"
- Style="{StaticResource Green}" MinHeight="560" BorderThickness="1"
- SelectionMode="Cell" ChildItemsPath="Children" MaxRowHeight="20"
- ItemsSource="{Binding ProcessFlowList,IsAsync=True}"
- SelectedItem="{Binding CurrentProcessFlow,Mode=TwoWay}"
- PreviewKeyDown="_processFlowFlexGrid_PreviewKeyDown"
- PreviewKeyUp="_processFlowFlexGrid_PreviewKeyUp"
- CellEditEnded="_processFlowFlexGrid_CellEditEnded">
- <c1:C1FlexGrid.Columns>
- <c1:Column Header="参数值" ColumnName="ParamValue" Width="*" >
- <c1:Column.CellTemplate>
- <DataTemplate>
- <StackPanel Name="StackPanel" VerticalAlignment="Center" Margin="10,0,0,0">
- <TextBlock VerticalAlignment="Center" Cursor="Hand" Name="ParameterItem" Text="{Binding ParamValue}"/>
- </StackPanel>
- </DataTemplate>
- </c1:Column.CellTemplate>
- <c1:Column.CellEditingTemplate>
- <DataTemplate>
- <c1:C1ComboBox Style="{StaticResource Grid-AutoComboBox-List}" DisplayMemberPath="name" SelectedValuePath="value"
- ItemsSource="{Binding Path=DataContext.ParamValueList,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=basicControls:BaseWindow}}"
- SelectedValue="{Binding ParamValue, Mode=TwoWay}"/>
- </DataTemplate>
- </c1:Column.CellEditingTemplate>
- </c1:Column>
- </c1:C1FlexGrid.Columns>
- </c1:C1FlexGrid>
复制代码
另外,如果采用CellEditingTemplate模式,必须点击后进入编辑模式时才能选择下拉内容;如何不用进入编辑模式,默认显示可选的下拉在列表上?如下图所示效果
|