Hello,
I have a problem when I insert a row since in my database I have an item with id 0, and when I try to perform the insert, I get an error that there is a similar value as default value will be placed on the grid is 0and coincides with the item stored in the database. Enclosed is mycode for better understanding and image of the error and the itemthat coicide the database
<UserControl x:Class="Ria2008.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Ria2008.Model;assembly=SLRia2008.Client"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition/>
</Grid.RowDefinitions>
<telerik:RadDomainDataSource x:Name="radDomainDataSource" AutoLoad="True"
QueryName="GetSER_CLASIFICACIONINVERSIONES">
<telerik:RadDomainDataSource.DomainContext>
<local:DomainService1 />
</telerik:RadDomainDataSource.DomainContext>
</telerik:RadDomainDataSource>
<telerik:RadButton Grid.Row="0" x:Name="btnsave" telerik:StyleManager.Theme="Office_Blue" ToolTipService.ToolTip="Guardar"
Command="{Binding SubmitChangesCommand, ElementName=radDomainDataSource}"
CommandTarget="{Binding ElementName=radDomainDataSource}">
</telerik:RadButton>
<telerik:RadGridView Grid.Row="1" x:Name="radGridView"
ItemsSource="{Binding ElementName=radDomainDataSource, Path=DataView}"
IsBusy="{Binding ElementName=radDomainDataSource, Path=IsBusy}"
ShowInsertRow="True"
AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewColumn>
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton Command="telerik:RadGridViewCommands.Delete" CommandParameter="{Binding}">Delete</telerik:RadButton>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>
<!--<telerik:GridViewDataColumn DataMemberBinding="{Binding CODCLASIFICACIONINVERSIONES}" DataFormatString="{}{0:d}"/>-->
<telerik:GridViewDataColumn DataMemberBinding="{Binding DESCRIPCION}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</UserControl>
I have a problem when I insert a row since in my database I have an item with id 0, and when I try to perform the insert, I get an error that there is a similar value as default value will be placed on the grid is 0and coincides with the item stored in the database. Enclosed is mycode for better understanding and image of the error and the itemthat coicide the database
<UserControl x:Class="Ria2008.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Ria2008.Model;assembly=SLRia2008.Client"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition/>
</Grid.RowDefinitions>
<telerik:RadDomainDataSource x:Name="radDomainDataSource" AutoLoad="True"
QueryName="GetSER_CLASIFICACIONINVERSIONES">
<telerik:RadDomainDataSource.DomainContext>
<local:DomainService1 />
</telerik:RadDomainDataSource.DomainContext>
</telerik:RadDomainDataSource>
<telerik:RadButton Grid.Row="0" x:Name="btnsave" telerik:StyleManager.Theme="Office_Blue" ToolTipService.ToolTip="Guardar"
Command="{Binding SubmitChangesCommand, ElementName=radDomainDataSource}"
CommandTarget="{Binding ElementName=radDomainDataSource}">
</telerik:RadButton>
<telerik:RadGridView Grid.Row="1" x:Name="radGridView"
ItemsSource="{Binding ElementName=radDomainDataSource, Path=DataView}"
IsBusy="{Binding ElementName=radDomainDataSource, Path=IsBusy}"
ShowInsertRow="True"
AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewColumn>
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton Command="telerik:RadGridViewCommands.Delete" CommandParameter="{Binding}">Delete</telerik:RadButton>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>
<!--<telerik:GridViewDataColumn DataMemberBinding="{Binding CODCLASIFICACIONINVERSIONES}" DataFormatString="{}{0:d}"/>-->
<telerik:GridViewDataColumn DataMemberBinding="{Binding DESCRIPCION}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</UserControl>