Isreadonly在datagridtextcolumn中不起

Isreadonly在datagridtextcolumn中不起

本文介绍了Isreadonly在datagridtextcolumn中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两列的数据网格。第一列应该只在其工作的所有条件下就绪,但第二列只读字段应该使用它不工作的属性



< DataGrid ItemsSource ={Binding DtFactor}
ColumnWidth =*
AutoGenerateColumns =False
CanUserAddRows =False
Visibility ={Binding Path = DtFactor,Converter = {StaticResource DataGridVisibilityConvertercs}}>

< DataGrid.Columns>
< DataGridTextColumn Header =Month
Binding ={Binding Path = Month}
IsReadOnly =True/>
< DataGridTextColumn Header =Factor
Binding ={Binding Path = Factor}
IsReadOnly ={Binding IsDataGridEditable,Converter = {StaticResource IsDataGridEditable}}/>
< /DataGrid.Columns>
< / DataGrid>





我尝试过:



i googled,但我没有得到任何解决方案

解决方案

I have a data grid with two columns .first column should be ready only in all condition its working,But second column read only field should work with a property it is not working

<DataGrid ItemsSource="{Binding DtFactor}"
   ColumnWidth="*"
   AutoGenerateColumns="False"
   CanUserAddRows="False"
   Visibility="{Binding Path= DtFactor,Converter={StaticResource DataGridVisibilityConvertercs}}">
                          
   <DataGrid.Columns >
      <DataGridTextColumn Header="Month"
         Binding="{Binding Path=Month}"
         IsReadOnly="True" />
      <DataGridTextColumn Header="Factor"
         Binding="{Binding Path=Factor}"
         IsReadOnly="{Binding IsDataGridEditable ,Converter={StaticResource IsDataGridEditable}}" />
   </DataGrid.Columns>
</DataGrid>



What I have tried:

i googled , but i didn't get any solution

解决方案


这篇关于Isreadonly在datagridtextcolumn中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 09:25