It works like a dream very little code.
However i would like to allow the user to edit the entities.
How can i change the code from yoru sample (bellow) to allow for that?
RabbitDomainContext _context =
new
RabbitDomainContext();
public
ClientsViewModel()
{
if
(!DesignerProperties.IsInDesignTool)
{
EntityQuery<Organisation> getOrganisationQuery = _context.GetOrganisationsQuery();
_organisations =
new
QueryableDomainServiceCollectionView<Organisation>(_context, getOrganisationQuery);
_organisations.PageSize = 25;
_organisations.AutoLoad =
true
;
}
}
private
readonly
QueryableDomainServiceCollectionView<Organisation> _organisations;
public
IEnumerable Organisations
{
get
{
return
_organisations; }
}
5 Answers, 1 is accepted
So what is the exact problem? Why can't you edit? Could you be a little bit more specific?
Greetings,Ross
the Telerik team
I asume that i would require a to change my code to something like this to allow for editing:
private QueryableDomainServiceCollectionView<
Organisation
> _organisations;
public IEnumerable Organisations
{
get { return _organisations; }
set
{
if (value != _organisations)
{
_organisations = value;
OnPropertyChanged("Organisations");
}
}
}
However that gives me an error when i try to assign "_organisations = value"
Error message is:
Cannot implicitly convert type 'System.Collections.IEnumerable' to 'Telerik.Windows.Data.QueryableDomainServiceCollectionView<cint.Rabbit.Shell.Web.Models.Organisation>'.
I am really not sure why you are doing all of this. A collection property that has a setter and raises PropertyChanged is against all design principles of .NET. Also, how is this connected with editing anyway? I am not sure why you are doing this, but take my word and don't do it.
Please read all of these blog posts before trying to go on. Don't just read them, but download the sample project in each one and examine it carefully in order to understand how the control works:
- Introducing RadDomainDataSource for Silverlight
- Loading data with RadDomainDataSource for Silverlight
- An MVVM Approach to Telerik Domain Services for Silverlight
- Creating CRUD application with RadDomainDataSource for Silverlight
- Why we have built RadDomainDataSource for Silverlight?
After you have covered the blog posts, please read the documentation.
After reading all of these resources, let us know if you have any specific questions. We will be glad to answer any question as long as it is specific and well informed. Regards,
Ross
the Telerik team
I see, yes that does explain it very well.
I have not added a dataform and am able to edit the object and submit with very little additional code.
Thanks
By the way the CRUD example, there is a problem with the project files. I had to edit the solution file to get it to work. Also files appear to be duplicated; you might want to fix that,
Is this supposed to be it?
http://blogs.telerik.com/silverlightteam/posts/10-12-28/creating-crud-application-with-raddomaindatasource-for-silverlight.aspx
Nope...that ain't it.