Skip to main content

Microsoft Silverlight

Answered Question DataFormRSS Feed

(0)

xifan
xifan

Member

Member

24 points

27 Posts

DataForm

I copied the source code of DataForm ToolKit control Samples from  http://silverlight.net/samples/sl3/toolkitcontrolsamples/run/default.html

to a new project but it doesn't work.

 

Thanks for your help!! 

dpatra
dpatra

Member

Member

22 points

20 Posts

Re: DataForm

Hi,

Could you please give some more details on your problem. I am giving sample XAML code for the DataForm

 

<df:DataForm x:Name="myForm" Header="*ProjectId Can Be Changed" CommandButtonsVisibility="None"  AutoGenerateFields="False" AutoEdit="True" Opacity="0.54">
            <df:DataForm.Fields>
                <df:DataFormDateField x:Name="txtStartDate" IsReadOnly="True" Binding="{Binding StartDate}" FieldLabelContent="StartDate"/>
                <df:DataFormDateField x:Name="txtEndDate" IsReadOnly="True" Binding="{Binding EndDate}" FieldLabelContent="EndDate"/>
                <df:DataFormTextField x:Name="txtDuration" IsReadOnly="True" Binding="{Binding Duration}" FieldLabelContent="Duration"/>
                <df:DataFormTextField x:Name="txtSubject" IsReadOnly="True" Binding="{Binding Subject}" FieldLabelContent="Subject"/>
                <df:DataFormTextField x:Name="txtProjectId" IsReadOnly="False" Binding="{Binding ProjectId}" FieldLabelContent="ProjectId" />
               	<df:DataFormTemplateField.DisplayTemplate>
                        <DataTemplate >
                            <TextBox IsReadOnly="True" Text="{Binding ProjectId}"/>
                        </DataTemplate>
                    </df:DataFormTemplateField.DisplayTemplate>
                    <df:DataFormTemplateField.EditTemplate>
                        <DataTemplate x:Name="projectIdTemplate">
                            <ComboBox>
                                <ComboBox.Items>Aviva-000103</ComboBox.Items>
                            </ComboBox>
                        </DataTemplate> 
                    </df:DataFormTemplateField.EditTemplate>
                </df:DataFormTemplateField>-->
                    <df:DataFormTextField x:Name="txtLocation" IsReadOnly="True" Binding="{Binding Location}" FieldLabelContent="Location"/>
                <df:DataFormTextField x:Name="txtOrganizer" IsReadOnly="True" Binding="{Binding Organizer}" FieldLabelContent="Organizer"/>
            </df:DataForm.Fields>
        </df:DataForm>

 

Let me know.

 

Thanks
Diptimaya Patra

Please remember to mark the replies as answers if they help

xifan
xifan

Member

Member

24 points

27 Posts

Re: DataForm

Hi Diptimaya,

I want to know how to use "wrapafter", if it is possible to custmize display form?

 

 

Thnaks in advance.

Xi

xifan
xifan

Member

Member

24 points

27 Posts

Re: DataForm

 

dpatra
dpatra

Member

Member

22 points

20 Posts

Re: DataForm

Hi,

As you can see from my example above (first reply), I have made the Customized Dataform.

The dataform contains limited number of fields as per your requirement you can change the Data Fields.

Try it.

 

<df:DataForm x:Name="myForm" Header="*ProjectId Can Be Changed" CommandButtonsVisibility="None" AutoGenerateFields="False" AutoEdit="True" Opacity="0.54">

<df:DataForm.Fields>

<df:DataFormDateField x:Name="txtStartDate" IsReadOnly="True" Binding="{Binding StartDate}" FieldLabelContent="StartDate"/>

<df:DataFormDateField x:Name="txtEndDate" IsReadOnly="True" Binding="{Binding EndDate}" FieldLabelContent="EndDate"/>

<df:DataFormTextField x:Name="txtDuration" IsReadOnly="True" Binding="{Binding Duration}" FieldLabelContent="Duration"/>

<df:DataFormTextField x:Name="txtSubject" IsReadOnly="True" Binding="{Binding Subject}" FieldLabelContent="Subject"/>

<df:DataFormTextField x:Name="txtProjectId" IsReadOnly="False" Binding="{Binding ProjectId}" FieldLabelContent="ProjectId" />

<df:DataFormTextField x:Name="txtLocation" IsReadOnly="True" Binding="{Binding Location}" FieldLabelContent="Location"/>

<df:DataFormTextField x:Name="txtOrganizer" IsReadOnly="True" Binding="{Binding Organizer}" FieldLabelContent="Organizer"/>

</df:DataForm.Fields>

</df:DataForm>

Thanks
Diptimaya Patra

Please remember to mark the replies as answers if they help

Amanda Wang - MSFT
Amanda W...

All-Star

All-Star

17241 points

1,466 Posts

Answered Question

Re: DataForm

 Hi,

You can use the DataForm's wrapafter property to change the controls layout of  dataform.

Normally, if we don't set the wrapafter's value, it display it like below. 

 

If we set the wrapafter 's value is 4, the control's layout will be like this:

 

Amanda Wang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

xifan
xifan

Member

Member

24 points

27 Posts

Re: Re: DataForm

Thanks,

cnu.jettiboyina
cnu.jett...

Member

Member

2 points

1 Posts

DataForm edit button (pencil) is not shown in my sample.. please help me ..

Hi ,

In my sample i simply wrote a class with three properties and bind it to the dataform with 'StaticResource' property..iam able to see the data

in the dataform ..surpirsingly it is not showing the edit (pencil) mode at the top right corner . Please help me on this.

Also FYI when i added the dataform resource it showing the

"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"

insted of

clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm"

is this a installation bug ?

Thanks in advance..

srinivas 

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities