dataform

Silverlight 3 Dataform - how to add fieds at runtime

故事扮演 提交于 2019-12-23 04:30:35
问题 I am creating a DataForm from dynamic data (so I can't create the columns in the xaml), I currently create columns for my DataGrid (I have not worked out how I can create a button + event in a colomn yet) foreach (var item in headings.Entities) { theDataGrid.Columns.Add( new DataGridTextColumn { Header = item.Label, Binding = new Binding(item.LocalName) }); } I cannot see any methods to add fields to a DataForm at runtime, however... 回答1: You'd be better off not creating your datagrid columns

Silverlight 4: DataForm, currentItem and AutoCommit

感情迁移 提交于 2019-12-23 02:33:15
问题 I have a DataGrid and a DataForm. I'm assigning data to the DataForm with the currently selected Item in the datagrid individually as DataForm.CurrentItem . This means that I do not have any Next/Previous button on the DataForm and the user can switch to any row in the DataGrid. My problem is that although I have set the property AutoCommit="True" on the DataForm, if the user edits something and clicks on another record in the DataGrid, it crashes. How can I force it to save the DataForm when

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

非 Y 不嫁゛ 提交于 2019-12-12 12:14:12
问题 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 from the a repository with GetLookup(LookupId). I have created a custom attribute that I have decorated my MetaDataClass that looks something like this: [Lookup

Silverlight 3 DataForm - How to populate DataFormComboBoxField from enumeration

▼魔方 西西 提交于 2019-12-11 07:46:17
问题 XAML <df:DataForm x:Name="MobCrud" AutoEdit="True" AutoCommit="True" AutoGenerateFields="False" VerticalAlignment="Top" CommandButtonsVisibility="All" Header="Mob Details" CanUserAddItems="True" CanUserDeleteItems="True" CurrentItem="{StaticResource newMob}" > <df:DataForm.Fields> <df:DataFormTextField Binding="{Binding Name}" FieldLabelContent="Name" /> <df:DataFormTextField Binding="{Binding Title}" FieldLabelContent="Title"/> <df:DataFormComboBoxField x:Name="AuraList" Binding="{Binding

Dynamically Creating Controls Following MVVM pattern

久未见 提交于 2019-12-06 08:48:32
问题 I'd like to dynamically generate some controls in my silverlight application. To be more clear, here's a simplified definition of my class: public class TestClass { [Display(Name="First Name")] public string FirstName { get; set; } [Display(Name = "Last Name")] public string LastName { get; set; } public List<CustomProperty> CustomProperties { get; set; } } Each "CustomProperty" will finally be a TextBox, CheckBox or ComboBox: public class CustomProperty { public CustomDataType DataType { get