dataform

Dataform in Silverlight 3

I am using Dataform to show a object in my Silverlight application. It is a simple Input page which where you can input value and the SAVE button at the bottom submits the information to the database. My object contains 7 data fields, out of which I need to show only 5 of them. The other two data fields are added in the database directl...

Silverlight bind collection to Combobox in DataForm using MVVM

I have this problem, I've got Silverlight app written using MVVM. I need to create DataForm which is binded to property on ViewModel and I want to add ComboBox and fill it with values from other collection in the same ViewModel. Code: <dataFormToolkit:DataForm CurrentItem="{Binding NewUser, Mode=TwoWay}" AutoGenerateFields="False" Heig...

Reclaiming the space from the DescriptionViewer part of the DataFields on a Silverlight Toolkit DataForm

The DescriptionViewer part of the DataField is used to display the Description property of the System.ComponentModel.DisplayAttribute as a ToolTip in the generated form. I don't want to use this capability and although I can make sure the UI element is not visible by using a style to set either the DescriptionViewerVisibility to Collapse...

How does a Silverlight DataForm auto-generate a binding from a ComboBox to an enum?

I'm trying to understand DataForm as implemented in the November 2009 toolkit and I can't work out how to bind a ComboBox to an enum. Does anyone know how the DataForm does this automatically? Background First I created a class and an Enum, following this article and allowed the DataForm to generate the fields. The DataForm generated...

How do I give the focus to a TextBox in a DataForm?

I've got a small DataForm and I want to set the focus on the first TextBox. I'm using the Novermber 2009 Toolkit. I've named the TextBox and tried using .Focus() from the DataForm's loaded event. I see it get focus for one cursor 'blink' and then it's gone. I'm trying to work out if this is an artefact of the DataForm or something el...

Silverlight Dataform Question

Whenever a user adds a new record to the dataform I want to auto populate a field(integer datatype) with a default value, but I am not sure how to do this. I should also mention that I am populating the dataform using RIA services. Any ideas? ...

Is it possable to add a DataField to a Silverlight DataForm without creating an entire edit template?

I am using the DataForm for an entity with about 40 attributes. I'm happy with how the form displays all but 3 of the attributes. These 3 attributes happen to be lists of items. I don't want to have to code out an entire edit template, seems very counter productive. <dataFormToolkit:DataForm AutoGenerateFields="True" CurrentItem="{Bind...

Dataform fields won't appear

Hello! I am trying to learn how to use the Silverlight 3 DataForm control, because I need to define the DataForm fields myself in the XAML code, that is, I don't want to use the AutoGenerateFields property. My problem is: the dataform works perfectly when the AutoGenerateFields is set to true, but when I create a DataForm and set the fi...

Silverlight 3 DataForm Control how to customize

I am trying to use a silverlight 3 dataform in my project. But I need to bind different controls to different objects in this form. Is it possible to do that. I mean all the data need to fill and edit this form is not coming from one object. Is it achieveable? I also want in my silverlight control to show a combobox when I bind it to a ...

How do I change the spacing between fields in a DataForm?

How do I change the spacing between fields in a DataForm in Silverlight? I've tried editing the template but cannot find what I need. I thought all I needed to do was change the MinHeight and Margin of the DataField style, but that doesn't seem to do it. <Style TargetType="dataFormToolkit:DataField"> <Setter Property="IsTabStop...

Can you bind to DataForm.Mode from within its EditTemplate in Silverlight?

I have a DataForm in Silverlight. I have a single <DataForm.EditTemplate> defined for this control. I want to bind to the Mode (Edit/ReadOnly/AddNew) from within the template (I have a convertor to show or hide things depending upon the mode). Element binding doesn't work from within the EditTemplate but couldn't get RelativeSource t...

Silverlight 4 Overriding the DataForm Autogenerate to insert Combo Boxes bound to Converters.

I've been working towards a solution for some time and could use a little help. I know I've seen an example of this before, but tonight I cannot find anything close to what I need. I have a service that provides me all my DropDownLists, either from Cache or from the DomainService. They are presented as IEnumerable, and are requested f...

Date formatting using data annotations for a dataform in Silverlight

This is probably got a simple answer to it, but I am having problems just formatting the date for a dataform field.. <df:DataForm x:Name="Form1" ItemsSource="{Binding Mode=OneWay}" AutoGenerateFields="True" AutoEdit="True" AutoCommit="False" CommitButtonContent="Save" CancelButtonC...

Silverlight Dataform validation doesn't work

Hi I can't get dataform and it's controls to catch exceptions when validating. Fir instance, I have: <PasswordBox Password="{Binding Password,Mode=TwoWay,NotifyOnValidationError=true,ValidatesOnExceptions=true}" /> All required properties are set to true. In the setter of my Password property I throw a ValidationException upon fail...

Synchronize DataGrid and DataForm in Silverlight 3

I've been banging my head against the wall for a couple of days on this and it's time to ask for help. I've got a DataGrid and DataForm on the same UserControl. I'm using an MVVM approach so there is a single ViewModel for the UserControl. That ViewModel has a couple of properties that are relevant to this discussion: public Observable...

Changing or accessing a control in a Silverlight Data Form Edit Template

I came across an interesting issue today when playing around with the Silverlight Data Form control. I wanted to change the visibility of a particular control inside the bound edit template.. see xaml below. <df:DataForm x:Name="NoteFormEdit" ItemsSource="{Binding Mode=OneWay}" AutoGenerateFields="True" AutoEdit="True" A...

Add validation popup to custom combobox field on Silverlight Dataform

I m using a Dataform that is binded to a entity on my view model, for one field i need to create a combobox of items , i create it and bind it ok using this code on the autogenerating event: ComboBox makes = new ComboBox(); Binding selectedItem = new Binding("conc_claimtype") { Val...

Silverlight DataForm Memory Leak

Some Background I have noticed that setting the EditTemplate of a DataForm (from the Silverlight Toolkit) can cause the DataForm to not be garbage collected. Consequently, the parent control of the DataForm cannot be garbage collected either, causing a very significant memory leak. Here's some XAML which demonstrates the case. <to...

Mark a Silverlight DataForm.DataField as invalid?

Ok, this should be a really simple thing to do, and I'm either missing something, or going about it wrong. Facts: Silverlight 4, using the Toolkit and using DataForms / DataFields, but NOT using a validation summary. Using a Templated Dataform, simple new / edit user form with usual fields like username, firstname, etc, plus Password ...

Silverlight dataform MVVM command binding on update.

I'm new to MVVM and Silverlight and I'm just trying to figure out a simple scenario. I'm using the MVVM Light toolkit and Silverlight 3.0 without Expression Blend. I have a DataGrid and a DataForm bound to an observable collection in a ViewModel. I would like to bind to my RelayCommand Save() property after I make changes to the data i...