Skip to content

Commit bf3b051

Browse files
Merge pull request #1890 from syncfusion-content/ES-974685
ES-974685 - Review the User Guide documentation and fix formatting issues, ensuring link accuracy
2 parents c3a0d20 + a5956f1 commit bf3b051

File tree

9 files changed

+132
-162
lines changed

9 files changed

+132
-162
lines changed

wpf/TreeGrid/Clipboard-Operations.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ You can use the IncludeHeaders, IncludeFormat, and IncludeHiddenColumn options a
3232
{% tabs %}
3333
{% highlight xaml %}
3434
<syncfusion:SfTreeGrid Name="treeGrid"
35-
AutoExpandMode="RootNodesExpanded"
36-
AutoGenerateColumns="False"
37-
GridCopyOption="CopyData,IncludeHeaders"
38-
ChildPropertyName="Children"
39-
ColumnSizer="Star"
40-
ExpanderColumn="FirstName"
41-
ItemsSource="{Binding PersonDetails}"
42-
NavigationMode="Row">
35+
AutoExpandMode="RootNodesExpanded"
36+
AutoGenerateColumns="False"
37+
GridCopyOption="CopyData,IncludeHeaders"
38+
ChildPropertyName="Children"
39+
ColumnSizer="Star"
40+
ExpanderColumn="FirstName"
41+
ItemsSource="{Binding PersonDetails}"
42+
NavigationMode="Row">
4343
{% endhighlight %}
4444
{% highlight c# %}
4545

wpf/TreeGrid/Column-Sizing.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,17 @@ Calculates the width of column based on header and cell contents. So that header
4343
<code>FillColumn</code>
4444
</td>
4545
<td>
46+
4647
While setting the `TreeGrid.ColumnSizer` property, all column widths are calculated based on content of cell and last column fills the remaining space of grid. And possible to set any column to fill the remaining space instead of last column by setting `TreeGridColumn.ColumnSizer` as `FillColumn` for that particular column.
4748
</td>
4849
</tr>
4950
<tr>
5051
<td>
5152
<code>AutoFillColumn</code>
5253
</td>
53-
While setting the `TreeGrid.ColumnSizer` property, all column widths are calculated based on content of cell and the last column fills the remaining column width as auto fill. And possible to set any column to fill the remaining space instead of last column by setting `TreeGridColumn.ColumnSizer` as `AutoFillColumn` for that particular column.
5454
<td>
55+
56+
While setting the `TreeGrid.ColumnSizer` property, all column widths are calculated based on content of cell and the last column fills the remaining column width as auto fill. And possible to set any column to fill the remaining space instead of last column by setting `TreeGridColumn.ColumnSizer` as `AutoFillColumn` for that particular column.
5557
</td>
5658
</tr>
5759
<tr>
@@ -104,7 +106,7 @@ N> The `TreeGridColumn.ColumnSizer` takes higher priority than the `SfTreeGrid.C
104106

105107
### Refreshing ColumnSizer at runtime
106108

107-
You can refresh the `ColumnSizer` at runtime by calling [SfTreeGrid.TreeGridColumnSizer.Refresh](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridColumnSizer.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridColumnSizer_Refresh().html) method.
109+
You can refresh the `ColumnSizer` at runtime by calling [SfTreeGrid.TreeGridColumnSizer.Refresh](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridColumnSizer.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridColumnSizer_Refresh) method.
108110
SfTreeGrid support to recalculates the column auto width by calling reset methods of `TreeGridColumnSizer`. [TreeGridColumnSizer.ResetAutoCalculationforAllColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ColumnSizerBase-1.html#Syncfusion_UI_Xaml_Grid_ColumnSizerBase_1_ResetAutoCalculationforAllColumns) method reset widths to all columns. [TreeGridColumnSizer.ResetAutoCalculation](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ColumnSizerBase-1.html#Syncfusion_UI_Xaml_Grid_ColumnSizerBase_1_ResetAutoCalculation_Syncfusion_UI_Xaml_Grid_GridColumnBase_) method reset the width to particular column.
109111

110112
N> The `TreeGridColumnSizer.ResetAutoCalculationforAllColumns` or `TreeGridColumnSizer.ResetAutoCalculation` methods applicable for Auto, FillColumn, AutoFillColumn, SizeToCells types.
@@ -129,17 +131,17 @@ When the width of the column is explicitly defined or column is resized, then co
129131

130132
foreach (var column in treeGrid.Columns)
131133
{
132-
133134
if (!double.IsNaN(column.Width))
134135
column.Width = double.NaN;
135136
}
136137
this.treeGrid.TreeGridColumnSizer.Refresh();
138+
137139
{% endhighlight %}
138140
{% endtabs %}
139141

140142
### Customizing built-in column sizing logic
141143

142-
SfTreeGrid process column sizing operations in [TreeGridColumnSizer](http://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnSizer.html) class. You can customize the column sizing operations by overriding `GridColumnSizer` and set it to `SfTreeGrid.TreeGridColumnSizer`.
144+
SfTreeGrid process column sizing operations in [TreeGridColumnSizer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridColumnSizer.html) class. You can customize the column sizing operations by overriding `GridColumnSizer` and set it to `SfTreeGrid.TreeGridColumnSizer`.
143145

144146
{% tabs %}
145147
{% highlight c# %}
@@ -172,7 +174,7 @@ public class TreeGridColumnSizerExt:TreeGridColumnSizer
172174

173175
### Auto width calculation based on font settings
174176

175-
By default, the ColumnSizer calculates column&#39;s width based on fixed `FontSize`, `FontFamily`, `Margin`,`SortIconWidth`. You can change the calculation by customized settings.
177+
By default, the ColumnSizer calculates column&#39;s width based on fixed `FontSize`, `FontFamily`, `Margin`, `SortIconWidth`. You can change the calculation by customized settings.
176178

177179
#### Changing SortIcon width
178180

@@ -204,9 +206,9 @@ For example, you can calculate the column width, with specified ratios instead o
204206

205207
{% tabs %}
206208
{% highlight c# %}
209+
207210
public static class StarRatio
208211
{
209-
210212
public static int GetColumnRatio(DependencyObject obj)
211213
{
212214
return (int)obj.GetValue(ColumnRatioProperty);
@@ -219,19 +221,20 @@ public static class StarRatio
219221

220222
public static readonly DependencyProperty ColumnRatioProperty = DependencyProperty.RegisterAttached("ColumnRatio", typeof(int), typeof(StarRatio), new PropertyMetadata(1, null));
221223
}
224+
222225
{% endhighlight %}
223226
{% endtabs %}
224227

225228
Below code to define the star width calculation based on the `ColumnRatio`.
226229

227230
{% tabs %}
228231
{% highlight c# %}
232+
229233
//Assign the customized TreeGridColumnSizerExt to SfTreeGrid.TreeGridColumnSizer
230234
this.treeGrid.TreeGridColumnSizer = new TreeGridColumnSizerExt(treeGrid);
231235

232236
public class TreeGridColumnSizerExt : TreeGridColumnSizer
233237
{
234-
235238
public TreeGridColumnSizerExt(SfTreeGrid treeGrid) : base(treeGrid)
236239
{
237240
}
@@ -267,7 +270,6 @@ public class TreeGridColumnSizerExt : TreeGridColumnSizer
267270

268271
foreach (var remColumn in removedColumn)
269272
{
270-
271273
if (!columns.Contains(remColumn))
272274
{
273275
removedWidth += remColumn.ActualWidth;
@@ -335,19 +337,17 @@ Below code creates `CustomColumnSizer` to change the width of `TreeGridComboboxC
335337

336338
{% tabs %}
337339
{% highlight c# %}
340+
338341
this.TreeGrid.TreeGridColumnSizer = new CustomColumnSizer(this.treeGrid);
339342

340343
public class CustomColumnSizer : TreeGridColumnSizer
341344
{
342-
343-
public CustomColumnSizer(SfTreeGrid treeGrid)
344-
: base(treeGrid)
345+
public CustomColumnSizer(SfTreeGrid treeGrid) : base(treeGrid)
345346
{
346347
}
347348

348349
protected override double CalculateCellWidth(TreeGridColumn column)
349350
{
350-
351351
if (column is TreeGridComboBoxColumn)
352352
{
353353
double colWidth = double.MaxValue;
@@ -365,11 +365,11 @@ public class CustomColumnSizer : TreeGridColumnSizer
365365
var measureSize = MeasureText(clientSize, maximumComboItemsText, column, null, Syncfusion.UI.Xaml.Grid.GridQueryBounds.Width);
366366
return measureSize.Width + SystemParameters.ScrollWidth;
367367
}
368-
369368
else
370369
return base.CalculateCellWidth(column);
371370
}
372371
}
372+
373373
{% endhighlight %}
374374

375375
{% endtabs %}

wpf/TreeGrid/Columns.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Keeps old columns in TreeGrid.Columns collection.
240240

241241
### Customize auto-generated columns
242242

243-
You can customize or cancel the generated column by handling [AutoGeneratingColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html) event. `AutoGeneratingColumn` event occurs when the individual column is auto-generated for public and non-static property of underlying data object.
243+
You can customize or cancel the generated column by handling [AutoGeneratingColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_AutoGeneratingColumn) event. `AutoGeneratingColumn` event occurs when the individual column is auto-generated for public and non-static property of underlying data object.
244244

245245
{% tabs %}
246246
{% highlight c# %}
@@ -263,11 +263,11 @@ In the below code, column generation for `ReportsTo` property is canceled by set
263263

264264
{% tabs %}
265265
{% highlight c# %}
266+
266267
treeGrid.AutoGeneratingColumn += TreeGrid_AutoGeneratingColumn;
267268

268269
private void TreeGrid_AutoGeneratingColumn(object sender, TreeGridAutoGeneratingColumnEventArgs e)
269270
{
270-
271271
if (e.Column.MappingName == "ReportsTo")
272272
e.Cancel = true;
273273
}
@@ -282,14 +282,13 @@ In the below code, column type for `Salary` property is changed to `TreeGridText
282282

283283
{% tabs %}
284284
{% highlight c# %}
285+
285286
treeGrid.AutoGeneratingColumn += TreeGrid_AutoGeneratingColumn;
286287

287288
private void TreeGrid_AutoGeneratingColumn(object sender, TreeGridAutoGeneratingColumnEventArgs e)
288289
{
289-
290290
if (e.Column.MappingName == "Salary")
291291
{
292-
293292
if (e.Column is TreeGridNumericColumn)
294293
e.Column = new TreeGridTextColumn() { MappingName = "Salary" };
295294
}
@@ -309,7 +308,6 @@ treeGrid.AutoGeneratingColumn += TreeGrid_AutoGeneratingColumn;
309308

310309
private void TreeGrid_AutoGeneratingColumn(object sender, TreeGridAutoGeneratingColumnEventArgs e)
311310
{
312-
313311
if (e.Column.MappingName == "Salary")
314312
{
315313
e.Column.AllowEditing = false;
@@ -346,7 +344,6 @@ treeGrid.AutoGeneratingColumn += TreeGrid_AutoGeneratingColumn;
346344

347345
private void TreeGrid_AutoGeneratingColumn(object sender, TreeGridAutoGeneratingColumnEventArgs e)
348346
{
349-
350347
if (e.Column.MappingName == "FirstName")
351348
{
352349
e.Column.HeaderTemplate = this.Resources["headerTemplate"] as DataTemplate;
@@ -558,7 +555,7 @@ treeGrid.Columns.Add(new TreeGridTextColumn() { MappingName = "FirstName", Heade
558555

559556
### Accessing column
560557

561-
You can access the column through its column index or [TreeGridColumn.MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_MappingName) from the SfTreeGrid.Columns collection.
558+
You can access the column through its column index or [TreeGridColumn.MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_MappingName) from the `SfTreeGrid.Columns` collection.
562559

563560
{% tabs %}
564561
{% highlight c# %}
@@ -624,7 +621,7 @@ SfTreeGrid shows indication for hidden columns in column header and also allows
624621

625622
### Disable resizing
626623

627-
You can cancel resizing of particular column by setting [TreeGridColumn.AllowResizing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridColumn.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridColumn_AllowResizing) property to `false`. In another way, you can cancel the resizing by handling [SfTreeGrid.ResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html) event. The `ResizingColumns` event occurs when you start dragging by resizing cursor on headers.
624+
You can cancel resizing of particular column by setting [TreeGridColumn.AllowResizing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridColumn.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridColumn_AllowResizing) property to `false`. In another way, you can cancel the resizing by handling [SfTreeGrid.ResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_ResizingColumns) event. The `ResizingColumns` event occurs when you start dragging by resizing cursor on headers.
628625
[ResizingColumnsEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ResizingColumnsEventArgs.html) of `ResizingColumns` provides information about the columns’s index and width.
629626

630627
{% tabs %}
@@ -691,7 +688,7 @@ You can enable or disable dragging on particular column using [TreeGridColumn.Al
691688
{% endtabs %}
692689

693690
### Disable column reordering
694-
You can cancel the particular column dragging by handling [SfTreeGrid.ColumnDragging](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html). `ColumnDragging` event occurs when you start dragging the column header.
691+
You can cancel the particular column dragging by handling [SfTreeGrid.ColumnDragging](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.SfTreeGrid.html#Syncfusion_UI_Xaml_TreeGrid_SfTreeGrid_ColumnDragging). `ColumnDragging` event occurs when you start dragging the column header.
695692

696693
[TreeGridColumnDraggingEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridColumnDraggingEventArgs.html) of `ColumnDragging` event provides information about the column triggered this event.
697694

@@ -811,25 +808,22 @@ string childColumns = string.Empty;
811808

812809
foreach (var stackedColumnName in removingColumns.ToList())
813810
{
814-
815811
if (stackedColumnName.Equals("OrderID"))
816812
{
817813
removingColumns.Remove(stackedColumnName);
818814
}
819-
820815
else
821816
childColumns = childColumns + stackedColumnName + ",";
822817
}
823818

824819
this.treeGrid.StackedHeaderRows[0].StackedColumns[0].ChildColumns = childColumns;
825-
}
826820

827821
{% endhighlight %}
828822
{% endtabs %}
829823

830824
### Changing Stacked Header Row Height
831825

832-
You can change the height of StackedHeaderRows by using [GetTreePanel.RowHeights](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridPanel.html) property.
826+
You can change the height of StackedHeaderRows by using [GetTreePanel.RowHeights](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridPanel.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridPanel_RowHeights) property.
833827

834828
{% tabs %}
835829
{% highlight c# %}
@@ -872,7 +866,7 @@ public class ViewModel
872866
{% endhighlight %}
873867
{% endtabs %}
874868

875-
Below code, binds the `ViewModel.AllowEditing` property to `TreeGridColumn. AllowEditing` property.
869+
Below code, binds the `ViewModel.AllowEditing` property to `TreeGridColumn.AllowEditing` property.
876870
{% tabs %}
877871
{% highlight xaml %}
878872

0 commit comments

Comments
 (0)