We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Wrap text in GridTreeControl cells

Thread ID:

Created:

Updated:

Platform:

Replies:

121770 Jan 23,2016 11:34 AM Jan 25,2016 07:45 AM WPF 1
loading
Tags: GridTreeControl
Murad
Asked On January 23, 2016 11:34 AM


Hi.

How do you implement the equivalent of TextWrapping="Wrap" and/or set the row height to expand to the content?

Sowndaiyan Paulpandi [Syncfusion]
Replied On January 25, 2016 07:45 AM

Hi Murad,

Thanks for contacting Syncfusion Support.

We have analyzed your queries and please find the responses for your queries below,

Query [ Set Text Wrapping ]

You can achieve the TextWrapping by customizing TextWrapping property in a GridTree column and  increasing Row Height of a particular row like the below code example,

XAML

<syncfusion:GridTreeColumn HeaderText="Department" MappingName="Department" >

                <syncfusion:GridTreeColumn.StyleInfo>

                    <syncfusion:GridDataStyleInfo TextWrapping="Wrap" />

                </syncfusion:GridTreeColumn.StyleInfo>

</syncfusion:GridTreeColumn>


C#


 treeGrid.Loaded += treeGrid_Loaded;


 void treeGrid_Loaded(object sender, RoutedEventArgs e)
  {

treeGrid.Model.RowHeights[11] = 50;

treeGrid.Model.RowHeights[6] = 50;

treeGrid.Model.RowHeights[12] = 50;

treeGrid.Model.RowHeights[13] = 50;

treeGrid.Model.RowHeights[14] = 50;

  }


Query [ Row height based upon the content ]

You can resizing the Rows by using ResizeRowsToFit method. Please find the following code
example to illustrate this,

C#


void
 treeGrid_Loaded(object sender, RoutedEventArgs e)

        {

            treeGrid.InternalGrid.Model.ResizeRowsToFit(GridRangeInfo.Table(), GridResizeToFitOptions.NoShrinkSize);

        }


And you can change the default row height of the GridTreeControl like the below code example,

C#

this
.gridtreecontrol.ModelLoaded += new EventHandler(gridtreecontrol_ModelLoaded);

void gridtreecontrol_ModelLoaded(object sender, EventArgs e)
  {            
    this.gridtreecontrol.Model.RowHeights.DefaultLineSize = 65;
  }



Regards,

Sowndaiyan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;