Help Getting Started - Binding to CurrentItem

Feb 2, 2010 at 11:49 AM

Hi, I am just trying to get started with this and I want to be able to bind a CurrentItem to the control:

<

my:DataForm Grid.Row="1" CurrentItem="{Binding Model}" HorizontalAlignment="Right" Name="DataFormDivision" xmlns:my="clr-namespace:AllProgrammic.WPF.DataForm;assembly=AllProgrammic.WPF.DataForm" />

This gives me the following compile error - is there any way to bind to the CurrentItem in XAML, not in the code behind? (I am using MVVM so trying to avoid tinkering with the code behind file). 

Error 1 A 'Binding' cannot be set on the 'CurrentItem' property of type 'DataForm'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.

Coordinator
Feb 2, 2010 at 1:14 PM

Hi,

Thank you for using this control. For your problem, i think i have a mistakes in the source. I will check this, and back to bring you more informations.

Apr 10, 2010 at 2:40 PM

Hi wizard.

Can you solve this issue?

Best Regards,

Marnei

Coordinator
Apr 10, 2010 at 3:12 PM

Hi,

I have juste uploaded a new version of source code. I think this will now works fine with binding.

Please sorry for the delayed.

 

Wizad

Apr 10, 2010 at 3:21 PM

Thanks wizard!

But i still have two questions:

1 - Can i define the fields without use the AutoGenerateFields property?

2 - Will you port the dataform to Visual Studio 2010?

Thanks again.

Marnei

Coordinator
Apr 10, 2010 at 3:48 PM
Edited Apr 10, 2010 at 3:49 PM

Replies :

1 - Not actually. I have no idea on how to implements this features.

2- Of course I will : I'm only waiting the RTM version to do it.

 

Wizad

Apr 12, 2010 at 9:12 PM

This can be a CustomAttribute on the Model object. What do you think?

 

Marnei

May 4, 2010 at 3:38 PM
Hi wizard, The RTM version has been around for a few weeks, I wonder if you already ported dataform to it. Thanks, -- Robert
May 24, 2011 at 11:57 PM
marneijs wrote:

1 - Can i define the fields without use the AutoGenerateFields property?

wizad wrote:
Replies :
1 - Not actually. I have no idea on how to implements this features. 

 

Actually, the approach to define fields could be similar to GridView, where you can specify Colums (collection od GridViewColums).

I made my own control, which can both  AutoGenerateFields as well generate fields from bindings defined in xaml. In addition, you can specify control template, cell templates for any datatype. You can write your own field generator to implement such thing as rolebased security.

You can look at the way, how you can speficy fields in xaml in my control and implement it. it should be pretty easy.
http://wpfdetailsview.codeplex.com/