Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
665
XamTextEditor in horizontal Xamdatagrid with wrap
posted

Anyone have any ideas as to how to get a XamTextEditor inside a horizontal  XamDatagrid to wrap? I have tried styles without any luck.  It works with a vertical grid.

Parents
No Data
Reply
  • 54937
    Verified Answer
    Offline posted

    Text wrapping does work in a horizontal grid. However I'm assuming you're not seeing multiple lines because either the record is physically wide enough (i.e. the logical height of the record is such that the text doesn't need to wrap) or you did not specify a (Label|Cell)Height so the logical width of the field only has enough room to show 1 line of text. The logical width of a column is always a fixed value and is never sized based on content. The following snippet shows text wrapping:

        <igDP:XamDataGrid>
            <igDP:XamDataGrid.DataSource>
                <Binding>
                    <Binding.Source>
                        <XmlDataProvider XPath="/People/Person">
                            <x:XData>
                                <People xmlns="">
                                    <Person Name="John Doe" Comment="This is long text to show that the text within a horizontal grid can wrap assuming the logical width (i.e. the physical height) is big enough to show it and the row extent (i.e. the physical width) is such that the text would wrap." />
                                </People>
                            </x:XData>
                        </XmlDataProvider>
                    </Binding.Source>
                </Binding>
            </igDP:XamDataGrid.DataSource>
            <igDP:XamDataGrid.ViewSettings>
                <igDP:GridViewSettings Orientation="Horizontal" />
            </igDP:XamDataGrid.ViewSettings>
            <igDP:XamDataGrid.FieldLayouts>
                <igDP:FieldLayout>
                    <igDP:FieldLayout.Fields>
                        <igDP:Field Name="Comment">
                            <igDP:Field.Settings>
                                <igDP:FieldSettings CellHeight="200">
                                    <igDP:FieldSettings.EditorStyle>
                                        <Style TargetType="{x:Type igEditors:XamTextEditor}">
                                            <Setter Property="TextWrapping" Value="Wrap" />
                                        </Style>
                                    </igDP:FieldSettings.EditorStyle>
                                </igDP:FieldSettings>
                            </igDP:Field.Settings>
                        </igDP:Field>
                    </igDP:FieldLayout.Fields>
                </igDP:FieldLayout>
            </igDP:XamDataGrid.FieldLayouts>
        </igDP:XamDataGrid>

     

Children