locked
DATAFORM TEXT WRAPPING ??? RRS feed

  • Question

  •  Hi...

    is there any way to make text wrapping in textboxes of dataform?

    Monday, May 3, 2010 4:46 PM

Answers

  •  do like this:

     

     

     <toolkit:DataForm Margin="37,32,228,191" ItemsSource="{Binding ElementName=metody_analizy_pracy_suszarekDomainDataSource, Path=Data}" AutoEdit="False" AutoCommit="False" DescriptionViewerPosition="Auto">
                <toolkit:DataForm.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF6DB3D8" Offset="0"/>
                        <GradientStop Color="#FF3291C4" Offset="0.07"/>
                        <GradientStop Color="#FF6B98B1" Offset="0.996"/>
                        <GradientStop Color="#FFA7E0FF" Offset="0.07"/>
                    </LinearGradientBrush>
                </toolkit:DataForm.Background>
    <StackPanel>
                <toolkit:DataField>
                    <TextBox Text="{Binding Rekord, Mode=TwoWay}" TextWrapping="Wrap"/>
                </toolkit:DataField>            
                <toolkit:DataField>
                    <TextBox Text="{Binding Rekord2, Mode=TwoWay}" TextWrapping="Wrap"/>
                </toolkit:DataField>            
                <toolkit:DataField>
                    <TextBox Text="{Binding Rekord3, Mode=TwoWay}" TextWrapping="Wrap"/>
                </toolkit:DataField>            
    </StackPanel>
           </toolkit:DataForm>
      
    Tuesday, May 4, 2010 3:33 PM

All replies

  •  
    <dataFormToolkit:DataField>
           <TextBox Text="{Binding Name, Mode=TwoWay}" TextWrapping="Wrap"/>
    </dataFormToolkit:DataField>	
     

     

    Monday, May 3, 2010 4:50 PM
  •  <toolkit:DataForm Margin="37,32,228,191" ItemsSource="{Binding ElementName=metody_analizy_pracy_suszarekDomainDataSource, Path=Data}" AutoEdit="False" AutoCommit="False" DescriptionViewerPosition="Auto">
                <toolkit:DataForm.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF6DB3D8" Offset="0"/>
                        <GradientStop Color="#FF3291C4" Offset="0.07"/>
                        <GradientStop Color="#FF6B98B1" Offset="0.996"/>
                        <GradientStop Color="#FFA7E0FF" Offset="0.07"/>
                    </LinearGradientBrush>
                </toolkit:DataForm.Background>
                <toolkit:DataField>
                    <TextBox TextWrapping="Wrap"/>
                </toolkit:DataField>
                   
               
            </toolkit:DataForm>

     

    it is working but  it shows only 1 datafield and its empty

    Monday, May 3, 2010 5:00 PM
  •  you can set the binding for the text field like above

     

    {Binding ElementName}

    Monday, May 3, 2010 5:46 PM
  •  <toolkit:DataForm Margin="37,32,228,191" ItemsSource="{Binding ElementName=metody_analizy_pracy_suszarekDomainDataSource, Path=Data}" AutoEdit="False" AutoCommit="False" DescriptionViewerPosition="Auto">
                <toolkit:DataForm.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF6DB3D8" Offset="0"/>
                        <GradientStop Color="#FF3291C4" Offset="0.07"/>
                        <GradientStop Color="#FF6B98B1" Offset="0.996"/>
                        <GradientStop Color="#FFA7E0FF" Offset="0.07"/>
                    </LinearGradientBrush>
                </toolkit:DataForm.Background>
                <toolkit:DataField>
                    <TextBox Text="{Binding ElementName=metody_analizy_pracy_suszarekDomainDataSource, Path=Data, Mode=TwoWay}" TextWrapping="Wrap"/>                   
                </toolkit:DataField>
            </toolkit:DataForm>

     

    not working... it displays me one textbox with text :

    System.Windows.Controls.DomainDataSourceView

    Tuesday, May 4, 2010 6:56 AM
  • Set the dataform item source to the data collection

    Set the dataform elements to objects in the collection

     <TextBox Text="{Binding ObjectName} ...

    Where object name is an object in your collection

    So your binding the collection to the parent control, and binding objects in the collection to the child controls

     check these projects out (it should make more sense after looking at these):

    http://msdn.microsoft.com/en-us/magazine/ee335695.aspx
    http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx
    http://timheuer.com/blog/archive/2009/05/25/customize-dataform-with-data-annotation-display-attributes.aspx

    Tuesday, May 4, 2010 11:41 AM
  •  <toolkit:DataForm Margin="37,32,228,191" ItemsSource="{Binding ElementName=metody_analizy_pracy_suszarekDomainDataSource, Path=Data}" AutoEdit="False" AutoCommit="False" DescriptionViewerPosition="Auto">
                <toolkit:DataForm.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF6DB3D8" Offset="0"/>
                        <GradientStop Color="#FF3291C4" Offset="0.07"/>
                        <GradientStop Color="#FF6B98B1" Offset="0.996"/>
                        <GradientStop Color="#FFA7E0FF" Offset="0.07"/>
                    </LinearGradientBrush>
                </toolkit:DataForm.Background>
                <toolkit:DataField>
                    <TextBox Text="{Binding Rekord, Mode=TwoWay}" TextWrapping="Wrap"/>
                </toolkit:DataField>            
           </toolkit:DataForm>

     

    oke this works fine but... i cant add more textboxes properties couse it says that context is already set...

     i know i am newbie but please be patient and help me with this dataform >.<

    Tuesday, May 4, 2010 3:30 PM
  •  do like this:

     

     

     <toolkit:DataForm Margin="37,32,228,191" ItemsSource="{Binding ElementName=metody_analizy_pracy_suszarekDomainDataSource, Path=Data}" AutoEdit="False" AutoCommit="False" DescriptionViewerPosition="Auto">
                <toolkit:DataForm.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF6DB3D8" Offset="0"/>
                        <GradientStop Color="#FF3291C4" Offset="0.07"/>
                        <GradientStop Color="#FF6B98B1" Offset="0.996"/>
                        <GradientStop Color="#FFA7E0FF" Offset="0.07"/>
                    </LinearGradientBrush>
                </toolkit:DataForm.Background>
    <StackPanel>
                <toolkit:DataField>
                    <TextBox Text="{Binding Rekord, Mode=TwoWay}" TextWrapping="Wrap"/>
                </toolkit:DataField>            
                <toolkit:DataField>
                    <TextBox Text="{Binding Rekord2, Mode=TwoWay}" TextWrapping="Wrap"/>
                </toolkit:DataField>            
                <toolkit:DataField>
                    <TextBox Text="{Binding Rekord3, Mode=TwoWay}" TextWrapping="Wrap"/>
                </toolkit:DataField>            
    </StackPanel>
           </toolkit:DataForm>
      
    Tuesday, May 4, 2010 3:33 PM