الجمعة، 20 ديسمبر 2013

DataGrid disable editing of data

DataGrid Margin="0 10 0 0" x:Name="VideoAudioCombinationDataGrid" HorizontalAlignment="Left" GridLinesVisibility="None" BorderBrush="Transparent" Background="Transparent" ColumnHeaderStyle="{StaticResource g8_MergeColumnHeaderStyle}" AutoGenerateColumns="False" DataGrid.Columns DataGridTextColumn CellStyle="{StaticResource g8_mergecolumnStyle}" Foreground="#FFC7CFD2" Header="Videos" Width="250" CanUserResize="True" Binding="{Binding Video}" DataGridTextColumn CellStyle="{StaticResource g8_mergecolumnStyle}" Foreground="#FFC7CFD2" Header="Audios" Width="250" CanUserResize="True" Binding="{Binding Audio}" DataGridTemplateColumn Header="" CanUserResize="False DataGridTemplateColumn.CellTemplate DataTemplate Button Content="Delete" Command="Delete" /DataTemplate /DataGridTemplateColumn.CellTemplate /DataGridTemplateColumn /DataGrid.Columns/DataGrid

I am binding an observable collection to my datagrid. It works fine but suppose i have 10 elements in my observable collection ,here total 11 rows are coming . Suppose i put IsReadOnly property of datagrid to false, it solves this issue. But then i can't delete items from datagrid. Plz help. Please help me in deleting this extra row coming in my datagrid.


View the original article here

ليست هناك تعليقات:

إرسال تعليق