read data grid rows-----WPF

kahan karadağ 41 Reputation points
2022-10-24T08:00:25.817+00:00

253447-ss.png

I wanna read this rows

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,710 questions
{count} votes

Accepted answer
  1. Hui Liu-MSFT 47,341 Reputation points Microsoft Vendor
    2022-10-25T02:52:49.35+00:00

    You could refer to the following code to edit and update the Deger column of the Sql table.

     <StackPanel>  
            <DataGrid AutoGenerateColumns="False"  Height="200" Name="dg" Width="364"  
                       SelectedItem="{Binding Path=SelectedUser, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"  
                      >  
                <DataGrid.Columns>  
                    <DataGridTextColumn Header="ID"  Binding="{Binding Id}"></DataGridTextColumn>  
                    <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn>  
                    <DataGridTextColumn Header="Deger"  Binding="{Binding Deger}"></DataGridTextColumn>  
                     
                </DataGrid.Columns>  
            </DataGrid>  
              
            <Button Content="Button" Click="Button_Click"/>  
            <DataGrid AutoGenerateColumns="False" Height="200" Name="dg1" Width="364" >  
                <DataGrid.Columns>  
                    <DataGridTextColumn Header="ID"  Binding="{Binding Id}"></DataGridTextColumn>  
                    <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn>  
                    <DataGridTextColumn Header="Deger"  Binding="{Binding Deger}"></DataGridTextColumn>  
                     
                   
                </DataGrid.Columns>  
            </DataGrid>  
        </StackPanel>  
    

    The code behind:
    253732-edit-update-sqlite.txt

    The result:
    253706-88.gif

    ----------------------------------------------------------------------------

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. kahan karadağ 41 Reputation points
    2022-10-24T08:02:19.743+00:00

    253477-asdfasdf.png

    0 comments No comments