コンボボックスからDataGridに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">
はありがとうございました!それは働いている!そして、もし私がコンボボックスでクリップボードでサイズを変更したら、それをDataGridにバインドするのですか? –
@ Mr.DonKiHotおっと、私の悪い。私の答えを更新しました。 –