Is there anyway to make EF navigational properties unidirectional?
In the example below, I would like to remove "Customers" property from the "Orders" table.
Driver behind this is the "circular reference" error I am receiving with Telerik Grid (which tries to serialize my object for Ajax Binding).
I've also run into this. Telerik has an article describing the problem and the solution http://blogs.telerik.com/blogs/posts/10-01-25/resolving_circular_references_when_binding_the_mvc_grid.aspx
Basically instead of deleting the property, as #Akhil suggests, you set it to Private which feels a little less destructive.
If its EF4,
Just Click on "Customers" Navigational Property in the Model View, and Delete (right click & delete).
If Its Earlier Versions,
You cannot do this in the edm-designer. You have to go into the xml-code and look for the navigationproperty you dont want to have and remove it. You will find the navigationiproperty in the CSDL area of your xml-code.
Related
Im trying to find view ID to edit it. I know about developer options, but in this case it is not working...
Odoo v12 community version. Trying to edit a view adding a new customer, when adding a followers into task in project module.
Tried to find it in technical -> views but without success
More details - short video showing my problem.
https://www.youtube.com/watch?v=q-oO7upPvto&feature=youtu.be
Beforehand: it is the view base.view_partner_simple_form.
How to find out? Yes, Odoo's debug mode is not helping that much here. But you can use it to find out what model is behind a field where you used "Create and Edit" context menu. In this case it's the model res.partner.
And from there you have to do a detective's work, or a bit like that. Just switch to the views list in technical and search for form views for model res.partner without a parent (base views not inheriting from other views). You will find 5-6 views and have to look into them one by one to find the right one.
For this case that is pretty simple, because there is only one view for res.partner model with so less fields in it.
In KendoUI, how do I select a treeview element if it does not have an ID? Like by the style class or something.
I am writing an MVVM application and there are 2 tabs in a kendo tab strip with each containing a treeview. On selecting one tab, I want it's checkboxes to be updated based on what checkboxes were checked in the other tab and then I want to also call updateIndeterminate() on the treeview it contains within it.
Now, since I am using MVVM, I don't want to access the treeview by it's id. All I can find online on searching is $("#treeView") and in the Telerik forums, the example to call updateIndeterminate() is also this -
var treeview = $("#treeview").data("kendoTreeView");
treeview.updateIndeterminate();
Am I missing something here? I wonder why it's so hard to find.
I suppose the reason why it's hard to find is that it goes against the idea of declarative initialization and the separation of view and model. Your code is not supposed to interact with the widget itself. Instead, all your logic should be wired up in your view model which is bound to the UI.
You can certainly find it without an id, e.g. with something like this:
var treeView = $("ul[data-role=treeview]").first().getKendoTreeView();
or by using the .k-treeview class, but I wouldn't recommend it. If you really need to access it in code, you should give it an id.
I guess that I am really missing something on the datasource in a custom control. When I create the custom control I have no idea what the name of the datasource on the XPage is going to be. I have added a custom property to the custom control to pass using the Type com.ibm.xsp.domino.model.DominoDocumentData and the Method Binding Editor, and this sort of seems to work if the Custom Control does not contain Custom Controls. At which point either I am getting lost or the XPage/Custom Control binding is getting lost.
Here is what I am trying to do I have created a Tab Table using the Extension Library and have placedd it on a cc. I have set up several tabs on it. Because the amount of information on each tab is pretty extensive I thought I would create a custom control for each tab. Then I ask the Yes/No question on almost every line I created a ccYN custom control, plus a couple of other ones as well because they can be reused and simple bound to a different fieldName that I have set up in the cc Properties. I see where others have said that if the datasource is defined for the XPage that it is available to all of the cc's, the method above seems to work for the first level but deeper than that leaves me or the XPage really confused. I have searched the internet/read Mastering Xpages but am not much further ahead.
It has been a long drawn out process but I think I have it now. On the Custom Control create a Property definition with a type of com.ibm.xsp.model.ModelDataSource with an edit type of String and call it something say ccDataSource. Then bind the the ccDataSource to the datasource of the XPage that contains it when it is know using SSJS so say it is myDataSource.
If the Custome Control is contained in a custome control and the datasource needs to be passed through another level the the binding is compositeData.ccDatasource or ?? whatever the outer datasource Property definition for the Data Source is.
There might be a cleaner way of doing this but I have not found it.
Not sure if you're still looking for an answer, but you can use the data source of "currentDocument" in a custom control. This assumes that the custom control is in a panel with one document data source, or in an XPage with one document data source.
I'd like to know how to set a single ViewModel throughout a single UserControl. I'm using an Items container inside a user control (bound to ItemsSource) and it doesn't seem to update with the code-behind replacement of a DataContext (to a code-behind instantiated ViewModel)
What i'm trying to do is change the DataBound foreground color of every text Item in the userControl, and the items inside an Itemscontrol dont seem to change. forcing a datacontext change removed the collection items from display.
I think I'm conceptually Misunderstood here. could anyone help?
I could fix the problem by using Storyboards to change color but the problem was still the same. The eventual solution was to access the resources inside the templates, which is possible by browsing the Visual Tree as shown in this tutorial
http://windowsphonegeek.com/tips/how-to-access-a-control-placed-inside-listbox-itemtemplate-in-wp7
The peculiar thing though, was that I needed to look for my object inside the initial object returned, as it seems to return the System generated one, which you don't see yourself. Looking for the answer inside this one helped. Also, pushing them into a list of items for easy access later could be a general idea, but MS needs to fix the way of doing this pronto.
I would recommend binding the ItemsSource to a property in your ViewModel.
Assume that class Being has a property of type Habitat. Both classes are implemented in their own .cs files. When I drag and drop the two classes from the class designer onto a new Class diagram, I do not see an association line from Being to Habitat, whereas there is an association in code. Am I doing something wrong, or this simply isn't implemented in VS yet?
To show the property connection, right-click on the property; "show as association" or "show as collection association" (as appropriate)
It's off by default. Right click on the property and choose "Show as association"
The class diagram doesn't show "lines" between every instance (property) of a type and its type. This would get very, very messy very quickly.
If "Being" derived from "Habitat" (which wouldn't make sense), it would show a line for that. It shows lines for inheritance, not each individual field/property.
Habitat is a property in Being. They are not associated in the way the designer shows. The designer shows inheritance.