I am developing wpf application using C# without using any framework.until now i successfully performed following task on Datagrid.
1.Displaying data in Data-grid by binding with database table
2.Getting the selected row data from Data-grid based on primary key
Here is code for my Data-grid
<DataGrid x:Name="dtgsecutity" HorizontalAlignment="Left" Height="168" Margin="614,513,0,0" ItemsSource="{Binding Path=Security_details}" VerticalAlignment="Top" Width="344">
<DataGrid.Columns>
<DataGridTextColumn Width="30" Header="S\No" Binding="{Binding Path=id, Mode=TwoWay}" />
<DataGridTextColumn Width="45" Header="Code" Binding="{Binding Path=Code, Mode=TwoWay}" />
<DataGridTextColumn Width="80" Header="Description" Binding="{Binding Path=Description, Mode=TwoWay}" />
<DataGridTextColumn Width="40" Header="Rate" Binding="{Binding Path=Rate, Mode=TwoWay}" />
<DataGridTextColumn Width="30" Header="Qty" Binding="{Binding Path=Qty, Mode=TwoWay}" />
<DataGridTextColumn Width="60" Header="Amount" Binding="{Binding Path=Amount, Mode=TwoWay}" />
<DataGridTextColumn Width="60" Header="Remarks" Binding="{Binding Path=Remarks, Mode=TwoWay}" />
</DataGrid.Columns>
</DataGrid>
Now my concerns with this data-grid are:
When No db table is loaded in data-grid :
If my data-grid is unloaded with db tables it is not editable. How i can create row by making it editable? And How i can pragmatically retrieve all those multiple newly created rows for insert command?
When table is loaded in data-grid :
1. If my data-grid is loaded with db tables and i try to add new rows it is not showing new rows in vertical manner rather it shows new rows in horizontal manner. How i can set data-grid to add new row to in vertical manner?
2. And How i can pragmatically retrieve all those multiple updated rows for update command?
Please help me for accomplishing this task without using any framework.Thanks .