We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

sfDataGrid DetailViewDefinition - Binding InvalidOperationException exception if view model properties are readonly

Thread ID:

Created:

Updated:

Platform:

Replies:

119609 Jul 14,2015 11:12 AM UTC Jul 15,2015 12:51 PM UTC WPF 1
loading
Tags: SfDataGrid
Sauro Rossi
Asked On July 14, 2015 11:12 AM UTC

Hello,
I have just updated WPF sfDataGrid to the 2015 Vol2.
Before go trough the error detail, I would ask if is available a complete and detailed  "what's new" document about WPF 2015 Vol.2?

In my application I have a UserControl with a sfDataGrid with a DetailsViewDefinition.
DetailsView is a sfDataGrid with seven readonly columns with the following binding definition

<sync:GridTemplateColumn.CellTemplate>
	<DataTemplate>
		<local:StrategyStintView DataContext="{Binding S5, Mode=OneWay}" />
	</DataTemplate>
</sync:GridTemplateColumn.CellTemplate>

if I click on the cell I have the following error (please see complete exception in attached file). As  you can see, binding mode is OneWay.

 

System.InvalidOperationException

 A TwoWay or OneWayToSource binding cannot work on the read-only property 'S5' of type 'ViewModels.MainPanelControls.GridViewModels.DSViewModel'.


S5 property is simply defined as you can see below


public int S5
{
	get { return GetS(5); }
}

the only way that I found to solve this issues is do add a fake set. But in this mode my  ViewModel become dirty in few minutes...

public int S5
{
	get { return GetS(5); }
	set { ; }
}


In release 12.4.0.24 all works fine.


Can you please have a check?

Regards

Sauro



Attachment: sfDataGrid_error_43ba981a.zip

Jayaleshwari N [Syncfusion]
Replied On July 15, 2015 12:51 PM UTC

Hi Sauro,

We were able to reproduce the issue “Binding InvalidOperationException exception if view model properties are readonly” and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Regards,
Jayaleshwari N.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;