-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hello! Can anybody help me? I wanna bind 2D int array to DataGrid, but I don't understand how to create TwoWay binding. Now I'm use this code:
<DataGrid Grid.Column="1" Grid.Row="1" x:Name="AutoColumns"
dataGrid2D:ItemsSource.Array2D="{Binding Path=Data2D, Mode=TwoWay}"
dataGrid2D:ItemsSource.ColumnHeadersSource="{Binding ColumnHeaders}"
dataGrid2D:ItemsSource.RowHeadersSource="{Binding RowHeaders}"
ColumnWidth="50"
SelectionUnit="Cell"
IsReadOnly="False"
IsEnabled="True">
<dataGrid2D:Cell.Template>
<DataTemplate>
<TextBlock Text="{Binding Path=., StringFormat=X4}" IsEnabled="true"/>
</DataTemplate>
</dataGrid2D:Cell.Template>
<dataGrid2D:Cell.EditingTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=., StringFormat=X4}" />
</DataTemplate>
</dataGrid2D:Cell.EditingTemplate>
</DataGrid>
Also I'm tried to add an attributes like "Mode=TwoWay, BindsDirectlyToSource=True, UpdateSourceTrigger=LostFocus, NotifyOnSourceUpdated=True" In data templates, but it's do nothing effect. Now it's allow me to entering some numbers in cells, but not save to my array. And one detail - everything work good without templates, but I need them.
Metadata
Metadata
Assignees
Labels
No labels