0
如何將數值與從combobox的fontsize綁定到數據網格?我嘗試過,但它沒有工作如何將fontsize從組合框綁定到數據網格
<ComboBox Name="FontSizeComboBox" IsEditable="True"
Width="60" SelectedIndex="1"
Foreground="White">
<ComboBox.ItemsSource>
<x:Array Type="{x:Type System:Int32}">
<System:Int32>12</System:Int32>
<System:Int32>14</System:Int32>
<System:Int32>16</System:Int32>
<System:Int32>18</System:Int32>
<System:Int32>20</System:Int32>
<System:Int32>22</System:Int32>
<System:Int32>24</System:Int32>
<System:Int32>26</System:Int32>
<System:Int32>28</System:Int32>
</x:Array>
</ComboBox.ItemsSource>
</ComboBox>
<DataGrid Grid.Row="1" x:Name="dgrPoints" ItemsSource="{Binding Stations}" VerticalAlignment="Top" AutoGenerateColumns="False" CanUserResizeColumns="True"
FontSize="{Binding Path=SelectedIndex.Value ,ElementName=FontSizeComboBox}" CellEditEnding="dgrPoints_CellEditEnding">
謝謝!它正在工作!以及如何做到這一點,如果我通過剪貼板更改大小與combobox綁定與datagrid? –
@DonKiHot先生哎呀,我的壞。更新了我的答案。 –