Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to delete a focused row from database in wpf
    primarykey
    data
    text
    <p>I am using wpf and devexpress tool, I made small applicationin which i did ADO.net Connectivity and displayed all names from Name table in database. My question is: Here in code there is a delete button function which describes deletion of a focused row, now as i click that button focused row get deleted but no changes are made to table in database , What should i write here in delete button function to delete that focused row from database too. Can anyone answer my this query. Thanks, Annie</p> <pre><code> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void Window_Loaded_1(object sender, RoutedEventArgs e) { nEntities nr = new nEntities(); nr.Names.ToList(); this.grid.ItemsSource = nr.Names.Local; } private void DeleteButton_Click(object sender, RoutedEventArgs e) { if (grid.IsValidRowHandle(view.FocusedRowHandle)) view.DeleteRow(view.FocusedRowHandle); } &lt;Grid x:Name="LayoutRoot" Background="White"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition /&gt; &lt;RowDefinition Height="30" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;dxg:GridControl Grid.Row="0" Name="grid" AutoGenerateColumns="AddNew"&gt; &lt;dxg:GridControl.View&gt; &lt;dxg:TableView x:Name="view" NavigationStyle="Cell" NewItemRowPosition="Top" /&gt; &lt;/dxg:GridControl.View&gt; &lt;/dxg:GridControl&gt; &lt;Grid Margin="3" Grid.Row="1"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition /&gt; &lt;ColumnDefinition /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Button Content="Add Empty Row" /&gt; &lt;Button Content="Delete Focused Row" Click="DeleteButton_Click" Grid.Column="1" /&gt; &lt;/Grid&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload