Welcome to the Xceed Community | Help
Community Search  

Checkbox In WPF DataGrid 3.0

Sort Posts: Previous Next
  •  08-21-2008, 10:58 AM Post no. 14314

    Checkbox In WPF DataGrid 3.0

    Hi,

    I recently upgraded to the latest version of the WPF Datagrid, and am having a few teething problems.  Probably most noticeable, and the issue I wish to raise here is that the Boolean values, that get displayed as a checkbox, no longer seem to update my underlying data set.  I have the following XAML:

    <xcdg:DataGridControl.Columns>
        <xcdg:Column FieldName="Generate" Title="" ReadOnly="False" Visible="True" Width="20">

            <xcdg:Column.CellContentTemplate >

     

                <DataTemplate>

                      <CheckBox Margin="1,1,1,1" Width="15" IsChecked="{xcdg:CellEditorBinding}"/>

                </DataTemplate>

             </xcdg:Column.CellContentTemplate>

         <xcdg:Column.CellEditor>

              <xcdg:CellEditor>

                    <xcdg:CellEditor.EditTemplate>

                         <DataTemplate>

                               <CheckBox Margin="1,1,1,1" Width="15" IsChecked="{xcdg:CellEditorBinding}" />

                         </DataTemplate>

                    </xcdg:CellEditor.EditTemplate>

              </xcdg:CellEditor>

          </xcdg:Column.CellEditor>

    </xcdg:Column>

     

    This code worked with the version 2.0 of the data grid, and is no longer working with my application on the new version of the datagrid.  If I try and add a Click event, I am unable in code to get a reference to the relevant data row.    

    Any ideas would be greatly appreciated.

    Many thanks in advance.

    Martyn
  •  12-04-2008, 11:32 AM Post no. 17350 in reply to 14314

    Re: Checkbox In WPF DataGrid 3.0

    I am having the exact same problem. Any ideas please? Here is my XAML for reference.

     

             <xcd:DataGridControl.Columns>
                            <xcd:Column FieldName="IsSelected" Title="" Width="20">                           
                                <xcd:Column.CellContentTemplate>
                                    <DataTemplate>
                                        <CheckBox  x:Name="assignCheck" 
                                                   IsChecked="{xcd:CellEditorBinding}"
                                                   Checked="assignCheck_Checked" Unchecked="assignCheck_Unchecked"/>
                                    </DataTemplate>
                                </xcd:Column.CellContentTemplate>
                            </xcd:Column>
                            <xcd:Column FieldName="EmployeeNumber" Title="Employee" Width="80"/>
                            <xcd:Column FieldName="EmployeeName" Title="Name" Width="180"/>
                            <xcd:Column ReadOnly="True" FieldName="AssignmentCount" Width="80" Title="Assignments"/>

              </xcd:DataGridControl.Columns>

     Looking forward to some answers...


    Thanks,
    Sri

    Filed under:
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.