Getting Started
This quick start tutorial will help you setup and add a RadDataGrid DataStorage Provider control to an application.
First, add a reference to the following assembly:
Important |
---|
Similar to the RadMap SDK Grid.DataStorageProvider will be platform specific (cannot be built in AnyCPU) as it consumes native code.
|
Alternatively, you can add a reference to RadDataGrid DataStorage Provider for Windows 8.1 XAML SDK.
XAML | Copy |
---|
<telerik:RadDataGrid x:Name="grid" UserEditMode="Inline" AutoGenerateColumns="False">
<telerik:RadDataGrid.Columns>
<telerik:DataGridTextColumn PropertyName="Name"/>
</telerik:RadDataGrid.Columns>
</telerik:RadDataGrid> |
C# | Copy |
---|
Context context = new Context("Example", DatabaseLocation.Local);
context.Insert(new Data { Name = "Data" });
context.SaveChanges();
grid.ItemsSource = new DataStorageItemsSource<Data>(context); |
C# | Copy |
---|
public class Data
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ID { get; set; }
public string Name { get; set; }
} |
To illustrate the scenario follow the steps:
Start the application
The RadDataGrid should have one item named "Data".
Edit the item and type, for example, "123".
Close the application.
Start the application again - the previous item is saved.