Hello !
Is there any example of Using RadEntityFrameworkDataSource with RadGridView for Editing ?
I Want to Insert and Edit Rows and Save this to the Database.
In My Testproject i Have an Entity Model with Name 'TestDB' it Only have one Entity 'Adresse' With Fields ID, Name, Street, ZIP, Town
My Code now looks like this: (There is only Xaml Code, no Code Behind or other Classes):
I Can Insert Rows with the Insert Button.
The Save Button is Enabled after Editing, after Clicking it, it goes Disabled, but no Changes are saved to the Database.
Is there any example of Using RadEntityFrameworkDataSource with RadGridView for Editing ?
I Want to Insert and Edit Rows and Save this to the Database.
In My Testproject i Have an Entity Model with Name 'TestDB' it Only have one Entity 'Adresse' With Fields ID, Name, Street, ZIP, Town
My Code now looks like this: (There is only Xaml Code, no Code Behind or other Classes):
I Can Insert Rows with the Insert Button.
The Save Button is Enabled after Editing, after Clicking it, it goes Disabled, but no Changes are saved to the Database.
<
Window
x:Class
=
"RadControlsEFTest.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:local
=
"clr-namespace:RadControlsEFTest"
Title
=
"MainWindow"
Height
=
"500"
Width
=
"800"
WindowStartupLocation
=
"CenterScreen"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
telerik:RadEntityFrameworkDataSource
Name
=
"AdressDataSource"
QueryName
=
"Adresse"
>
<
telerik:RadEntityFrameworkDataSource.ObjectContext
>
<
local:TestDBEntities
/>
</
telerik:RadEntityFrameworkDataSource.ObjectContext
>
</
telerik:RadEntityFrameworkDataSource
>
<
StackPanel
Orientation
=
"Horizontal"
Background
=
"LightBlue"
>
<
telerik:RadButton
Content
=
"Save"
Width
=
"70"
Margin
=
"5"
Command
=
"telerik:RadGridViewCommands.CommitEdit"
CommandTarget
=
"{Binding ElementName=RadGridView}"
/>
<
telerik:RadButton
Content
=
"Insert"
Width
=
"70"
Margin
=
"5"
Command
=
"telerik:RadGridViewCommands.BeginInsert"
CommandTarget
=
"{Binding ElementName=RadGridView}"
/>
</
StackPanel
>
<
telerik:RadGridView
Name
=
"RadGridView"
Grid.Row
=
"1"
ItemsSource
=
"{Binding DataView, ElementName=AdressDataSource}"
/>
</
Grid
>
</
Window
>