数组/LINQ/List/ObservableCollection
private static void AddIndustryTypes(sectorCode[] result)
{
var industryTypes = (from t in result
select new Industry
{
Key = t.sector_key,
Mnem = t.sector_mnem,
Desc = t.sector_desc,
}).OrderBy(o => o.Mnem).ToList();
IndustryTypes = new ObservableCollection<Industry>(industryTypes);
System.Windows.Application.Current.Resources[IndustryTypeKey] = IndustryTypes;
}
<dxg:GridColumn x:Name="hdrsStatusYNName" Header="Status" FieldName="StatusYN" HorizontalHeaderContentAlignment="Center">
<dxg:GridColumn.HeaderTemplate>
<DataTemplate>
<ContentControl Content="{Binding}" TextBlock.FontWeight="Bold"/>
</DataTemplate>
</dxg:GridColumn.HeaderTemplate>
<!--<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings HorizontalContentAlignment="Left" />
</dxg:GridColumn.EditSettings>-->
<dxg:GridColumn.CellTemplate>
<DataTemplate>
<dxe:ComboBoxEdit EditValue="{Binding Data.StatusYN,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" IsTextEditable="False" >
<dxe:ComboBoxEditItem x:Name="readyCombox" PreviewMouseDown="Combox_PreviewMouseDown" Content="Ready For Vantage">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseDown">
<cmd:EventToCommand
Command="{Binding DataContext.ImportHistoryCommand}"
CommandParameter="{Binding Path=FocusedRow,ElementName=craneDataBrowseTableView}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</dxe:ComboBoxEditItem>
</dxe:ComboBoxEdit>
</DataTemplate>
</dxg:GridColumn.CellTemplate>
</dxg:GridColumn>
<dxg:GridControl.View>
<dxg:TableView Name="craneDataBrowseTableView" AllowEditing="False" ShowAutoFilterRow="True" ShowGroupPanel="False" ShowTotalSummary="True"
RowStyle="{StaticResource SelectedRowStyleNoHightLight}">
<dxg:TableView.RowCellMenuCustomizations>
<dxb:BarButtonItem Name="viewDetailsRowItem" Content="ViewDetails"
ItemClick="ViewDetailsRowItem_ItemClick"
Command="{Binding Path=(dxb:GridPopupMenuBase.GridMenuInfo).View.DataContext.Commands.ViewDetailsCommand, RelativeSource={RelativeSource Self}}"
>
<dxb:BarButtonItem.CommandParameter>
<MultiBinding Converter="{StaticResource CommandMultipleBindingConverter}">
<MultiBinding.Bindings>
<Binding ElementName="craneDataImportDtlsFilterCombox" />
<Binding Path="FocusedRow" ElementName="craneDataBrowseTableView"/>
</MultiBinding.Bindings>
</MultiBinding>
</dxb:BarButtonItem.CommandParameter>
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="ItemClick">
<cmd:EventToCommand Command="{Binding ViewDetailsCommand, RelativeSource={RelativeSource Self}}" >
<cmd:EventToCommand.CommandParameter>
<MultiBinding Converter="{StaticResource CommandMultipleBindingConverter}">
<MultiBinding.Bindings>
<Binding ElementName="craneDataImportDtlsFilterCombox" />
<Binding Path="FocusedRow" ElementName="craneDataBrowseTableView"/>
</MultiBinding.Bindings>
</MultiBinding>
</cmd:EventToCommand.CommandParameter>
</cmd:EventToCommand>
</i:EventTrigger>
</i:Interaction.Triggers>-->
</dxb:BarButtonItem>
</dxg:TableView.RowCellMenuCustomizations>
</dxg:TableView>
</dxg:GridControl.View>
posted on 2014-07-01 15:26 JackSlaterYu 阅读(575) 评论(0) 收藏 举报
浙公网安备 33010602011771号