Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
325
Binding enabled/allowedit property
posted

 

I am trying to convert my very simple wpf datagrid to the infragistics datagrid. I am not sure how to disable a specific cell based a property. I'm now using a textbox as datatemplate instead of a normal datagridtextcolumn. How can I create a similar infragistics grid (without code behind)?

The way my datagrid is setup:

<DataGrid ItemsSource="{Binding Path=MyDtos}" >

    <DataGrid.Columns>

        <DataGridTemplateColumn Header="Weight">

            <DataGridTemplateColumn.CellTemplate>

                <DataTemplate>

                    <TextBox Text="{Binding Path=Weight, Mode=TwoWay, StringFormat=F1}" IsEnabled="{Binding Path=AllowEdit}"/>

                </DataTemplate>

            </DataGridTemplateColumn.CellTemplate>

        </DataGridTemplateColumn>

        <DataGridTextColumn Binding="{Binding Path=AllowEdit, Mode=TwoWay}" Header="AllowEdit" />

    </DataGrid.Columns>

</DataGrid>