No Visual property of RowDetalsTemplate in the data grid - wpf

I want to add row details to each row, however I don't find RowDetailsTemplate property in the datagrid to add row details through UI. Do I need to manually change xaml?
I am using recent version of WPF Toolkit which requires 3.5 Sp1. Also using Visual Studio 2008 Sp1.

The property grid of the XAML Designer in VS 2008 generally doesn't show any properties of type FrameworkTemplate (and derived types, like DataTemplate). Only the VS2010 designer added these properties, and lets you select an existing template resource.
So, short reply: Yes, in VS2008, you have to manually edit the XAML in order to define a RowDetailsTemplate.

Related

Windows.Forms.DataGrid missing from Toolbox in VS2008

I am trying to add a DataGrid to my Windows Forms application and it seems that it is missing from the toolbox. Only DataGridView is available.
PS: I was able to manually add it to designer code. But nevertheless I am curious as to why it's not included in the toolbox.
I suspect the DataGrid was never in the Toolbox to begin with. According to MSDN, the DataGrid
Displays ADO.NET data in a scrollable grid. The DataGridView control
replaces and adds functionality to the DataGrid control; however, the
DataGrid control is retained for both backward compatibility and
future use, if you choose.
Also, you should note that Visual Studio allows you to customize the items in the Toolbox. You can right click in the Toolbox, select "Choose Items" and then select DataGrid so that it will then appear in your toolbox.

Why does my Attached Property show in Blend designer but not in VS2010?

I have an attached property and I am registering it with the designer using a design-time assembly. I am using the AttachedPropertyBrowsableForTypeAttribute so that the property will be shown when a TextBox is selected.
The property shows up fine in Expression Blend 4, but does not show in Visual Studio 2010 SP1.
Does anyone know why it would not show up in Visual Studio?
You can download a test project demonstrating the problem from here:
Test Project
Thanks!
The short answer is indeed because the Cider designer is a complete piece of crap. Here's the longer answer:
From a Microsoft blog:
One thing to keep in mind is that one of the requirements of showing
attached properties in the designer is that the owning type needs to
have been loaded by the designer. This happens whenever the designer
accesses the type because it is in the XAML source or is a dependency
of an element loaded from the XAML source.
So the problem is the Cider designer only cares about types which have already been loaded. You can see an example of this by changing your containing Grid to a StackPanel: the Grid.Row and Grid.Column attached properties will then disappear from the list of TextBox properties within Visual Studio. The Blend design surface is somehow more forgiving and recognizes your type. In addition, Blend dutifully displays the Grid.IsSharedSizeScope (under Layout properties) even when using a StackPanel.
Looking at how Microsoft uses and supports attached properties, they seem to favor using them on layout containers. For example there's the AttachedPropertyBrowsableForChildrenAttribute. It's so you can do things like show Canvas.Left for children of a Canvas element. I get the impression they did not thoroughly consider how most people actually are using attached properties today (bolting functionality onto the side of an object versus having functionality flow downhill from a parent).

vs2010 designer duplicate control from base class

Folks,
I have form(formA) that derived from another form(formB)(that derived from DevExpress.XtraEditors.XtraUserControl).
In base form i have control - public DevExpress.XtraBars.BarManager barManager;
When i open inherited form in vs2010 designer this control(barManager) gets duplicated in derived form.
I use vs2010 ultimate SP1. My colleagues do the same - but control didn't duplicated they use VS2010 SP1 too. May be it's settings of vs2010 ? How to fix it ?
Thanks,
Dzmitry
As I remember, there in DevExp settings is a setting that enable/disable edit of DevExp control`s child controls. Maybe it is the reason.
Installation of DevExpress fixed this problem(first time i've just added some assemblies to GAC).

How can I make a WPF custom control automatically appear in the Visual studio toolbox?

If I create a WPF user control, it appears automatically in the Visual Studio toolbox.
Is there a way to make other controls appear automatically in the Visual Studio toolbox?
Conversely, is there a way to hide a user control from the toolbox?
You can right click on the toolbox and select Choose Items... Then from there you will get a dialog that allows you to select which controls to show or hide.
Per comment below if you are trying to figure out how to do this for a Third Party that you are providing your control to check out this MSDN article that describes packaging your control:
http://msdn.microsoft.com/en-us/library/ms165358.aspx
Auto population is described here (at the end), but to summarize you can add DesignTimeVisible(false) to your UserControl to prevent it from being added to the Toolbox.
Your controls should be added just like your UserControls, assuming they meet the requirements at the end of the link above, which are:
To appear in the Auto-Population
Toolbox process a type must derive
from FrameworkElement and:
Are public and have a default public or internal constructor or are
internal and have either a default
public or internal constructor
Types deriving from Window or Page are ignored
FrameworkElements in other .exe projects are ignore
Internal classes will only be displayed when the active designer is
for an item in the same project
Friend Assemblies are not taken into account for Toolbox
Auto-Population
If you are building reusable controls (where your end-users will simply add a reference to your assembly), then you'd need to tell Visual Studio that it should load your controls into the Toolbox. There is a tutorial for WinForms controls on doing this here, but the concepts are the same. A VSIX installer tutorial can be found here.
A lot of the resources out there are for older versions of Visual Studio, but again the same concepts should apply. You simply need to update version information where appropriate.

Editing attached property in Blend and VS 2010

I defined an attached property in silverlight that I want to use it on Silverlight's TextBox
Is there a way to show this property on the property page in Blend, and VS 2010
Like we do with the attached property Grid.Column, Grid.Row, where we can set them on VS 2010?
and if yes, Can I create its own PropertyValueEditor using Silverlight extensibility?
Thanks for help
The only way that you can do this in Blend is by creating a Behavior that sets the property and creating a design-time assembly for the behavior.
Here are articles on creating a Silverlight Design-time assemblies.
Expression Blend has a file template for Behaviors - start with that and create properties that mirror each of the attached properties - call the setters/getters in those properties.

Resources