<my:DataGrid.RowHeaderTemplate>
                    开发者_如何学Python    <DataTemplate>
                            <Grid>
                                <CheckBox Name="dgChkSelect" Checked="dgChkSelect_Checked" Unchecked="dgChkSelect_Unchecked" Tag="{Binding}" />
                                <!--IsChecked="{Binding Path=IsSelected,Mode=TwoWay,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:DataGridRow}}}"-->
                            </Grid>
                        </DataTemplate>
                    </my:DataGrid.RowHeaderTemplate>
Hi all, I want to loop through the datagrid data to retrieve those records has been checked. Anyone know how to do this?
You were in the right path add IsChecked="{Binding Path=IsSelected, Mode=TwoWay}". Dont have the rest of the relative source stuff. Datagrid's itemsource will be searched for the property IsSelected; Make sure you have a property. On a separate note why aren't you using
DataGridCheckBoxColumn. 
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论