2010-12-22 89 views

回答

0
Dim selectedItem As New Style(GetType(DataGridCell)) 
    Dim triggerIsSelected As New Trigger() With {.[Property] = DataGridCell.IsSelectedProperty, .Value = True} 
    triggerIsSelected.Setters.Add(New Setter(DataGridCell.BackgroundProperty, System.Windows.Media.Color.Red)) 
    selectedItem.Triggers.Add(triggerIsSelected) 
    Datagrid1.CellStyle = selectedItem 
相關問題