diff --git a/wpf/DataGrid/Clipboard-Operations.md b/wpf/DataGrid/Clipboard-Operations.md index 11b832630..80c7e44a5 100644 --- a/wpf/DataGrid/Clipboard-Operations.md +++ b/wpf/DataGrid/Clipboard-Operations.md @@ -10,20 +10,20 @@ documentation: ug # Clipboard Operations in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) provide support for the clipboard operations such as cut, copy and paste the data within control and between other applications such as Notepad, Excel. Clipboard operations copy and paste is enabled by default. You can copy selected records/cells from SfDataGrid by pressing Ctrl+C and also can paste the content from [Clipboard](https://learn.microsoft.com/en-us/dotnet/api/system.windows.clipboard?view=windowsdesktop-7.0&viewFallbackFrom=net-5.0) to SfDataGrid by pressing Ctrl+V. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) provides support for clipboard operations such as cut, copy, and paste of data within the control and between other applications such as Notepad and Excel. Clipboard operations copy and paste are enabled by default. You can copy selected records/cells from Data Grid by pressing Ctrl+C, and you can also paste the content from [Clipboard](https://learn.microsoft.com/en-us/dotnet/api/system.windows.clipboard?view=windowsdesktop-7.0&viewFallbackFrom=net-5.0) to the control by pressing Ctrl+V. N> Clipboard operations is not supported for the summary rows, add new row and unbound rows. -## Copy to Clipboard in DataGrid +## Copy to Clipboard in Data Grid Copy operation works based on [GridCopyOption](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_GridCopyOption) property. `GridCopyOption` provides the following options, -* [None](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Disables copy in SfDataGrid. +* [None](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Disables copy in the control. -* [CopyData](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Enabled copy in SfDataGrid. +* [CopyData](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Enables copy in Data Grid. * [IncludeHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Column header also copied along with data. @@ -46,19 +46,19 @@ this.dataGrid.GridCopyOption = GridCopyOption.CopyData | GridCopyOption.IncludeH {% endhighlight %} {% endtabs %} -![Copy to Clipboard in WPF DataGrid](Clipboard-Operations_images/wpf-datagrid-copy-to-clipboard.png) +![Copy to Clipboard](Clipboard-Operations_images/wpf-datagrid-copy-to-clipboard.png) N> `IncludeHiddenColumn` is not supported when `SelectionUnit` is [Cell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionUnit.html). -## Paste from Clipboard in DataGrid +## Paste from Clipboard in Data Grid Paste operation works based on [GridPasteOption](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_GridPasteOption) property. `GridPasteOption` provides the following options, -* [None](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPasteOption.html) – Disable paste in SfDataGrid. +* [None](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPasteOption.html) – Disables paste in the control. -* [PasteData](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPasteOption.html) – Enabled paste in SfDataGrid and when an incompatible value is pasted into a record/cell, the pasting operation is skipped for that particular record/cell. +* [PasteData](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPasteOption.html) – Enables paste in Data Grid, and when an incompatible value is pasted into a record/cell, the pasting operation is skipped for that particular record/cell. * [ExcludeFirstLine](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPasteOption.html) – This can be used when pasting data copied with [IncludeHeader](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) copy option. @@ -79,17 +79,17 @@ this.dataGrid.GridPasteOption = GridPasteOption.PasteData | GridPasteOption.Excl {% endhighlight %} {% endtabs %} -![Paste Clipboard Content in WPF DataGrid](Clipboard-Operations_images/wpf-datagrid-paste-clipboard.png) +![Paste Clipboard Content](Clipboard-Operations_images/wpf-datagrid-paste-clipboard.png) -## Cut to Clipboard in DataGrid +## Cut to Clipboard in Data Grid Cut operation works based on [GridCopyOption](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_GridCopyOption) property. `GridCopyOption` provides the following options, -* [None](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Disables cut in SfDataGrid. +* [None](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Disables cut in the control. -* [CutData](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Enabled cut in SfDataGrid. +* [CutData](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Enables cut in Data Grid. * [IncludeHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) – Column header also copied along with data. @@ -112,7 +112,7 @@ this.dataGrid.GridCopyOption = GridCopyOption.CutData | GridCopyOption.IncludeHe {% endhighlight %} {% endtabs %} -![Cut to Clipboard in WPF DataGrid](Clipboard-Operations_images/wpf-datagrid-cut-to-clipboard.png) +![Cut to Clipboard](Clipboard-Operations_images/wpf-datagrid-cut-to-clipboard.png) N> `IncludeHiddenColumn` is not supported when `SelectionUnit` is [Cell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionUnit.html). @@ -120,7 +120,7 @@ N> `IncludeHiddenColumn` is not supported when `SelectionUnit` is [Cell](https:/ ### GridCopyContent -[GridCopyContent](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event occurs when copy/cut the cells in SfDataGrid. [GridCopyPasteEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyPasteEventArgs.html) provides information for `GridCopyContent` event. You can cancel copy operation by handling this event. +[GridCopyContent](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event occurs when copy/cut the cells in Data Grid. [GridCopyPasteEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyPasteEventArgs.html) provides information for the `GridCopyContent` event. You can cancel the copy operation by handling this event. {% tabs %} {% highlight c# %} @@ -137,7 +137,7 @@ void dataGrid_GridCopyContent(object sender, GridCopyPasteEventArgs e) ### GridPasteContent -[GridPasteContent](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event occurs when paste the clipboard value into SfDataGrid. [GridCopyPasteEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyPasteEventArgs.html) provides information for `GridPasteContent` event. You can cancel paste operation by handling this event. +[GridPasteContent](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event occurs when pasting the clipboard value into Data Grid. [GridCopyPasteEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyPasteEventArgs.html) provides information for the `GridPasteContent` event. You can cancel the paste operation by handling this event. {% tabs %} {% highlight c# %} @@ -164,7 +164,7 @@ void dataGrid_GridPasteContent(object sender, GridCopyPasteEventArgs e) * [OriginalSender](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridEventArgs.html#Syncfusion_UI_Xaml_Grid_GridEventArgs_OriginalSender) – Returns the SfDataGrid. -You can change the text copied to clipboard by changing the `ClipBoardValue`. +You can change the text copied to the clipboard by changing the `ClipBoardValue`. {% tabs %} {% highlight c# %} @@ -176,7 +176,7 @@ void dataGrid_CopyGridCellContent(object sender, GridCopyPasteCellEventArgs e) {% endhighlight %} {% endtabs %} -The below code example change the clipboard value as 100 instead of cell value 1003 in SfDataGrid. +The below code example changes the clipboard value to 100 instead of the cell value 1003 in Data Grid. {% tabs %} {% highlight c# %} @@ -189,7 +189,7 @@ void dataGrid_CopyGridCellContent(object sender, GridCopyPasteCellEventArgs e) {% endhighlight %} {% endtabs %} -![Copy to Clipboard based on Cell Value in WPF DataGrid](Clipboard-Operations_images/wpf-datagrid-copy-cell-value.png) +![Copy to Clipboard based on Cell Value](Clipboard-Operations_images/wpf-datagrid-copy-cell-value.png) The below code example handled the copy operation when `MappingName` of a Column is Country. @@ -204,7 +204,7 @@ void dataGrid_CopyGridCellContent(object sender, GridCopyPasteCellEventArgs e) {% endhighlight %} {% endtabs %} -![Copy to Clipboard based on Mapping Name in WPF DataGrid](Clipboard-Operations_images/wpf-datagrid-copy-mapping-name.png) +![Copy to Clipboard based on Mapping Name](Clipboard-Operations_images/wpf-datagrid-copy-mapping-name.png) N> When [GridCopyOption](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_GridCopyOption) with [IncludeHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCopyOption.html) (CopyData, IncludeHeaders / CutData, IncludeHeaders), the `CopyGridCellContent` event also fires for header rows, causing e.RowData to be `null`. With CopyData or CutData (without headers), the event fires only for data rows, and RowData is populated correctly. @@ -221,7 +221,7 @@ With CopyData or CutData (without headers), the event fires only for data rows, * [OriginalSender](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridEventArgs.html#Syncfusion_UI_Xaml_Grid_GridEventArgs_OriginalSender) – Returns the SfDataGrid. -You can change the text paste to SfDataGrid by changing the `ClipBoardValue`. +You can change the text pasted to Data Grid by changing the `ClipBoardValue`. {% tabs %} {% highlight c# %} @@ -247,7 +247,7 @@ void dataGrid_PasteGridCellContent(object sender, GridCopyPasteCellEventArgs e) {% endhighlight %} {% endtabs %} -![Paste Clipboard Content based on Cell Value in WPF DataGrid](Clipboard-Operations_images/wpf-datagrid-paste-cell-value.png) +![Paste Clipboard Content based on Cell Value](Clipboard-Operations_images/wpf-datagrid-paste-cell-value.png) The below code example handled the paste operation when `MappingName` of Column is OrderID @@ -262,13 +262,13 @@ void dataGrid_PasteGridCellContent(object sender, GridCopyPasteCellEventArgs e) {% endhighlight %} {% endtabs %} -![Paste Clipboard Content based on Mapping Name in WPF DataGrid](Clipboard-Operations_images/wpf-datagrid-paste-mapping-name.png) +![Paste Clipboard Content based on Mapping Name](Clipboard-Operations_images/wpf-datagrid-paste-mapping-name.png) ## Handling Programmatically -### Programmatically Copy to Clipboard in WPF DataGrid +### Programmatically Copy to Clipboard in WPF Data Grid -Copy the selected records/cells in SfDataGrid by using [Copy](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_Copy) method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of SfDataGrid. +Copy the selected records/cells in Data Grid by using the [Copy](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_Copy) method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of the control. {% tabs %} {% highlight c# %} @@ -276,7 +276,7 @@ this.dataGrid.GridCopyPaste.Copy(); {% endhighlight %} {% endtabs %} -Copy a record by selecting the record using [MoveCurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridBaseSelectionController.html#Syncfusion_UI_Xaml_Grid_GridBaseSelectionController_MoveCurrentCell_Syncfusion_UI_Xaml_ScrollAxis_RowColumnIndex_System_Boolean_) method and `Copy` method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of SfDataGrid. +Copy a record by selecting the record using the [MoveCurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridBaseSelectionController.html#Syncfusion_UI_Xaml_Grid_GridBaseSelectionController_MoveCurrentCell_Syncfusion_UI_Xaml_ScrollAxis_RowColumnIndex_System_Boolean_) method and the `Copy` method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of the control. {% tabs %} {% highlight c# %} @@ -288,7 +288,7 @@ this.dataGrid.GridCopyPaste.Copy(); {% endhighlight %} {% endtabs %} -Copy the multiple records by selecting group of records using [SelectRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridBaseSelectionController.html#Syncfusion_UI_Xaml_Grid_GridBaseSelectionController_SelectedRows) method and `Copy` method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of SfDataGrid. +Copy multiple records by selecting a group of records using the [SelectRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridBaseSelectionController.html#Syncfusion_UI_Xaml_Grid_GridBaseSelectionController_SelectedRows) method and the `Copy` method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of the control. {% tabs %} {% highlight c# %} @@ -297,7 +297,7 @@ this.dataGrid.GridCopyPaste.Copy(); {% endhighlight %} {% endtabs %} -Copy the multiple cells by selecting group of cells using [SelectCells](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectCells_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Boolean_) method and `Copy` method in `GridCopyPaste` of SfDataGrid. +Copy the multiple cells by selecting a group of cells using the [SelectCells](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectCells_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Boolean_) method and the `Copy` method in `GridCopyPaste` of Data Grid. {% tabs %} {% highlight c# %} @@ -306,9 +306,9 @@ this.dataGrid.GridCopyPaste.Copy(); {% endhighlight %} {% endtabs %} -### Copy rows without selecting in WPF DataGrid +### Copy rows without selecting in WPF Data Grid -You can copy the records without selection by using [CopyRowsToClipboard](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_CopyRowsToClipboard_System_Int32_System_Int32_) method in `GridCopyPaste` of SfDataGrid. +You can copy the records without selection by using the [CopyRowsToClipboard](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_CopyRowsToClipboard_System_Int32_System_Int32_) method in `GridCopyPaste` of Data Grid. {% tabs %} {% highlight c# %} @@ -316,9 +316,9 @@ this.dataGrid.GridCopyPaste.CopyRowsToClipboard(2, 4); {% endhighlight %} {% endtabs %} -### Programmatically Cut Data to Clipboard in WPF DataGrid +### Programmatically Cut Data to Clipboard in WPF Data Grid -Cut the selected records/cells in SfDataGrid by using [Cut](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_Cut) method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of SfDataGrid. +Cut the selected records/cells in Data Grid by using the [Cut](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_Cut) method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of the control. {% tabs %} {% highlight c# %} @@ -326,7 +326,7 @@ this.dataGrid.GridCopyPaste.Cut(); {% endhighlight %} {% endtabs %} -Cut the entire record in SfDataGrid by selecting whole SfDataGrid using [SelectAll](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectAll_System_Boolean_) method and `Cut` method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of SfDataGrid. +Cut the entire record in Data Grid by selecting the whole control using the [SelectAll](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectAll_System_Boolean_) method and the `Cut` method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of the control. {% tabs %} {% highlight c# %} @@ -335,7 +335,7 @@ this.dataGrid.GridCopyPaste.Cut(); {% endhighlight %} {% endtabs %} -Cut the entire column in SfDataGrid by using [SelectCells](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectCells_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Boolean_) method and `Cut` method in `GridCopyPaste` of SfDataGrid. +Cut the entire column in Data Grid by using the [SelectCells](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectCells_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Boolean_) method and the `Cut` method in `GridCopyPaste` of the control. {% tabs %} {% highlight c# %} @@ -346,9 +346,9 @@ this.dataGrid.GridCopyPaste.Cut(); {% endhighlight %} {% endtabs %} -### Programmatically Paste in DataGrid +### Programmatically Paste in Data Grid -Paste the clipboard value into SfDataGrid by using [Paste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_Paste) method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of SfDataGrid. +Paste the clipboard value into Data Grid by using the [Paste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_Paste) method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of the control. {% tabs %} {% highlight c# %} @@ -356,7 +356,7 @@ this.dataGrid.GridCopyPaste.Paste(); {% endhighlight %} {% endtabs %} -Paste the clipboard value into selected record by selecting the record using [MoveCurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridBaseSelectionController.html#Syncfusion_UI_Xaml_Grid_GridBaseSelectionController_MoveCurrentCell_Syncfusion_UI_Xaml_ScrollAxis_RowColumnIndex_System_Boolean_) method and `Paste` method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of SfDataGrid. +Paste the clipboard value into a selected record by selecting the record using the [MoveCurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridBaseSelectionController.html#Syncfusion_UI_Xaml_Grid_GridBaseSelectionController_MoveCurrentCell_Syncfusion_UI_Xaml_ScrollAxis_RowColumnIndex_System_Boolean_) method and the `Paste` method in [GridCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GridCopyPaste) of the control. {% tabs %} {% highlight c# %} @@ -368,9 +368,9 @@ this.dataGrid.GridCopyPaste.Paste(); {% endhighlight %} {% endtabs %} -## Customizing Copy Paste Behavior in WPF DataGrid +## Customizing Copy Paste Behavior in WPF Data Grid -WPF DataGrid (SfDataGrid) process the clipboard operations in [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. You can customize the default copy paste behaviors by overriding `GridCutCopyPaste` class and set it to `SfDataGrid.GridCopyPaste`. +WPF Data Grid (SfDataGrid) processes the clipboard operations in the [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. You can customize the default copy and paste behaviors by overriding the `GridCutCopyPaste` class and setting it to `SfDataGrid.GridCopyPaste`. {% tabs %} {% highlight c# %} @@ -397,7 +397,7 @@ public MainWindow() ### Paste a cell into many cells in WPF DataGrid -By default, you can copy one cell and paste it into another cell when Cell Selection is enabled in SfDataGrid. The below code shows how to copy one cell and paste it into all the selected cells by overriding [PasteToCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToCell_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Object_) method in [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. +By default, you can copy one cell and paste it into another cell when Cell Selection is enabled in Data Grid. The below code shows how to copy one cell and paste it into all the selected cells by overriding the [PasteToCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToCell_System_Object_Syncfusion_UI_Xaml_Grid_GridColumn_System_Object_) method in the [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. {% tabs %} {% highlight c# %} @@ -447,9 +447,9 @@ public class CustomCopyPaste : GridCutCopyPaste {% endhighlight %} {% endtabs %} -### Paste a record into many rows in WPF DataGrid +### Paste a record into many rows in WPF Data Grid -By default, you can able to copy one row and paste it into another row when Row Selection is enabled in SfDataGrid. The below code shows how to copy one row and paste it into all selected rows by overriding the [PasteToRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToRow_System_Object_System_Object_) method in the [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. +By default, you can copy one row and paste it into another row when Row Selection is enabled in Data Grid. The below code shows how to copy one row and paste it into all selected rows by overriding the [PasteToRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToRow_System_Object_System_Object_) method in the [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. {% tabs %} {% highlight c# %} @@ -490,9 +490,9 @@ public class CustomCopyPaste : GridCutCopyPaste {% endhighlight %} {% endtabs %} -### Select pasted records in WPF DataGrid +### Select pasted records in WPF Data Grid -By default after pasting the clipboard value to SfDataGrid selection is maintains in previously selected records as it is. The below code shows select the pasted records after the Paste operation, by overriding the [PasteToRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToRows_System_Object_) and [PasteToRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToRow_System_Object_System_Object_) methods in [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. This code is applicable when [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) is [Row](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionUnit.html). +By default, after pasting the clipboard value into Data Grid, the selection on previously selected records is maintained as is. The below code shows how to select the pasted records after the Paste operation by overriding the [PasteToRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToRows_System_Object_) and [PasteToRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToRow_System_Object_System_Object_) methods in the [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. This code is applicable when [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) is [Row](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionUnit.html). {% tabs %} {% highlight c# %} @@ -526,9 +526,9 @@ public class CustomCopyPaste : GridCutCopyPaste {% endhighlight %} {% endtabs %} -### Create new records while pasting in WPF DataGrid +### Create new records while pasting in WPF Data Grid -By default while paste the clipboard value to SfDataGrid, it changes the values of the already existing records. The below code example shows how to add the copied records as new rows in SfDataGrid by overriding the [PasteToRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToRows_System_Object_) method in [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. +By default, when you paste the clipboard value into Data Grid, it changes the values of the already existing records. The below code example shows how to add the copied records as new rows in the control by overriding the [PasteToRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html#Syncfusion_UI_Xaml_Grid_GridCutCopyPaste_PasteToRows_System_Object_) method in the [GridCutCopyPaste](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCutCopyPaste.html) class. {% tabs %} {% highlight c# %} @@ -584,13 +584,13 @@ public class CustomCopyPaste : GridCutCopyPaste [How to paste the empty string while using Cell selection?](https://support.syncfusion.com/kb/article/6095/how-to-paste-the-empty-string-while-using-cell-selection-in-wpf-datagrid-sfdatagrid) -[How to paste the data by custom column order instead of the first column in the SfDataGrid when SelectionUnit is a Row?](https://support.syncfusion.com/kb/article/5159/how-to-paste-the-data-by-custom-column-order-instead-of-the-first-column-in-the-sfdatagrid) +[How to paste the data by custom column order instead of the first column when SelectionUnit is a Row?](https://support.syncfusion.com/kb/article/5159/how-to-paste-the-data-by-custom-column-order-instead-of-the-first-column-in-the-sfdatagrid) -[How to add the copied rows as new rows in the SfDataGrid while pasting?](https://support.syncfusion.com/kb/article/4640/how-to-add-the-copied-rows-as-new-rows-in-wpf-datagrid-while-pasting) +[How to add the copied rows as new rows while pasting?](https://support.syncfusion.com/kb/article/4640/how-to-add-the-copied-rows-as-new-rows-in-wpf-datagrid-while-pasting) -[How to copy one row and paste it into all the selected rows like Excel in the SfDataGrid?](https://support.syncfusion.com/kb/article/4500/how-to-copy-one-row-and-paste-it-into-all-the-selected-rows-like-excel-in-the-wpf-sfdatagrid) +[How to copy one row and paste it into all the selected rows like Excel?](https://support.syncfusion.com/kb/article/4500/how-to-copy-one-row-and-paste-it-into-all-the-selected-rows-like-excel-in-the-wpf-sfdatagrid) -[How to copy one cell and paste it into all the selected cells in the SfDataGrid like the Excel?](https://support.syncfusion.com/kb/article/4484/how-to-copy-one-cell-and-paste-it-into-all-the-selected-cells-in-the-sfdatagrid-like-the-excel-in-wpf-) +[How to copy one cell and paste it into all the selected cells like the Excel?](https://support.syncfusion.com/kb/article/4484/how-to-copy-one-cell-and-paste-it-into-all-the-selected-cells-in-the-sfdatagrid-like-the-excel-in-wpf-) -[How to copy the column and paste it as a new column by ContextMenu in SfDataGrid?](https://support.syncfusion.com/kb/article/3439/how-to-copy-the-column-and-paste-it-as-a-new-column-by-contextmenu-in-sfdatagrid) +[How to copy the column and paste it as a new column by ContextMenu?](https://support.syncfusion.com/kb/article/3439/how-to-copy-the-column-and-paste-it-as-a-new-column-by-contextmenu-in-sfdatagrid) diff --git a/wpf/DataGrid/Column-Types.md b/wpf/DataGrid/Column-Types.md index e6f50e21d..c9f19387f 100644 --- a/wpf/DataGrid/Column-Types.md +++ b/wpf/DataGrid/Column-Types.md @@ -195,7 +195,7 @@ Selects or deselects rows based on the check box value, which is not bound with ## GridColumn -[GridColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html) is an abstract class provides base functionalities for all the column types in SfDataGrid. +[GridColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html) is an abstract class provides base functionalities for all the column types in Data Grid. ### Column mapping @@ -224,7 +224,7 @@ You can use `DisplayBinding` property to format the column in display, by settin In the below screenshot, `Unit Price` column display value is formatted to currency by setting `DisplayBinding` property. -![wpf DataGrid with Column Formatting](Column-Types_images/wpf-datagrid-column-formatting.png) +![Column with formatting](Column-Types_images/wpf-datagrid-column-formatting.png) By default, Columns handling the data operations (sorting and grouping) based on `MappingName` property. You can perform data operations based on `ValueBinding` by setting [GridColumn.UseBindingValue](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_UseBindingValue) to `true`, when the standard reflection not works or binding column with complex or indexer properties. @@ -268,7 +268,7 @@ In the below code snippet, `GridNumericColumn` is loaded with `ProgressBar and T {% endhighlight %} {% endtabs %} -![WPF DataGrid Column with ProgressBar](Column-Types_images/wpf-datagrid-column-progressbar.png) +![Column with ProgressBar](Column-Types_images/wpf-datagrid-column-progressbar.png) `CellTemplate` is not support by `GridHyperlinkColumn`, `GridCheckboxColumn` and `GridImageColumn` columns. @@ -309,7 +309,7 @@ You can use the same [DataTemplate](https://learn.microsoft.com/en-us/dotnet/api {% endhighlight %} {% endtabs %} -![WPF DataGrid Column with Cell Templates](Column-Types_images/wpf-datagrid-column-cell-template.png) +![Column with cell templates](Column-Types_images/wpf-datagrid-column-cell-template.png) ### Setting CellTemplate based on custom logic using template selector @@ -382,7 +382,7 @@ In the below code, the custom template selector set to `GridColumn.CellTemplateS N> Non-Editable columns does not support `CellTemplate`. -![WPF DataGrid Column Template Selector](Column-Types_images/wpf-datagrid-column-template-selector.png) +![Column template selector](Column-Types_images/wpf-datagrid-column-template-selector.png) ### Binding ViewModel properties with CellTemplate @@ -611,7 +611,7 @@ void dataGrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) {% endhighlight %} {% endtabs %} -![WPF DataGrid Column Formatting](Column-Types_images/wpf-datagrid-formatting.png) +![Column formatting](Column-Types_images/wpf-datagrid-formatting.png) ## Column styling @@ -658,7 +658,7 @@ void dataGrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) {% endhighlight %} {% endtabs %} -![Customizing Font Style in WPF DataGrid Column](Column-Types_images/wpf-datagrid-font-style-customization.png) +![Customizing font style in column](Column-Types_images/wpf-datagrid-font-style-customization.png) ### Styles based on custom logic @@ -740,7 +740,7 @@ void dataGrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) {% endhighlight %} {% endtabs %} -![WPF DataGrid Column with Conditional Formatting](Column-Types_images/wpf-datagrid-conditional-formatting.png) +![Column with conditional formatting](Column-Types_images/wpf-datagrid-conditional-formatting.png) ## End-user interaction @@ -803,7 +803,7 @@ GridColumn allows you to change the alignment of `GridCell` and `GridHeaderCell {% endhighlight %} {% endtabs %} -![WPF DataGrid Column with Text Trimming and Text Wrapping Settings](Column-Types_images/wpf-datagrid-text-trim-and-wrap.png) +![Column with text trimming and text wrapping settings](Column-Types_images/wpf-datagrid-text-trim-and-wrap.png) ## GridEditorColumn @@ -906,7 +906,7 @@ this.dataGrid.Columns.Add(new GridNumericColumn() { MappingName = "Quantity", He {% endhighlight %} {% endtabs %} -![WPF DataGrid with Numeric Column Formatting](Column-Types_images/wpf-datagrid-numeric-column-formatting.png) +![Numeric column formatting](Column-Types_images/wpf-datagrid-numeric-column-formatting.png) ### ParsingMode support @@ -976,7 +976,7 @@ this.dataGrid.Columns.Add(new GridCurrencyColumn() { MappingName = "UnitPrice", {% endhighlight %} {% endtabs %} -![WPF DataGrid Currency Column](Column-Types_images/wpf-datagrid-currency-column.png) +![Currency column](Column-Types_images/wpf-datagrid-currency-column.png) ## GridPercentColumn @@ -1034,7 +1034,7 @@ this.dataGrid.Columns.Add(new GridPercentColumn() { HeaderText = "Discount", Map {% endhighlight %} {% endtabs %} -![WPF DataGrid Percent Column](Column-Types_images/wpf-datagrid-percent-column.png) +![Percent column](Column-Types_images/wpf-datagrid-percent-column.png) ## GridDateTimeColumn @@ -1232,13 +1232,13 @@ You can delete using backspace and delete keys by setting By default, the Calendar displayed in dropdown popup. You can enable both Calendar and Clock control in dropdown popup by setting the [EnableClassicStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.html#Syncfusion_UI_Xaml_Grid_GridDateTimeColumn_EnableClassicStyle) to `true`. -![WPF DataGrid Column with Calendar and Clock](Column-Types_images/wpf-datagrid-with-calendar-and-column.png) +![Column with calendar and clock](Column-Types_images/wpf-datagrid-with-calendar-and-column.png) ### Show repeat button You can increment or decrement the selected part of date time value by enabling the repeat button through [GridDateTimeColumn.ShowRepeatButton](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridDateTimeColumn.html#Syncfusion_UI_Xaml_Grid_GridDateTimeColumn_ShowRepeatButton) property. -![WPF DataGrid displays Spin Button](Column-Types_images/wpf-datagrid-spin-button.png) +![Spin button](Column-Types_images/wpf-datagrid-spin-button.png) ### Format using Converter @@ -1413,7 +1413,7 @@ You can allow `UIElement` loaded inside `CellTemplate` or `EditTemplate` to hand You can allow `UIElement` loaded inside `CellTemplate` to handle keyboard interaction by setting [FocusManagerHelper.WantsKeyInput](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.FocusManagerHelper.html#Syncfusion_UI_Xaml_Grid_FocusManagerHelper_WantsKeyInputProperty) attached property to `GridColumn`. You can use this when loading edit element in CellTemplate. -In this case SfDataGrid handles the below key operations and other keys are handled by UIElement loaded inside `CellTemplate`. +In this case the control handles the below key operations and other keys are handled by UIElement loaded inside `CellTemplate`. * Tab * Enter @@ -1548,7 +1548,7 @@ In the below code, custom template selector set to `GridTemplateColumn.EditTempl {% endhighlight %} {% endtabs %} -![Cell and Edit Template in WPF DataGrid](Column-Types_images/wpf-datagrid-cell-and-edit-template.png) +![Cell and edit template](Column-Types_images/wpf-datagrid-cell-and-edit-template.png) ## GridComboBoxColumn @@ -1578,13 +1578,13 @@ this.dataGrid.Columns.Add(new GridComboBoxColumn() { HeaderText = "Product Name" {% endhighlight %} {% endtabs %} -SfDataGrid triggers, [CurrentCellDropDownSelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellDropDownSelectionChanged) event, when the SelectedValue is changed.[CurrentCellDropDownSelectionChangedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellDropDownSelectionChangedEventArgs.html) of `CurrentCellDropDownSelectionChanged` event provides the information about the changed cell value. +WPF DataGrid triggers, [CurrentCellDropDownSelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellDropDownSelectionChanged) event, when the SelectedValue is changed.[CurrentCellDropDownSelectionChangedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellDropDownSelectionChangedEventArgs.html) of `CurrentCellDropDownSelectionChanged` event provides the information about the changed cell value. `SelectedIndex` property returns the index of selected item. `SelectedItem` property returns the selected item from drop down list. -![WPF DataGrid Column with ComboBox](Column-Types_images/wpf-datagrid-combobox.png) +![Column with ComboBox](Column-Types_images/wpf-datagrid-combobox.png) ### Keep the dropdown to be opened @@ -1635,7 +1635,7 @@ public class GridCellComboBoxRendererExt:GridCellComboBoxRenderer {% endtabs %} -N> This is applicable when the [SfDataGrid.EditTrigger](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_EditTrigger) is set as `OnTap`. +N> This is applicable when the [EditTrigger](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_EditTrigger) is set as `OnTap`. ### Customizing GroupCaptionText based on DisplayMemberPath @@ -1778,15 +1778,15 @@ public class ItemsSourceSelector : IItemsSourceSelector The following screenshot illustrates the different ShipCity ItemsSource bound to each row of the ComboBox based on the Country Name. -![WPF DataGrid Column with Template](Column-Types_images/wpf-datagrid-template.png) +![Column with template](Column-Types_images/wpf-datagrid-template.png) -![WPF DataGrid Column with ComboBox using Template](Column-Types_images/wpf-datagrid-combobox-template.png) +![Column with ComboBox using template](Column-Types_images/wpf-datagrid-combobox-template.png) You can download the sample from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/ComboBoxColumnsDemo-1585046085.zip). ## GridMultiColumnDropDownList -`GridMultiColumnDropDownList` derived from `GridTextColumnBase` and it displays enumeration as cell contents. It hosts [SfMultiDropDownControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfMultiColumnDropDownControl.html) in editing mode. `GridMultiColumnDropDownList` allows you to define the predefined columns in its drop-down like SfDataGrid. +`GridMultiColumnDropDownList` derived from `GridTextColumnBase` and it displays enumeration as cell contents. It hosts [SfMultiDropDownControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfMultiColumnDropDownControl.html) in editing mode. `GridMultiColumnDropDownList` allows you to define the predefined columns in its drop-down similar to Data Grid. You can change the value by selecting the item from drop down or you can edit the `SfMultiColumnDropDownControl.Editor`. You can disable the editing by setting [IsTextReadOnly](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridMultiColumnDropDownList.html#Syncfusion_UI_Xaml_Grid_GridMultiColumnDropDownList_IsTextReadOnly). @@ -1820,12 +1820,12 @@ this.dataGrid.Columns.Add(new GridMultiColumnDropDownList() { ItemsSource = view {% endhighlight %} {% endtabs %} -SfDataGrid triggers, [CurrentCellDropDownSelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellDropDownSelectionChanged) event, when the SelectedValue is changed.[CurrentCellDropDownSelectionChangedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellDropDownSelectionChangedEventArgs.html) of `CurrentCellDropDownSelectionChanged` event provides the information about the changed cell value. +Data Grid triggers, [CurrentCellDropDownSelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellDropDownSelectionChanged) event, when the SelectedValue is changed.[CurrentCellDropDownSelectionChangedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellDropDownSelectionChangedEventArgs.html) of `CurrentCellDropDownSelectionChanged` event provides the information about the changed cell value. `SelectedIndex` property returns the index of selected item. `SelectedItem` property returns the selected item from drop down list. -![WPF DataGrid with MultiColumn Dropdown Control](Column-Types_images/wpf-datagrid-multicolumn-dropdown.png) +![MultiColumn Dropdown control](Column-Types_images/wpf-datagrid-multicolumn-dropdown.png) ### Auto-complete support @@ -1835,7 +1835,7 @@ You can allow SfMultiDropDownControl to complete the entered input value automat You can allow SfMultiDropDownControl to filter the drop-down list items dynamically based on the text typed on editor by setting [AllowIncrementalFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridMultiColumnDropDownList.html#Syncfusion_UI_Xaml_Grid_GridMultiColumnDropDownList_AllowIncrementalFiltering) property to `true`. `GridMultiColumnDropDownList` allows you to filter the items based on case by setting [AllowCasingforFilter](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridMultiColumnDropDownList.html#Syncfusion_UI_Xaml_Grid_GridMultiColumnDropDownList_AllowCasingforFilter) to `true`. This will help users to select from large number of items. -![WPF DataGrid with Filtering](Column-Types_images/wpf-datagrid-filtering.png) +![Filtering](Column-Types_images/wpf-datagrid-filtering.png) ### Auto increment @@ -1855,13 +1855,13 @@ You can allow change the size of drop-down popup by setting [PopUpWidth](https:/ Similarly, the `PopUpHeight` based on [PopUpMinHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridMultiColumnDropDownList.html#Syncfusion_UI_Xaml_Grid_GridMultiColumnDropDownList_PopUpMinHeight) and [PopUpMaxHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridMultiColumnDropDownList.html#Syncfusion_UI_Xaml_Grid_GridMultiColumnDropDownList_PopUpMaxHeight) when the value is not between them. The default value of `PopUpMinHeight` is 300.0. -SfMultiDropDownControl can automatically adjust the popup width based on the actual size of SfDataGrid when setting [IsAutoPopupSize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridMultiColumnDropDownList.html#Syncfusion_UI_Xaml_Grid_GridMultiColumnDropDownList_IsAutoPopupSize) to `true`. +SfMultiDropDownControl can automatically adjust the popup width based on the actual size of the control when setting [IsAutoPopupSize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridMultiColumnDropDownList.html#Syncfusion_UI_Xaml_Grid_GridMultiColumnDropDownList_IsAutoPopupSize) to `true`. #### Resizing drop-down popup You can allow end-user to resize the drop-down popup by showing resizing thumb by setting [ShowResizeThumb](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridMultiColumnDropDownList.html#Syncfusion_UI_Xaml_Grid_GridMultiColumnDropDownList_ShowResizeThumb) property to `Visible`. -![Customizing Dropdown Popup in WPF DataGrid](Column-Types_images/wpf-datagrid-popup-customization.png) +![Customizing dropdown popup](Column-Types_images/wpf-datagrid-popup-customization.png) #### Keep popup open on editing @@ -1955,9 +1955,9 @@ public class ItemsSourceSelector : IItemsSourceSelector The following screenshot illustrates different `ShipCity` ItemsSource bound to each row of the `MultiColumnDropDownList` based on country name. -![WPF DataGrid with MultiColumn Dropdown in Each Row](Column-Types_images/wpf-datagrid-dropdown-in-rows.png) +![MultiColumn Dropdown in each row](Column-Types_images/wpf-datagrid-dropdown-in-rows.png) -![WPF DataGrid with MultiColumn Dropdown in Each Row](Column-Types_images/wpf-datagrid-dropdown-each-row.png) +![MultiColumn Dropdown in each row](Column-Types_images/wpf-datagrid-dropdown-each-row.png) You can download the sample from the following link: [Sample](https://github.com/SyncfusionExamples/how-to-load-different-items-for-each-row-in-multicolumn-dropdown-column-in-wpf-and-uwp-datagrid). @@ -2169,7 +2169,7 @@ this.dataGrid.Columns.Add(new GridMaskColumn() { HeaderText = "Contact Number", {% endhighlight %} {% endtabs %} -![WPF DataGrid with Masked TextBox](Column-Types_images/wpf-datagrid-masked-textbox.png) +![Masked TextBox](Column-Types_images/wpf-datagrid-masked-textbox.png) Mask for numeric value not exceeds two digits to the left of the decimal point. @@ -2187,7 +2187,7 @@ In the below code snippet, `Mask` applied to format and validate the user input {% endhighlight %} {% endtabs %} -![WPF DataGrid with Masked TextBox](Column-Types_images/wpf-datagrid-mask-textbox.png) +![Masked TextBox](Column-Types_images/wpf-datagrid-mask-textbox.png) ### Specifying prompt character @@ -2270,11 +2270,11 @@ You can format the time span values by setting [Format](https://help.syncfusion. {% endhighlight %} {% endtabs %} -![WPF DataGrid with TimeSpan](Column-Types_images/wpf-datagrid-timespan.png) +![TimeSpan](Column-Types_images/wpf-datagrid-timespan.png) ## GridCheckBoxSelectorColumn -`SfDataGrid` allows you to select or deselect individual rows through `CheckBox` using [GridCheckBoxSelectorColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCheckBoxSelectorColumn.html), which is not bound with data object from underlying data source, and it can be added like normal columns. The selector column supports row selection alone, and selection in selector column works based on the [SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode). +WPF DataGrid allows you to select or deselect individual rows through `CheckBox` using [GridCheckBoxSelectorColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCheckBoxSelectorColumn.html), which is not bound with data object from underlying data source, and it can be added like normal columns. The selector column supports row selection alone, and selection in selector column works based on the [SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode). {% tabs %} {% highlight xaml %} @@ -2296,9 +2296,9 @@ this.dataGrid.Columns.Add(new GridCheckBoxSelectorColumn() {% endhighlight %} {% endtabs %} -By default, check box is displayed in the header of selector column, which is used to select or deselect all the rows in the datagrid. +By default, check box is displayed in the header of selector column, which is used to select or deselect all the rows. -![WPF DataGrid Column with CheckBox Selector](Column-Types_images/wpf-datagrid-checkbox-selector.png) +![Column with CheckBox selector](Column-Types_images/wpf-datagrid-checkbox-selector.png) ### Text on column header @@ -2328,7 +2328,7 @@ this.dataGrid.Columns.Add(new GridCheckBoxSelectorColumn() {% endhighlight %} {% endtabs %} -![Displaying Text in Column Header of WPF DataGrid](Column-Types_images/wpf-datagrid-column-header-text.png) +![Displaying text in column header](Column-Types_images/wpf-datagrid-column-header-text.png) ### Styling selector column @@ -2357,7 +2357,7 @@ The style of checkbox in record cells can be customized using the `CellStyle` pr {% endhighlight %} {% endtabs %} -![WPF DataGrid Column with CheckBox Style](Column-Types_images/wpf-datagrid-checkbox-style.png) +![Column with CheckBox style](Column-Types_images/wpf-datagrid-checkbox-style.png) As above, style of the header check box can be customized using the `HeaderCellStyle` property. @@ -2385,7 +2385,7 @@ As above, style of the header check box can be customized using the `HeaderCellS {% endhighlight %} {% endtabs %} -![WPF DataGrid Column with CheckBox Style in header](Column-Types_images/wpf-datagrid-checkbox-style-in-header.png) +![Column with CheckBox style in header](Column-Types_images/wpf-datagrid-checkbox-style-in-header.png) ### Canceling the check box state change The checkbox state change in the `GridCheckBoxSelectorColumn` can be canceled by setting [CellCheckBoxClickEventArgs.Cancel](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.canceleventargs?view=net-10.0#properties) to true in the [SfDataGrid.CellCheckBoxClick](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CellCheckBoxClick) event. Additionally, the checkbox value can be modified by setting [CellCheckBoxClickEventArgs.NewValue](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CellCheckBoxClickEventArgs.html#Syncfusion_UI_Xaml_Grid_CellCheckBoxClickEventArgs_NewValue) within the same event. @@ -2429,11 +2429,11 @@ The following are the limitations of `GridCheckBoxSelectorColumn`: ## Custom column support -SfDataGrid allows you to create your own column by overriding predefined column type or creating a new custom column. +WPF DataGrid allows you to create your own column by overriding predefined column type or creating a new custom column. ### Creating column from existing column -You can create your own column by overriding the [predefined](#_Overriding_existing_cell) column types in SfDataGrid. +You can create your own column by overriding the [predefined](#_Overriding_existing_cell) column types in Data Grid. For example, the `GridDateTimeColumn` loads the `DateTime` value by default. If you want to display [DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset?view=net-5.0) value, you can create a new column by overriding the `GridDateTimeColumn` class. @@ -2602,7 +2602,7 @@ You can get the sample from [here](https://github.com/SyncfusionExamples/how-to- ### Customize column renderer -SfDataGrid allows you to customize the column related operations like key navigation and UI related interactions by overriding the corresponding renderer associated with the column. Each column has its own renderer with set of virtual methods for handling the column level operations. +Data Grid allows you to customize the column related operations like key navigation and UI related interactions by overriding the corresponding renderer associated with the column. Each column has its own renderer with set of virtual methods for handling the column level operations. Below table lists the available cell types for columns and its renderers. @@ -2816,7 +2816,7 @@ public class GridCellTextBoxRendererExt:GridCellTextBoxRenderer {% endhighlight %} {% endtabs %} -![WPF DataGrid column with Custom Renderer](Column-Types_images/wpf-datagrid-custom-renderer.png) +![Column with custom renderer](Column-Types_images/wpf-datagrid-custom-renderer.png) ### Create the renderer of existing column @@ -3073,17 +3073,17 @@ public class DisplayConverter : IValueConverter {% endhighlight %} {% endtabs %} -![WPF DataGrid with MultiSelect ComboBox](Column-Types_images/wpf-datagrid-multiselect-combobox.png) +![MultiSelect ComboBox](Column-Types_images/wpf-datagrid-multiselect-combobox.png) ### Creating new column and renderer You can create a new column by deriving [GridColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html), rendered in UI using customized [CellType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_CellType) using [GridVirtualizingCellRenderer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Cells.GridVirtualizingCellRenderer-2.html). -Below steps to create custom column in SfDataGrid. +Below steps to create custom column in the control. * [Creating custom column.](#creating-custom-column) * [Creating renderer.](#creating-renderer) -* [Adding the custom renderer to SfDataGrid.CellRenderers collection.](#adding-the-custom-renderer-to-sfdatagridcellrenderers-collection) +* [Adding the custom renderer to the CellRenderers collection.](#adding-the-custom-renderer-to-sfdatagridcellrenderers-collection) * [Defining custom column.](#loading-custom-column) #### Creating custom column @@ -3433,7 +3433,7 @@ dataGrid.CellRenderers.Add("DatePickerRenderer", new DatePickerRenderer()); #### Loading custom column -By below code, you can define the custom column in SfDataGrid. +By below code, you can define the custom column in the control. {% tabs %} {% highlight xaml %} @@ -3450,7 +3450,7 @@ this.dataGrid.Columns.Add(new DatePickerColumn() {AllowEditing=true, MappingName {% endhighlight %} {% endtabs %} -![WPF DataGrid with DatePicker Control](Column-Types_images/wpf-datagrid-with-datepicker.png) +![DatePicker control](Column-Types_images/wpf-datagrid-with-datepicker.png) ## How To diff --git a/wpf/DataGrid/Columns.md b/wpf/DataGrid/Columns.md index a50153764..a133136e9 100644 --- a/wpf/DataGrid/Columns.md +++ b/wpf/DataGrid/Columns.md @@ -9,9 +9,9 @@ documentation: ug # Columns in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) allows you to add or remove columns using [SfDataGrid.Columns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Columns) property. You can choose the columns to be added from built-in column types or you can create your own column and add to the `SfDataGrid.Columns`. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) allows you to add or remove columns using [SfDataGrid.Columns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Columns) property. You can choose the columns to be added from built-in column types, or you can create your own column and add it to the `SfDataGrid.Columns`. -Below are the built-in column types supported in SfDataGrid. Each column has its own properties to handle different types of data. +Below are the built-in column types supported in Data Grid. Each column has its own properties to handle different types of data. @@ -138,7 +138,7 @@ Use to display the IEnumerable data using SfMultiColumnDropdownControl. ## Defining columns -You can let the SfDataGrid to create columns or you can manually define columns to be displayed. Below sections explains both ways, +You can let Data Grid create the columns, or you can manually define the columns to be displayed. The sections below explain both approaches. 1. Automatically generating columns 2. Manually define columns @@ -209,7 +209,7 @@ GridTimeSpanColumn
-N> The order of columns in the collection will determine the order of that they will appear in SfDataGrid. +N> The order of columns in the collection determines the order in which they will appear in Data Grid. #### AutoGenerateColumns with different modes @@ -271,7 +271,7 @@ Clear all the columns including the columns defined manually and creates new col Columns will not be generated. -Keeps old columns in DataGrid.Columns collection. +Keeps old columns in the Data Grid Columns collection. @@ -338,7 +338,7 @@ Specifies that the column for only the custom type will be auto generated. You can download the sample demo [here](https://github.com/SyncfusionExamples/how-to-auto-generate-columns-for-custom-type-properties-in-uwp-and-wpf-datagrid) . -#### Customize auto-generated columns in DataGrid +#### Customize auto-generated columns in Data Grid You can customize or cancel the generated column by handling [AutoGeneratingColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGeneratingColumn) event. `AutoGeneratingColumn` event occurs when the individual column is auto-generated for public and non-static property of underlying data object. @@ -356,7 +356,7 @@ void dataGrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) ##### Cancel column generation for particular property -You can cancel the specific column adding to the DataGrid by handling `AutoGeneratingColumn` event. +You can cancel a specific column being added to Data Grid by handling the `AutoGeneratingColumn` event. In the below code, column generation for `OrderID` property is canceled by setting `Cancel` property to `true`. @@ -375,7 +375,7 @@ void dataGrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) ##### Changing column type -You can change the type of column adding to SfDataGrid by setting the instance of column you want to add in `AutoGeneratingColumn` event. +You can change the type of column added to Data Grid by setting the instance of the column you want to add in the `AutoGeneratingColumn` event. In the below code, column type for `UnitPrice` property is changed to `GridTextColumn` by setting instance of GridTextColumn to `Column` property. @@ -452,11 +452,11 @@ void dataGrid_AutoGeneratingColumn(object sender, AutoGeneratingColumnArgs e) Below screenshot shows the customized header template loaded on the header of OrderID column. -![WPF DataGrid Loaded with Customized Header Template](columns_images/wpf-datagrid-header-template.png) +![Loaded with Customized Header Template](columns_images/wpf-datagrid-header-template.png) #### Data Annotations with AutoGenerateColumns -WPF DataGrid (SfDataGrid) support to generate the columns based on built-in [Data Annotation Attributes](https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc490428(v=vs.95)). Data Annotations ignored, when the `AutoGenerateColumns` is set to False. +WPF Data Grid (SfDataGrid) supports generating the columns based on built-in [Data Annotation Attributes](https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc490428(v=vs.95)). Data Annotations are ignored when `AutoGenerateColumns` is set to `False`. ##### Exclude column @@ -547,9 +547,9 @@ public string CustomerID The OrderID and CustomerID column rearranged based on specified order. -![Changing Columns Order in WPF DataGrid](columns_images/wpf-datagrid-columns-order.png) +![Changing Columns Order](columns_images/wpf-datagrid-columns-order.png) -##### DataGrid column formatting +##### Data Grid column formatting You can customize the data format using `DataTypeAttribute.DataType` property. @@ -565,7 +565,7 @@ public double UnitPrice {% endhighlight %} {% endtabs %} -##### DataGrid read-only column +##### Data Grid read-only column You can disable the editing for a column using `ReadOnly` attribute. @@ -581,9 +581,9 @@ public string Country {% endhighlight %} {% endtabs %} -##### Format datagrid columns using DisplayFormat attribute +##### Format Data Grid columns using DisplayFormat attribute -The auto-generated columns will be formatted using the [DataFormatString](https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc679306%28v%3dvs.95%29) property in the [DisplayFormat](https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc679253%28v%3dvs.95%29) attribute when the `DisplayFormat` attribute is defined for the properties defined in the view model. If the `DisplayFormat` attribute is defined with the `DataFormatString` property, the DataGrid formats the column only based on `DataFormatString`, without considering other formatting property settings of columns. +The auto-generated columns will be formatted using the [DataFormatString](https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc679306%28v%3dvs.95%29) property in the [DisplayFormat](https://learn.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc679253%28v%3dvs.95%29) attribute when the `DisplayFormat` attribute is defined for the properties defined in the view model. If the `DisplayFormat` attribute is defined with the `DataFormatString` property, Data Grid formats the column only based on `DataFormatString`, without considering other formatting property settings of columns. {% tabs %} {% highlight c# %} @@ -605,11 +605,11 @@ public DateTime OrderDate N> The `DataFormatString` attribute will be considered only when the column is auto-generated. -![WPF DataGrid with Columns Formatting](columns_images/wpf-datagrid-columns-formatting.png) +![Columns Formatting](columns_images/wpf-datagrid-columns-formatting.png) ### Manually defining columns -WPF DataGrid (SfDataGrid) control allows you to define the columns manually by adding desired column to the [SfDataGrid.Columns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Columns) collection. +WPF Data Grid (SfDataGrid) control allows you to define the columns manually by adding the desired column to the [SfDataGrid.Columns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Columns) collection. {% tabs %} {% highlight xaml %} @@ -640,7 +640,7 @@ You can refer more information about handling the column level operations for ma You can get the columns (added or auto-generated) from [SfDataGrid.Columns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Columns) property. -### Adding column to DataGrid +### Adding column to Data Grid You can add column at runtime by adding instance of column to `SfDataGrid.Columns` property. @@ -662,7 +662,7 @@ GridColumn column = this.dataGrid.Columns["OrderID"]; {% endhighlight %} {% endtabs %} -### Clearing or removing column in DataGrid +### Clearing or removing column in Data Grid You can remove all the columns by clearing the `SfDataGrid.Columns` property. @@ -699,9 +699,9 @@ foreach (var name in childColumns) {% endhighlight %} {% endtabs %} -## DataGrid column resizing +## Data Grid column resizing -SfDataGrid allows to resize the columns like in excel by resizing column header. This can be enabled or disabled by setting [SfDataGrid.AllowResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowResizingColumns) or [GridColumn.AllowResizing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_AllowResizing) property. +Data Grid allows you to resize the columns like in Excel by resizing the column header. This can be enabled or disabled by setting the [SfDataGrid.AllowResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowResizingColumns) or [GridColumn.AllowResizing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_AllowResizing) property. N> Resizing considers MinWidth and MaxWidth of column. @@ -716,13 +716,13 @@ N> Resizing considers MinWidth and MaxWidth of column. You can change the column width by clicking and dragging the resizing cursor at the edge of column header. The resizing cursor appears when you hover the grid line exists between two columns. -![Column Resizing in WPF DataGrid](columns_images/wpf-datagrid-resize-column.png) +![Column Resizing](columns_images/wpf-datagrid-resize-column.png) ### Hidden column resizing -SfDataGrid shows indication for hidden columns in column header and also allows end-users to resize the hidden columns when setting [SfDataGrid.AllowResizingHiddenColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowResizingHiddenColumns) property to `true`. +Data Grid shows an indication for hidden columns in the column header and also allows end-users to resize the hidden columns when the [SfDataGrid.AllowResizingHiddenColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowResizingHiddenColumns) property is set to `true`. -![Resizing Hidden Column in WPF DataGrid](columns_images/wpf-datagrid-resize-hidden-column.png) +![Resizing Hidden Column](columns_images/wpf-datagrid-resize-hidden-column.png) ### Disable resizing @@ -744,7 +744,7 @@ void dataGrid_ResizingColumns(object sender, ResizingColumnsEventArgs e) ### Identify resizing of the column gets completed -SfDataGrid allows you to identify the progress of the resizing of columns through [ResizingColumnsEventArgs.Reason](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ResizingColumnsEventArgs.html#Syncfusion_UI_Xaml_Grid_ResizingColumnsEventArgs_Reason) property. You can get the width of the column after resizing completed by getting [ResizingColumnsEventArgs.Width](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ResizingColumnsEventArgs.html#Syncfusion_UI_Xaml_Grid_ResizingColumnsEventArgs_Width) when `ResizingColumnsEventArgs.Reason` is [ColumnResizingReason.Resized](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ColumnResizingReason.html) in [ResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. +Data Grid allows you to identify the progress of the resizing of columns through the [ResizingColumnsEventArgs.Reason](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ResizingColumnsEventArgs.html#Syncfusion_UI_Xaml_Grid_ResizingColumnsEventArgs_Reason) property. You can get the width of the column after resizing is completed by getting the [ResizingColumnsEventArgs.Width](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ResizingColumnsEventArgs.html#Syncfusion_UI_Xaml_Grid_ResizingColumnsEventArgs_Width) when `ResizingColumnsEventArgs.Reason` is [ColumnResizingReason.Resized](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ColumnResizingReason.html) in the [ResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. {% tabs %} {% highlight c# %} @@ -760,7 +760,7 @@ void OnResizingColumns(object sender, ResizingColumnsEventArgs e) {% endhighlight %} {% endtabs %} -## DataGrid column drag and drop +## Data Grid column drag and drop You can allow end-users to rearrange the columns by drag and drop the column headers by setting [SfDataGrid.AllowDraggingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowDraggingColumns) to `true`. @@ -915,7 +915,7 @@ void dataGrid_QueryColumnDragging(object sender, QueryColumnDraggingEventArgs e) N> `FrozenColumnCount` and `FooterColumnCount` should be lesser than the number of Columns that can be displayed in View. -## DataGrid freeze columns +## Data Grid freeze columns You can freeze the columns in view at the left and right side like in excel by setting [SfDataGrid.FrozenColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_FrozenColumnCount) and [SfDataGrid.FooterColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_FooterColumnCount) properties. @@ -928,15 +928,15 @@ You can freeze the columns in view at the left and right side like in excel by s {% endhighlight %} {% endtabs %} -![Freezing Columns in WPF DataGrid](columns_images/wpf-datagrid-freezing.png) +![Freezing Columns](columns_images/wpf-datagrid-freezing.png) ### Limitations -1. SfDataGrid has support to freeze the number of columns from the left or right. There is no support to freeze a specific column. +1. Data Grid has support to freeze the number of columns from the left or right. There is no support to freeze a specific column. ## Binding column properties with ViewModel -SfDataGrid provides MVVM support for binding `GridColumn` properties with ViewModel properties +Data Grid provides MVVM support for binding `GridColumn` properties with ViewModel properties . {% tabs %} {% highlight c# %} @@ -971,5 +971,5 @@ Below code, binds the `ViewModel.AllowFiltering` property to `GridColumn.AllowFi {% endhighlight %} {% endtabs %} -![WPF DataGrid Column with Data Binding](columns_images/wpf-datagrid-data-binding-columns.png) +![Column with Data Binding](columns_images/wpf-datagrid-data-binding-columns.png) diff --git a/wpf/DataGrid/Conditional-Styling.md b/wpf/DataGrid/Conditional-Styling.md index a02cb4e55..941ecb66c 100644 --- a/wpf/DataGrid/Conditional-Styling.md +++ b/wpf/DataGrid/Conditional-Styling.md @@ -9,7 +9,7 @@ documentation: ug # Conditional Styling in WPF Data Grid -You can style the [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) and its inner elements (cells, rows and columns) conditionally based on data in three ways, +You can style the [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) and its inner elements (cells, rows and columns) conditionally based on data in three ways, 1. Using Converter 2. Using Data Triggers @@ -100,7 +100,7 @@ public class ColorConverter : IValueConverter {% endhighlight %} {% endtabs %} -![Conditional Cell Styling of WPF DataGrid based on Data using Converter](Conditional-Styling_images/wpf-datagrid-conditional-cell-style.png) +![Conditional Cell Styling based on Data using Converter](Conditional-Styling_images/wpf-datagrid-conditional-cell-style.png) ### Condition styling of cells based on record using converter @@ -147,7 +147,7 @@ public class ColorConverter : IValueConverter {% endhighlight %} {% endtabs %} -![Conditional Cell Styling of WPF DataGrid based on Record using Converter](Conditional-Styling_images/wpf-datagrid-conditional-style-for-record.png) +![Conditional Cell Styling based on Record using Converter](Conditional-Styling_images/wpf-datagrid-conditional-style-for-record.png) ### Conditional styling of cells using triggers @@ -180,7 +180,7 @@ The record cells ([GridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xa Here, GridCell’s are conditionally customized based on `OrderID` value. -![Conditional Style of WPF DataGrid Cells using Triggers](Conditional-Styling_images/wpf-datagrid-conditional-style-for-cell.png) +![Conditional Style of Cells using Triggers](Conditional-Styling_images/wpf-datagrid-conditional-style-for-cell.png) ### Conditional styling of cells using style selector @@ -228,7 +228,7 @@ public class SelectorClass : StyleSelector Here, GridCell’s are customized based on `TotalPrice` property of underlying record. -![Conditional Style of WPF DataGrid Cell based on Data using Style Selector](Conditional-Styling_images/wpf-datagrid-cell-style-using-style-selector.png) +![Conditional Style of Cell based on Data using Style Selector](Conditional-Styling_images/wpf-datagrid-cell-style-using-style-selector.png) ## Row style @@ -278,7 +278,7 @@ public class ColorConverter : IValueConverter Here, rows are customized based on `TotalPrice` property of underlying record. -![Conditional Style of WPF DataGrid Rows based on Data using Converter](Conditional-Styling_images/wpf-datagrid-row-style.png) +![Conditional Style of Rows based on Data using Converter](Conditional-Styling_images/wpf-datagrid-row-style.png) ### Conditional styling of rows using style selector @@ -322,7 +322,7 @@ public class CustomRowStyleSelector : StyleSelector Here, rows are customized based on `TotalPrice` property of underlying record. -![Conditional Style of WPF DataGrid Rows based on Data using Style Selector](Conditional-Styling_images/wpf-datagrid-row-style-selector.png) +![Conditional Style of Rows based on Data using Style Selector](Conditional-Styling_images/wpf-datagrid-row-style-selector.png) ## Alternate row style @@ -368,7 +368,7 @@ public class CustomRowStyleSelector : StyleSelector Here, alternating rows are customized based on `OrderID` property of underlying record. -![Customizing Alternate Row Style in WPF DataGrid](Conditional-Styling_images/wpf-datagrid-alternate-row-style.png) +![Customizing Alternate Row Style](Conditional-Styling_images/wpf-datagrid-alternate-row-style.png) ## Caption summary cell style @@ -431,7 +431,7 @@ public class ColorConverter : IValueConverter Here, caption summary cells are customized based on `TotalPrice` summary value. -![Customizing Caption Summary Cells using Converter in WPF DataGrid](Conditional-Styling_images/wpf-datagrid-caption-summary-cell-style.png) +![Customizing Caption Summary Cells using Converter](Conditional-Styling_images/wpf-datagrid-caption-summary-cell-style.png) ### Conditional styling of caption summary cells using style selector @@ -492,7 +492,7 @@ public class SelectorClass : StyleSelector Here, caption summary cells are customized based on `TotalPrice` summary value. -![Customizing Caption Summary Cells using Style Selector in WPF DataGrid](Conditional-Styling_images/wpf-datagrid-caption-summary-cells-style.png) +![Customizing Caption Summary Cells using Style Selector](Conditional-Styling_images/wpf-datagrid-caption-summary-cells-style.png) ### Conditional styling of caption summary cell based on column @@ -556,7 +556,7 @@ public class SelectorClass : StyleSelector {% endhighlight %} {% endtabs %} -![Customizing Caption Summary Cell based on Column in WPF DataGrid](Conditional-Styling_images/wpf-datagrid-cell-style-based-on-column.png) +![Customizing Caption Summary Cell based on Column](Conditional-Styling_images/wpf-datagrid-cell-style-based-on-column.png) ## Caption summary row style @@ -619,7 +619,7 @@ public class ColorConverter : IValueConverter Here, caption summary rows are customized based on `TotalPrice` summary value. -![Customizing Caption Summary Rows using Converter in WPF DataGrid](Conditional-Styling_images/wpf-datagrid-caption-summary-rows.png) +![Customizing Caption Summary Rows using Converter](Conditional-Styling_images/wpf-datagrid-caption-summary-rows.png) ### Conditional styling of caption summary row using style selector @@ -677,7 +677,7 @@ public class SelectorClass : StyleSelector Here, caption summary rows are customized based on `TotalPrice` summary value. -![Customizing Caption Summary Rows using Style Selector in WPF DataGrid](Conditional-Styling_images/wpf-datagrid-summary-rows-style.png) +![Customizing Caption Summary Rows using Style Selector](Conditional-Styling_images/wpf-datagrid-summary-rows-style.png) ### Conditional styling of caption summary row based on group level @@ -737,7 +737,7 @@ public class CustomCaptionSummaryRowStyleSelector : StyleSelector Here, caption summary rows are customized based on `grouping level` (example: level1, level2, level3, etc.). -![Conditional Style of WPF DataGrid Caption Summary Row based on GroupLevel](Conditional-Styling_images/wpf-datagrid-group-level-cell-style.png) +![Conditional Style of Caption Summary Row based on GroupLevel](Conditional-Styling_images/wpf-datagrid-group-level-cell-style.png) ## Group summary cell style @@ -810,7 +810,7 @@ public class ColorConverter : IValueConverter Here, group summary cells are customized based on `TotalPrice` summary value. -![Conditional Style of WPF DataGrid Group Summary Cell using Converter](Conditional-Styling_images/wpf-datagrid-group-summary-cell-style.png) +![Conditional Style of Group Summary Cell using Converter](Conditional-Styling_images/wpf-datagrid-group-summary-cell-style.png) ### Conditional styling of group summary cell using style selector @@ -884,7 +884,7 @@ public class SelectorClass : StyleSelector Here, group summary cells are customized based on `TotalPrice` summary value. -![Conditional Style of WPF DataGrid Group Summary Cell using Style Selector](Conditional-Styling_images/wpf-datagrid-group-summary-cell-styles.png) +![Conditional Style of Group Summary Cell using Style Selector](Conditional-Styling_images/wpf-datagrid-group-summary-cell-styles.png) ### Conditional styling of group summary cell based on column @@ -960,7 +960,7 @@ public class SelectorClass : StyleSelector {% endhighlight %} {% endtabs %} -![Conditional Style of WPF DataGrid Group Summary Cell based on Column](Conditional-Styling_images/wpf-datagrid-summary-cell-style-based-on-column.png) +![Conditional Style of Group Summary Cell based on Column](Conditional-Styling_images/wpf-datagrid-summary-cell-style-based-on-column.png) ## Group summary row style @@ -1033,7 +1033,7 @@ public class ColorConverter : IValueConverter Here, group summary rows are customized based on `TotalPrice` summary value. -![Conditional Style of WPF DataGrid Group Summary Row using Converter](Conditional-Styling_images/wpf-datagrid-group-summary-row-style.png) +![Conditional Style of Group Summary Row using Converter](Conditional-Styling_images/wpf-datagrid-group-summary-row-style.png) ### Conditional styling of group summary row using style selector @@ -1106,7 +1106,7 @@ public class SelectorClass : StyleSelector Here, group summary rows are customized based on `TotalPrice` summary value whether it’s positive or negative. -![Conditional Style of WPF DataGrid Group Summary Row using Style Selector](Conditional-Styling_images/wpf-datagrid-group-summary-rows.png) +![Conditional Style of Group Summary Row using Style Selector](Conditional-Styling_images/wpf-datagrid-group-summary-rows.png) ## Table summary cell @@ -1187,7 +1187,7 @@ public class ColorConverter : IValueConverter Here, table summary cells are customized based on `TotalPrice` summary value. -![Conditional Style of WPF DataGrid Table Summary Cells using Converter](Conditional-Styling_images/wpf-datagrid-table-summary-cell-style.png) +![Conditional Style of Table Summary Cells using Converter](Conditional-Styling_images/wpf-datagrid-table-summary-cell-style.png) ### Conditional styling of table summary cell using style selector @@ -1264,7 +1264,7 @@ public class SelectorClass : StyleSelector Here, table summary cells are customized based on `TotalPrice` summary value. -![Conditional Style of WPF DataGrid Table Summary Cells using Style Selector](Conditional-Styling_images/wpf-datagrid-table-summary-cell-styles.png) +![Conditional Style of Table Summary Cells using Style Selector](Conditional-Styling_images/wpf-datagrid-table-summary-cell-styles.png) ### Conditional styling of table summary cell based on column @@ -1338,7 +1338,7 @@ public class SelectorClass : StyleSelector {% endhighlight %} {% endtabs %} -![Conditional Style of WPF DataGrid Table Summary Cell based on Column](Conditional-Styling_images/wpf-datagrid-table-summary-cell-based-on-column.png) +![Conditional Style of Table Summary Cell based on Column](Conditional-Styling_images/wpf-datagrid-table-summary-cell-based-on-column.png) ## Table summary row style @@ -1389,7 +1389,7 @@ public class ColorConverter : IValueConverter Here, table summary rows are customized based on `TotalPrice` summary value. -![Conditional Style of WPF DataGrid Table Summary Row using Converter](Conditional-Styling_images/wpf-datagrid-table-summary-row-syle.png) +![Conditional Style of Table Summary Row using Converter](Conditional-Styling_images/wpf-datagrid-table-summary-row-syle.png) ### Conditional styling of table summary row using style selector @@ -1470,7 +1470,7 @@ public class SelectorClass : StyleSelector Here, table summary rows are customized based on `TotalPrice` summary value. -![Conditional Style of WPF DataGrid Table Summary Row using Style Selector](Conditional-Styling_images/wpf-datagrid-table-summary-row-styles.png) +![Conditional Style of Table Summary Row using Style Selector](Conditional-Styling_images/wpf-datagrid-table-summary-row-styles.png) ## Table summary cell alignment based on column @@ -1548,7 +1548,7 @@ public class TableSummaryStyleSelector : StyleSelector Here, horizontal alignment of `TotalPrice` column alone left, other column horizontal alignment are changed into right. -![Customizing Summary Column Alignment of WPF DataGrid](Conditional-Styling_images/wpf-datagrid-summary-column-alignment.png) +![Customizing Summary Column Alignment](Conditional-Styling_images/wpf-datagrid-summary-column-alignment.png) ## Row header style @@ -1598,5 +1598,5 @@ public class ColorConverter : IValueConverter {% endhighlight %} {% endtabs %} -![Customizing Row Header Cell Style in WPF DataGrid](Conditional-Styling_images/wpf-datagrid-row-header-cell-style.png) +![Customizing Row Header Cell Style](Conditional-Styling_images/wpf-datagrid-row-header-cell-style.png) diff --git a/wpf/DataGrid/Data-Binding.md b/wpf/DataGrid/Data-Binding.md index 19faa8d5f..65202b1c8 100644 --- a/wpf/DataGrid/Data-Binding.md +++ b/wpf/DataGrid/Data-Binding.md @@ -9,7 +9,7 @@ documentation: ug # Data Binding in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) control is designed to display the bounded data in a tabular format. The data binding can be achieved by assigning the data sources to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) control is designed to display the bounded data in a tabular format. The data binding can be achieved by assigning the data sources to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property. {% tabs %} {% highlight xaml %} @@ -19,20 +19,20 @@ documentation: ug {% endhighlight %} {% endtabs %} -If the data source implements [INotifyCollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.inotifycollectionchanged?view=net-7.0) interface, then SfDataGrid control will automatically refresh the UI when item is added, removed or while list cleared. +If the data source implements [INotifyCollectionChanged](https://learn.microsoft.com/en-us/dotnet/api/system.collections.specialized.inotifycollectionchanged?view=net-7.0) interface, then the Data Grid control will automatically refresh the UI when item is added, removed or while list cleared. -When you add, remove item in [ObservableCollection](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1?view=net-7.0), SfDataGrid automatically refresh the UI as `ObservableCollection` implements `INotifyCollectionChanged`. But when you do the same in [List](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1?view=net-7.0), SfDataGrid will not refresh the UI automatically. +When you add, remove item in [ObservableCollection](https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.observablecollection-1?view=net-7.0), the Data Grid automatically refreshes the UI as `ObservableCollection` implements `INotifyCollectionChanged`. But when you do the same in [List](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1?view=net-7.0), the control will not refresh the UI automatically. ## Binding with IEnumerable -WPF DataGrid (SfDataGrid) control supports to bind any collection that implements the [IEnumerable](https://learn.microsoft.com/en-us/dotnet/api/system.collections.ienumerable?view=net-7.0) interface. All the data operations such as sorting, grouping, filtering, summaries are supported when you are binding collection derived from IEnumerable. +The WPF Data Grid control supports to bind any collection that implements the [IEnumerable](https://learn.microsoft.com/en-us/dotnet/api/system.collections.ienumerable?view=net-7.0) interface. All the data operations such as sorting, grouping, filtering, summaries are supported when you are binding collection derived from IEnumerable. ## Binding with DataTable -WPF DataGrid (SfDataGrid) control supports to bind the [DataTable](https://learn.microsoft.com/en-us/dotnet/api/system.data.datatable?view=net-7.0). SfDataGrid control automatically refresh the UI when you are binding DataTable as ItemsSource when rows are added, removed or cleared. +The WPF Data Grid control supports to bind the [DataTable](https://learn.microsoft.com/en-us/dotnet/api/system.data.datatable?view=net-7.0). The control automatically refreshes the UI when you are binding DataTable as ItemsSource and rows are added, removed, or cleared. -Below are the limitations when binding DataTable as ItemsSource to SfDataGrid. +Below are the limitations when binding DataTable as ItemsSource to the Data Grid. * [GridUnboundColumn.Expression](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundColumn.html#Syncfusion_UI_Xaml_Grid_GridUnBoundColumn_Expression) is not supported. You can achieve the expression support when binding DataTable using [DataColumn](https://learn.microsoft.com/en-us/dotnet/api/system.data.datacolumn?view=net-7.0) of DataTable by setting [DataColumn.Expression](https://learn.microsoft.com/en-us/dotnet/api/system.data.datacolumn.expression?view=net-7.0) property. * `AddNewRow` is not support when filtering is enabled. @@ -49,16 +49,16 @@ When DataTable is bounded as `SfDataGrid.ItemsSource`, the [DataView.RowFilter]( ## Binding with dynamic data object -WPF DataGrid (SfDataGrid) control supports to bind [dynamic data object](https://learn.microsoft.com/en-us/dotnet/api/system.dynamic?view=net-7.0). Below are the limitations when you are binding dynamic data object, +The WPF Data Grid control supports to bind [dynamic data object](https://learn.microsoft.com/en-us/dotnet/api/system.dynamic?view=net-7.0). Below are the limitations when you are binding dynamic data object, -1. SfDataGrid doesn’t support [LiveDataUpdateMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LiveDataUpdateMode) - `AllowDataShaping` and `AllowSummaryUpdate`. +1. The Data Grid doesn’t support [LiveDataUpdateMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LiveDataUpdateMode) - `AllowDataShaping` and `AllowSummaryUpdate`. 2. In WinRT, UI won’t get refreshed when you are changing the property value. This is limitation in WinRT platform. All the data operations (sorting, grouping, filtering and etc.) are supported when you are binding dynamic data object. If the data operations are not working as expected, set [SfDataGrid.IsDynamicItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_IsDynamicItemsSource) property as `true` . ## Binding Complex properties -SfDataGrid control provides support to bind complex property to its columns. To bind the complex property to [GridColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html), set the complex property path to [MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_MappingName). +The Data Grid control provides support to bind complex property to its columns. To bind the complex property to [GridColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html), set the complex property path to [MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_MappingName). {% tabs %} {% highlight xaml %} @@ -76,11 +76,11 @@ All the data operations (sorting, grouping, filtering and etc.) are supported wh ### Limitations when binding complex property -* SfDataGrid doesn’t support [LiveDataUpdateMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LiveDataUpdateMode) - `AllowDataShaping` and `AllowSummaryUpdate`. +* The control doesn’t support [LiveDataUpdateMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LiveDataUpdateMode) - `AllowDataShaping` and `AllowSummaryUpdate`. ## Binding Indexer properties -SfDataGrid control provides support to bind an indexer property to its columns. To bind an indexer property to [GridColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html), set the indexer property path to [MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_MappingName). +The control provides support to bind an indexer property to its columns. To bind an indexer property to [GridColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html), set the indexer property path to [MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_MappingName). {% tabs %} {% highlight xaml %} @@ -101,13 +101,13 @@ All the data operations (sorting, grouping, filtering and etc.) are supported wh ### Limitations when binding indexer property -* SfDataGrid doesn’t support [LiveDataUpdateMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LiveDataUpdateMode) - `AllowDataShaping` and `AllowSummaryUpdate`. -* SfDataGrid doesn’t support [AutoGenerateColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AutoGenerateColumns). +* The control doesn’t support [LiveDataUpdateMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LiveDataUpdateMode) - `AllowDataShaping` and `AllowSummaryUpdate`. +* The control doesn’t support [AutoGenerateColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AutoGenerateColumns). ## Defining source data type -Based on type of data item bound to SfDataGrid, the data operations and column auto generation are carried out. You can specify the type of underlying data item explicitly for doing data operation by setting [SfDataGrid.SourceType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SourceType) property. +Based on type of data item bound to Data Grid, the data operations and column auto generation are carried out. You can specify the type of underlying data item explicitly for doing data operation by setting [SfDataGrid.SourceType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SourceType) property. {% tabs %} {% highlight xaml %} @@ -135,13 +135,13 @@ The [GridItemsSourceChangedEventArgs ](https://help.syncfusion.com/cr/wpf/Sync ## View -WPF DataGrid has the View property of type [ICollectionViewAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.ICollectionViewAdv.html) interface that implements ICollectionView interface. View is responsible for maintain and manipulation data and other advanced operations like Sorting, Grouping, Filtering and etc. +The Data Grid has a View property of type [ICollectionViewAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.ICollectionViewAdv.html) interface that implements ICollectionView interface. View is responsible for maintain and manipulation data and other advanced operations like Sorting, Grouping, Filtering and etc. -When you bind Collection to `ItemsSource` property of SfDataGrid, then View will be created and maintains the operations on Data such as Grouping, Filtering, Sorting, Insert, Delete, and Modification. +When you bind Collection to `ItemsSource` property of the Data Grid, then View will be created and maintains the operations on Data such as Grouping, Filtering, Sorting, Insert, Delete, and Modification. Following are some important properties that can be used for various purposes. -N> DataGrid creates different types of views derived from `ICollectionViewAdv` interface based on ItemsSource. +N> The control creates different types of views derived from `ICollectionViewAdv` interface based on ItemsSource. @@ -277,7 +277,7 @@ N> View has properties that already defined in SfDataGrid. It recommended settin ## Binding data from WCF service -In this walkthrough, you will learn about how to create a WCF service and load it to SfDataGrid control.  +In this walkthrough, you will learn about how to create a WCF service and load it to Data Grid control. Below are the topics, 1. Creating the WCF data service @@ -381,9 +381,9 @@ To add service reference to client application, ### Loading data from WCF service -To load the data from WCF service to SfDataGrid, +To load the data from WCF service to the Data Grid, -1. Add SfDataGrid control and the required assemblies in your WPF application. +1. Add the Data Grid control and the required assemblies in your WPF application. 2. Wire the **SfDataGrid.Loaded** event and set the northwindEntities.Order_Details table to `SfDataGrid.ItemsSource`. 3. Replace local host address as URI of your service. You can get the local host address from the shortcut menu of the “WcfDataService1.svc” file in Solution Explorer and select **View** in Browser. Internet Explorer opens and the XML schema for the service is displayed. 4. Copy the localhost address and replace it in your service URI. @@ -404,12 +404,12 @@ void dataGrid_Loaded(object sender, RoutedEventArgs e) {% endcapture %} {{ codesnippet2 | OrderList_Indent_Level_1 }} -Now, run the application and you can see the SfDataGrid control loaded with data from WCF service. +Now, run the application and you can see the Data Grid control loaded with data from WCF service. ## Binding data from ADO.NET Entity Framework -SfDataGrid control supports to bind data from ADO.NET Entity Framework. In this walk-through, you will learn about binding data from ADO.NET Entity Framework and save back the changes to the database. You can download the entire source code of this demo from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/ADO.Net_EntityFrmeworkDemo-1459994268.zip). +The Data Grid control supports to bind data from ADO.NET Entity Framework. In this walk-through, you will learn about binding data from ADO.NET Entity Framework and save back the changes to the database. You can download the entire source code of this demo from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/ADO.Net_EntityFrmeworkDemo-1459994268.zip). To load the data from ADO.NET Entity Framework, you can refer the steps mentioned in below follow the below steps, @@ -427,7 +427,7 @@ References : ### Creating WPF client Application -To load data from Entity Framework, create a new WPF Application and add the SfDataGrid control to your application. +To load data from Entity Framework, create a new WPF Application and add the Data Grid control to your application. ### Defining Data Model using Entity Framework 4.0 @@ -482,7 +482,7 @@ public class ViewModel {% endhighlight %} {% endtabs %} -To populate the SfDataGrid using Entity Framework, bind the collection created in previous step to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property and set the `DataContext` as ViewModel. +To populate the data grid using Entity Framework, bind the collection created in previous step to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property and set the `DataContext` as ViewModel. {% tabs %} {% highlight xaml %} @@ -493,10 +493,10 @@ To populate the SfDataGrid using Entity Framework, bind the collection created i {% endhighlight %} {% endtabs %} -Now, run the application and you can see the following screenshot shows the SfDataGrid control populated with data from Entity Framework data service. +Now, run the application and you can see the following screenshot shows the control populated with data from Entity Framework data service.
- ![WPF DataGrid binds data from Entity Framework](Data-Binding_images/Data-Binding_img11.png) + ![Binds data from Entity Framework](Data-Binding_images/Data-Binding_img11.png) ### Save back to Database @@ -533,12 +533,12 @@ void dataGrid_RowValidated(object sender, Syncfusion.UI.Xaml.Grid.RowValidatedEv ## Binding data from LINQ to SQL -SfDataGrid control supports to bind data from LINQ to SQL .In this walkthrough, you will learn about binding data from LINQ to SQL and save back the changes to the Database. +The Data Grid control supports to bind data from LINQ to SQL .In this walkthrough, you will learn about binding data from LINQ to SQL and save back the changes to the Database. 1. Creating WPF Application 2. Adding data model using LINQ to SQL classes 3. Loading data from LINQ to SQL classes -4. Binding data to SfDataGrid +4. Binding data to the Data Grid References : @@ -548,7 +548,7 @@ References : ### Creating WPF Client Application -To add LINQ to SQL, create a new WPF application and add the SfDataGrid control in your application. +To add LINQ to SQL, create a new WPF application and add the Data Grid control in your application. ### Adding data model using LINQ to SQL @@ -584,7 +584,7 @@ To create data model using LINQ to SQL in WPF project follow the below steps. ### Loading data from LINQ to SQL classes -To load the database created in previous step in to SfDataGrid, create a ViewModel class with Shippers property and it is initialized with Shippers table in Northwind database. +To load the database created in previous step in to the Data Grid, create a ViewModel class with Shippers property and it is initialized with Shippers table in Northwind database. {% tabs %} {% highlight c# %} @@ -611,7 +611,7 @@ public class ViewModel N> NorthwindDataContext is from `Northwind.Designer.cs` file (it is from the file that is added with LINQ to SQL). Shippers are selected table from Database. -### Binding data to SfDataGrid +### Binding data to the Data Grid To bind data from LINQ to SQL classes, assign the Shippers collection created in the previous step, to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property and set the `DataContext` as ViewModel. @@ -621,7 +621,7 @@ this.dataGrid.ItemsSource = (this.dataGrid.DataContext as ViewModel).Shippers; {% endhighlight %} {% endtabs %} -Now, run the application and you can see the following screenshot shows the SfDataGrid control loaded with Shippers data. +Now, run the application and you can see the following screenshot shows the control loaded with Shippers data.
![Show the output image of LINQ to SQL project](Data-Binding_images/Data-Binding_img17.png) @@ -654,7 +654,7 @@ void dataGrid_RowValidated(object sender, Syncfusion.UI.Xaml.Grid.RowValidatedEv ## Binding data from ADO.NET -SfDataGrid control supports to load the data using [ADO.NET](https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/insert-update-and-delete-operations). In this walk-through, you will learn about binding data from ADO.NET service and save back the changes to the database. +The Data Grid control supports to load the data using [ADO.NET](https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/insert-update-and-delete-operations). In this walk-through, you will learn about binding data from ADO.NET service and save back the changes to the database. 1. Creating WPF application 2. Connecting database to WPF application @@ -692,7 +692,7 @@ To connect SQL database to your WPF application, refer the below MSDN link or fo To access the data from data source using ADO.NET, follow the below steps. -1. Create a user interface with SfDataGrid control and add the required assemblies to your WPF application. +1. Create a user interface with the Data Grid control and add the required assemblies to your WPF application. 2. Create a connection through any of the [.NET Framework data provider](https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/data-providers) based on the type of data source that you have owned. 3. Set the [ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) as Shippers table from data set. For more information refer [here](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2008/s4yys16a(v=vs.90)). @@ -725,10 +725,10 @@ public partial class MainWindow : Window {% endcapture %} {{ codesnippet3 | OrderList_Indent_Level_1 }} -Now, run the application and you can see the following screenshot displays the SfDataGrid loaded the data using ADO.NET. +Now, run the application and you can see the following screenshot displays the control loaded the data using ADO.NET.
- ![Image shows the output of SfDataGrid loaded with ADO.Net](Data-Binding_images/Data-Binding_img21.png) + ![Image shows the output of loading data with ADO.Net](Data-Binding_images/Data-Binding_img21.png) ### Save back to Database @@ -766,7 +766,7 @@ void dataGrid_RowValidated(object sender, Syncfusion.UI.Xaml.Grid.RowValidatedEv ## Binding data from Microsoft Access -SfDataGrid control supports to bind data from Microsoft Access database .In this section, you will learn about how to bind the data from Microsoft Access database to SfDataGrid. +The Data Grid control supports to bind data from Microsoft Access database .In this section, you will learn about how to bind the data from Microsoft Access database to the control. To load the data from Microsoft Access database, @@ -775,7 +775,7 @@ To load the data from Microsoft Access database, 3. You can connect the Microsoft Access Database through the `OleDbConnection`. 4. Create and open the connection. 5. Use `OleDbDataAdapter` to load the data in to `DataSet`. -6. Access the Employee table from the DataSet and set the Employee collection as `ItemsSource` of SfDataGrid. +6. Access the Employee table from the DataSet and set the Employee collection as `ItemsSource` of the Data Grid. {% capture codesnippet4 %} {% tabs %} @@ -798,15 +798,15 @@ void dataGrid_Loaded(object sender, RoutedEventArgs e) {% endcapture %} {{ codesnippet4 | OrderList_Indent_Level_1 }} -7.Now, run the application and you can see following screenshot shows the SfDataGrid control populated data from Microsoft Access database. +Now, run the application and you can see the following screenshot shows the Data Grid control populated with data from Microsoft Access database.
- ![DataGrid loaded with data from Microsoft Access](Data-Binding_images/Data-Binding_img22.png) + ![Loaded with data from Microsoft Access](Data-Binding_images/Data-Binding_img22.png) ## How To -### Maintain scroll position when changing the ItemsSource for SfDataGrid +### Maintain scroll position when changing the ItemsSource for Data Grid -By default, the scrollbar position is not maintained and gets reset when changing the ItemsSource of the SfDataGrid. But, you can maintain the scrollbar position of the SfDataGrid by setting the [SfDataGrid.CanMaintainScrollPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CanMaintainScrollPosition) value to `true`. +By default, the scrollbar position is not maintained and gets reset when changing the ItemsSource of the Data Grid. But, you can maintain the scrollbar position of the control by setting the [SfDataGrid.CanMaintainScrollPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CanMaintainScrollPosition) value to `true`. {% tabs %} {% highlight xaml %} diff --git a/wpf/DataGrid/Data-Manipulation.md b/wpf/DataGrid/Data-Manipulation.md index 214b3426b..17f169b21 100644 --- a/wpf/DataGrid/Data-Manipulation.md +++ b/wpf/DataGrid/Data-Manipulation.md @@ -9,11 +9,11 @@ documentation: ug # CRUD Operations in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) listens and responds to the CRUD operations such as add, delete and data update (property change) at runtime. Also, it supports [editing](https://help.syncfusion.com/wpf/datagrid/editing), [add new row](https://help.syncfusion.com/wpf/datagrid/data-manipulation#built-in-addnewrow), [delete row](https://help.syncfusion.com/wpf/datagrid/data-manipulation#deletion) by pressing Delete key. +The [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) listens and responds to the CRUD operations such as add, delete and data update (property change) at runtime. Also, it supports [editing](https://help.syncfusion.com/wpf/datagrid/editing), [add new row](https://help.syncfusion.com/wpf/datagrid/data-manipulation#built-in-addnewrow), [delete row](https://help.syncfusion.com/wpf/datagrid/data-manipulation#deletion) by pressing Delete key. ## Managing data updates -DataGrid manages the sorting, filtering, grouping and summaries during data updates based on [SfDataGrid.LiveDataUpdateMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LiveDataUpdateMode) property. +The Data Grid manages the sorting, filtering, grouping and summaries during data updates based on the [SfDataGrid.LiveDataUpdateMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LiveDataUpdateMode) property. {% tabs %} {% highlight xaml %} @@ -263,9 +263,9 @@ Updated ## Add new rows -DataGrid provides built-in row (called AddNewRow) that allows user to add new records to underlying collection. Built-in add new row can be enabled or disabled by setting [SfDataGrid.AddNewRowPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowPosition) property. `AddNewRowPosition` also denotes the position of add new row in DataGrid. +The Data Grid provides a built-in row (called AddNewRow) that allows users to add new records to the underlying collection. The built-in add new row can be enabled or disabled by setting the [SfDataGrid.AddNewRowPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowPosition) property. `AddNewRowPosition` also denotes the position of the add new row in the grid. -When you start editing in AddNewRow, the SfDataGrid control creates an instance for the underlying data object and adds it to underlying collection when editing completed. +When you start editing in AddNewRow, the control creates an instance for the underlying data object and adds it to the underlying collection when editing is completed. N> The underlying data object must be defined with default constructor. @@ -282,7 +282,7 @@ this.dataGrid.AddNewRowPosition = AddNewRowPosition.Top; {% endtabs %} -![WPF DataGrid with Add New Row](Data-Manipulation_images/wpf-datagrid-add-new-row.png) +![Add New Row](Data-Manipulation_images/wpf-datagrid-add-new-row.png) You can get the row row index of AddNewRow using [GridAddNewRowController.GetAddNewRowIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridAddNewRowController.html#Syncfusion_UI_Xaml_Grid_GridAddNewRowController_GetAddNewRowIndex) method. @@ -301,9 +301,9 @@ bool isAddNewRowIndex = this.dataGrid.IsAddNewIndex(1); {% endhighlight %} {% endtabs %} -### Changing the AddNewRow default text in DataGrid +### Changing the AddNewRow default text in Data Grid -You can change the default static string of AddNewRow in datagrid by using the [SfDataGrid.AddNewRowText](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowText) property. The `AddNewRowText` property has higher priority than the text that is localized in resx file. +You can change the default static string of AddNewRow in the grid by using the [SfDataGrid.AddNewRowText](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowText) property. The `AddNewRowText` property has higher priority than the text that is localized in the resx file. {% tabs %} {% highlight xaml %} @@ -318,11 +318,11 @@ this.dataGrid.AddNewRowText = "Click here to add new row in datagrid"; {% endhighlight %} {% endtabs %} -![Changing the Add New Row Text in WPF DataGrid](Data-Manipulation_images/wpf-datagrid-add-new-row-text.png) +![Changing the Add New Row Text](Data-Manipulation_images/wpf-datagrid-add-new-row-text.png) ### Customize the newly added row position -SfDataGrid adds new data item from AddNewRow at the end of collection. When data operations (sorting, grouping) performed, the new item added based on data operations. You can customize the newly added data item position by setting [SfDataGrid.NewItemPlaceHolderPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_NewItemPlaceholderPosition). +The Data Grid adds a new data item from AddNewRow at the end of the collection. When data operations (sorting, grouping) are performed, the new item is added based on the data operations. You can customize the newly added data item position by setting the [SfDataGrid.NewItemPlaceHolderPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_NewItemPlaceholderPosition). {% tabs %} {% highlight xaml %} @@ -339,7 +339,7 @@ this.datagrid.NewItemPlaceholderPosition = NewItemPlaceholderPosition.AtBeginnin ### Initializing default values for AddNewRow -SfDataGrid allows you to set the default values for AddNewRow while initiating, through [AddNewRowInitiatingEventArgs.NewObject](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AddNewRowInitiatingEventArgs.html#Syncfusion_UI_Xaml_Grid_AddNewRowInitiatingEventArgs_NewObject) property in [SfDataGrid.AddNewRowInitiating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowInitiating) event. +The Data Grid allows you to set the default values for AddNewRow while initiating, through the [AddNewRowInitiatingEventArgs.NewObject](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AddNewRowInitiatingEventArgs.html#Syncfusion_UI_Xaml_Grid_AddNewRowInitiatingEventArgs_NewObject) property in the [SfDataGrid.AddNewRowInitiating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowInitiating) event. {% tabs %} {% highlight c# %} @@ -353,11 +353,11 @@ void dataGrid_AddNewRowInitiating(object sender, AddNewRowInitiatingEventArgs ar {% endhighlight %} {% endtabs %} -![Add New Row with Default Values in WPF DataGrid](Data-Manipulation_images/wpf-datagrid-default-value.png) +![Add New Row with Default Values](Data-Manipulation_images/wpf-datagrid-default-value.png) ### Working with complex properties in AddNewRow -SfDataGrid control does not initiate values for complex properties defined in the data object. Hence, you need to initiate the default values for the complex properties externally by using the [SfDataGrid.AddNewRowInitiating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowInitiating) event. +The Data Grid control does not initiate values for complex properties defined in the data object. Hence, you need to initiate the default values for the complex properties externally by using the [SfDataGrid.AddNewRowInitiating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowInitiating) event. {% tabs %} {% highlight xaml %} @@ -468,19 +468,19 @@ void dataGrid_RowValidating(object sender, RowValidatingEventArgs args) {% endhighlight %} {% endtabs %} -![Data Validation in Add New Row in WPF DataGrid](Data-Manipulation_images/wpf-datagrid-data-validation.png) +![Data Validation in Add New Row](Data-Manipulation_images/wpf-datagrid-data-validation.png) Similarly, you can validate the cells in AddNewRow by using the [CurrentCellValidating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellValidating) event. ### Customizing AddNewRow text using default resource file -SfDataGrid enables you to customize the watermark text of AddNewRow by changing value of AddNewRowText in Resource Designer. For more information, you can refer [Editing default culture resource](https://help.syncfusion.com/wpf/datagrid/localization#editing-default-culture-resource) section. +The Data Grid enables you to customize the watermark text of AddNewRow by changing the value of AddNewRowText in Resource Designer. For more information, you can refer to the [Editing default culture resource](https://help.syncfusion.com/wpf/datagrid/localization#editing-default-culture-resource) section. To customize the AddNewRowText, add the default `Syncfusion.SfDataGrid.WPF.resx` file in **Resources** folder and then customize the value of AddNewRowText. Refer [here](https://help.syncfusion.com/windowsforms/sfdatagrid/localization) to learn more about localization. -![WPF DataGrid Resource File](Data-Manipulation_images/wpf-datagrid-resource-file.png) +![Resource File](Data-Manipulation_images/wpf-datagrid-resource-file.png) -![Localized Add New Row Text in WPF DataGrid](Data-Manipulation_images/wpf-datagrid-localization.png) +![Localized Add New Row Text](Data-Manipulation_images/wpf-datagrid-localization.png) ### Customizing AddNewRow text using style @@ -578,7 +578,7 @@ You can customize the watermark text of AddNewRow by editing the style of `AddNe {% endhighlight %} {% endtabs %} -![Displaying Add New Row Text as Watermark in WPF DataGrid](Data-Manipulation_images/wpf-datagrid-watermark-text.png) +![Displaying Add New Row Text as Watermark](Data-Manipulation_images/wpf-datagrid-watermark-text.png) ### AddNewRow support in Master-Details View @@ -680,11 +680,11 @@ this.firstLevelNestedGrid.AddNewRowText = "Click here to add new row in child gr {% endhighlight %} {% endtabs %} -![Changing Add New Row Text in WPF DetailsView DataGrid](Data-Manipulation_images/wpf-datagrid-text-in-detailview.png) +![Changing Add New Row Text in Details View](Data-Manipulation_images/wpf-datagrid-text-in-detailview.png) ## Delete row -DataGrid provides built-in support to delete the selected records in user interface (UI) by pressing Delete key. You can enable the deleting support by setting the [SfDataGrid.AllowDeleting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowDeleting) property to `true`. `AllowDeleting` is only supported when `SelectionUnit` is `Row`. +The Data Grid provides built-in support to delete the selected records in user interface (UI) by pressing the Delete key. You can enable the deleting support by setting the [SfDataGrid.AllowDeleting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowDeleting) property to `true`. `AllowDeleting` is only supported when `SelectionUnit` is `Row`. {% tabs %} {% highlight xaml %} @@ -747,9 +747,9 @@ void dataGrid_RecordDeleting(object sender, RecordDeletingEventArgs args) * `Items` - Gets the records that were removed from the source collection. -* `SelectedIndex` - Gets or sets the selected index for the SfDataGrid control. +* `SelectedIndex` - Gets or sets the selected index for the grid control. -### Handling selection after deleting the record from SfDataGrid +### Handling selection after deleting the record from Data Grid You can handle the selection after remove the records through [SelectedIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RecordDeletedEventArgs.html#Syncfusion_UI_Xaml_Grid_RecordDeletedEventArgs_SelectedIndex) property of [RecordDeleted](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RecordDeleted) event. diff --git a/wpf/DataGrid/Data-Validation.md b/wpf/DataGrid/Data-Validation.md index 76352c878..710a03430 100644 --- a/wpf/DataGrid/Data-Validation.md +++ b/wpf/DataGrid/Data-Validation.md @@ -23,7 +23,7 @@ Built-in validations through `IDataErrorInfo`, `INotifyDataErrorInfo` and Data a ## Built-in validation using IDataErrorInfo / INotifyDataErrorInfo -WPF DataGrid (SfDataGrid) provides support to validate the data based on [IDataErrorInfo](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.idataerrorinfo?view=net-5.0) / [INotifyDataErrorInfo](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifydataerrorinfo?view=net-5.0). +The WPF Data Grid (SfDataGrid) provides support to validate the data based on [IDataErrorInfo](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.idataerrorinfo?view=net-5.0) / [INotifyDataErrorInfo](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifydataerrorinfo?view=net-5.0). ### Using IDataErrorInfo @@ -83,7 +83,7 @@ this.dataGrid.GridValidationMode = GridValidationMode.InView; {% endhighlight %} {% endtabs %} -![Data validation in WPF DataGrid using IDataErrorInfo](Data-Validation_images/wpf-datagrid-data-validation.png) +![Data validation using IDataErrorInfo](Data-Validation_images/wpf-datagrid-data-validation.png) ### INotifyDataErrorInfo @@ -140,7 +140,7 @@ Enable built-in validation support by setting [SfDataGrid.GridValidationMode](ht {% endhighlight %} {% endtabs %} -![Data validation in WPF DataGrid using INotifyDataErrorInfo](Data-Validation_images/wpf-datagrid-with-data-validation.png) +![Data validation using INotifyDataErrorInfo](Data-Validation_images/wpf-datagrid-with-data-validation.png) ## Built-in validation using Data Annotation @@ -212,9 +212,9 @@ public string CustomerID ## Cell validation -You can validate the cells using [CurrentCellValidating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellValidating) event when the cell is edited. `CurrentCellValidating` event occurs when the edited cells tries to commit the data or lose the focus. DataGrid will not allow user to edit other cells if validation failed. +You can validate the cells using the [CurrentCellValidating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellValidating) event when the cell is edited. The `CurrentCellValidating` event occurs when the edited cell tries to commit the data or lose the focus. The grid will not allow the user to edit other cells if validation failed. -[CurrentCellValidatingEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellValidatingEventArgs.html) provides information to `CurrentCellValidating` event for validating the cell. `CurrentCellValidatingEventArgs.OriginalSender` returns the DataGrid fired this event for DetailsView. +[CurrentCellValidatingEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellValidatingEventArgs.html) provides information to the `CurrentCellValidating` event for validating the cell. `CurrentCellValidatingEventArgs.OriginalSender` returns the grid that fired this event for DetailsView. `CurrentCellValidatingEventArgs.NewValue` returns the edited value and you can set the validation status using `CurrentCellValidatingEventArgs.IsValid` property. @@ -248,9 +248,9 @@ void dataGrid_CurrentCellValidated(object sender, CurrentCellValidatedEventArgs ## Row validation -You can validate the row using [RowValidating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RowValidating) event when the cell is edited. The `RowValidating` event occurs when the edited cells tries to commit the row data or lose the focus. DataGrid will not allow user to edit other rows if validation failed. +You can validate the row using [RowValidating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RowValidating) event when the cell is edited. The `RowValidating` event occurs when the edited cells tries to commit the row data or lose the focus. Data Grid will not allow user to edit other rows if validation failed. -[RowValidatingEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowValidatingEventArgs.html) provides information to `RowValidating` event for validating row. `RowValidatingEventArgs.OriginalSender` returns the DataGrid fired this event for DetailsView. +[RowValidatingEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowValidatingEventArgs.html) provides information to the `RowValidating` event for validating the row. `RowValidatingEventArgs.OriginalSender` returns the grid that fired this event for DetailsView. `RowValidatingEventArgs.RowData` returns the edited value and you can set the validation status using `RowValidatingEventArgs.IsValid` property. @@ -435,7 +435,7 @@ You can change the validation error template shape of the GridCell by changing {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Data Validation Errors with Error Icon](Data-Validation_images/wpf-datagrid-error-icon.png) +![Data Validation Errors with Error Icon](Data-Validation_images/wpf-datagrid-error-icon.png) ### Change the color of error icon @@ -583,7 +583,7 @@ You can change the validation error template color of the `GridCell` by changi {% endhighlight %} {% endtabs %} -![Data Validation Error Icon with Custom Color in WPF DataGrid](Data-Validation_images/wpf-datagrid-error-icon-with-custom-color.png) +![Data Validation Error Icon with Custom Color](Data-Validation_images/wpf-datagrid-error-icon-with-custom-color.png) ### Change the cursor over error icon @@ -737,7 +737,7 @@ You can change the validation error template cursor of the `GridCell` by chang {% endhighlight %} {% endtabs %} -![Changing Cursor Style on Error Icon in WPF DataGrid](Data-Validation_images/wpf-datagrid-change-cursor-style.png) +![Changing Cursor Style on Error Icon](Data-Validation_images/wpf-datagrid-change-cursor-style.png) ## Data validation error tip (help tip) customization @@ -836,11 +836,11 @@ You can change the error tip background color by setting `Background` property o {% endhighlight %} {% endtabs %} -![WPF DataGrid - Error Tip Foreground and Background Customization](Data-Validation_images/wpf-datagrid-error-tip-color-customization.png) +![Error Tip Foreground and Background Customization](Data-Validation_images/wpf-datagrid-error-tip-color-customization.png) ## Showing error details in RowHeader -WPF DataGrid (SfDataGrid) support to show the error icon in [GridRowHeaderCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowHeaderCell.html) based on [IDataErrorInfo.Error](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.idataerrorinfo.error?view=net-5.0) or [INotifyDataErrorInfo.HasErrors](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifydataerrorinfo.haserrors?view=net-5.0) property. +The WPF Data Grid (SfDataGrid) supports showing the error icon in [GridRowHeaderCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowHeaderCell.html) based on the [IDataErrorInfo.Error](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.idataerrorinfo.error?view=net-5.0) or [INotifyDataErrorInfo.HasErrors](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifydataerrorinfo.haserrors?view=net-5.0) property. ### Using IDataErrorInfo @@ -864,7 +864,7 @@ public string Error {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Error Information of Data Validation using IDataErrorInfo](Data-Validation_images/wpf-datagrid-error-info-in-row-header.png) +![Error Information of Data Validation using IDataErrorInfo](Data-Validation_images/wpf-datagrid-error-info-in-row-header.png) ### Using INotifyDataErrorInfo @@ -887,7 +887,7 @@ public bool HasErrors {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Error Information of Data Validation using INotifyDataErrorInfo](Data-Validation_images/wpf-datagrid-error-tip.png) +![Error Information of Data Validation using INotifyDataErrorInfo](Data-Validation_images/wpf-datagrid-error-tip.png) ## Data validation with Master-details view @@ -933,7 +933,7 @@ void dataGrid_AutoGeneratingRelations(object sender, Syncfusion.UI.Xaml.Grid.Aut {% endhighlight %} {% endtabs %} -![Data Validation with Master-DetailsView in WPF SfDataGrid](Data-Validation_images/wpf-datagrid-validation-in-master-details-view.png) +![Data Validation with Master-DetailsView](Data-Validation_images/wpf-datagrid-validation-in-master-details-view.png) ### Custom validation through events @@ -1124,7 +1124,7 @@ void dataGrid_AutoGeneratingRelations(object sender, Syncfusion.UI.Xaml.Grid.Aut ## Data validation with checkbox column -SfDataGrid doesn’t support to validate the [GridCheckBoxColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCheckBoxColumn.html) through validating events. +The Data Grid doesn’t support validating the [GridCheckBoxColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCheckBoxColumn.html) through validating events. You can validate the check box column value by setting `ValidationHelper.IsCurrentCellValidated` and `ValidationHelper.IsCurrentRowValidated` static properties by calling [SetCurrentRowValidated](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ValidationHelper.html#Syncfusion_UI_Xaml_Grid_ValidationHelper_SetCurrentRowValidated_System_Boolean_) and [SetCurrentCellValidated](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ValidationHelper.html#Syncfusion_UI_Xaml_Grid_ValidationHelper_SetCurrentCellValidated_System_Boolean_) methods from [ValidationHelper](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ValidationHelper.html). @@ -1149,11 +1149,11 @@ void dataGrid_CurrentCellValueChanged(object sender, CurrentCellValueChangedEven {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Data Validation with CheckBox Column](Data-Validation_images/wpf-datagrid-checkbox-validation.png) +![Data Validation with CheckBox Column](Data-Validation_images/wpf-datagrid-checkbox-validation.png) ## Show validation errors when using UseDrawing -By default, validation is not supported while enabling the `UseDrawing` property since the cell content were drawn instead of loading the UIElement. However, SfDataGrid provides an option to achieve the validation by adding the validation template. +By default, validation is not supported while enabling the `UseDrawing` property since the cell content is drawn instead of loading the UIElement. However, the control provides an option to achieve the validation by adding the validation template. Please refer the below code example for further details about achieving Validation when using `UseDrawing` property. {% tabs %} diff --git a/wpf/DataGrid/Data-Virtualization.md b/wpf/DataGrid/Data-Virtualization.md index 40da5dcba..d4b3de39f 100644 --- a/wpf/DataGrid/Data-Virtualization.md +++ b/wpf/DataGrid/Data-Virtualization.md @@ -9,7 +9,7 @@ documentation: ug # Data Virtualization in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) provides support to handle the large amount of data through built-in virtualization features. With Data virtualization, [SfDataGrid.View](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_View) process the data in on-demand for better performance while loading large amount of data. Below are the different virtualization concepts available, +The [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) provides support to handle the large amount of data through built-in virtualization features. With data virtualization, [SfDataGrid.View](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_View) processes the data on-demand for better performance while loading a large amount of data. Below are the different virtualization concepts available,
@@ -74,7 +74,7 @@ this.datagrid.EnableDataVirtualization = true; You can load the large amount of data in less time in another way using [GridVirtualizingCollectionView](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridVirtualizingCollectionView.html) which is derived from [VirtualizingCollectionView](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.VirtualizingCollectionView.html) to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource). -In the below code, `ViewModel` defined with `GridVirtualizingCollectionView` by passing complete records collection and bound to SfDataGrid. +In the below code, the `ViewModel` is defined with `GridVirtualizingCollectionView` by passing the complete records collection and bound to the grid. {% tabs %} {% highlight c# %} @@ -114,10 +114,10 @@ public class ViewModel ## Incremental Loading -DataGrid supports to load the data incrementally using [ISupportIncrementalLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.ISupportIncrementalLoading.html) interface. -`ISupportIncrementalLoading` interface has [LoadMoreItemsAsync](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.IncrementalList-1.html#Syncfusion_UI_Xaml_Grid_IncrementalList_1_LoadMoreItemsAsync_System_UInt32_) method which helps to load the data incrementally. `LoadMoreItemsAsync` called in on-demand while scrolling based on [HasMoreItems](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.IncrementalList-1.html#Syncfusion_UI_Xaml_Grid_IncrementalList_1_HasMoreItems) property. +The Data Grid supports loading the data incrementally using the [ISupportIncrementalLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.ISupportIncrementalLoading.html) interface. +The `ISupportIncrementalLoading` interface has the [LoadMoreItemsAsync](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.IncrementalList-1.html#Syncfusion_UI_Xaml_Grid_IncrementalList_1_LoadMoreItemsAsync_System_UInt32_) method which helps to load the data incrementally. `LoadMoreItemsAsync` is called on-demand while scrolling based on the [HasMoreItems](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.IncrementalList-1.html#Syncfusion_UI_Xaml_Grid_IncrementalList_1_HasMoreItems) property. -If `HasMoreItems` is `false`, SfDataGrid stops calling `LoadMoreItemsAsync`. SfDataGrid have [IncrementalList](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.IncrementalList-1.html) which is derived from `ISupportIncrementalLoading`. You can use `IncrementalList` or create collection derived from `ISupportIncrementalLoading` and bind it `SfDataGrid.ItemsSource`. +If `HasMoreItems` is `false`, the control stops calling `LoadMoreItemsAsync`. It has [IncrementalList](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.IncrementalList-1.html) which is derived from `ISupportIncrementalLoading`. You can use `IncrementalList` or create a collection derived from `ISupportIncrementalLoading` and bind it to `SfDataGrid.ItemsSource`. In the below code, `IncrementalList` is initialized by passing Action to its constructor for loading items incrementally. @@ -174,7 +174,7 @@ You can download the sample from [here](https://www.syncfusion.com/downloads/sup You can display animations when fetching data from service for [LoadMoreItemsAsync](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.IncrementalList-1.html#Syncfusion_UI_Xaml_Grid_IncrementalList_1_LoadMoreItemsAsync_System_UInt32_) method call, using [BackgroundWorker](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.backgroundworker?view=net-7.0). -In the below code snippet data fetched from service using `BackgroundWorker` and [SfBusyIndicator](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Notification.SfBusyIndicator.html) displayed over SfDataGrid based on [IsBusy](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Notification.SfBusyIndicator.html#Syncfusion_Windows_Controls_Notification_SfBusyIndicator_IsBusy) property in `ViewModel`, until `BackgroundWorker` completes its action. +In the below code snippet, data is fetched from the service using `BackgroundWorker` and the [SfBusyIndicator](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Notification.SfBusyIndicator.html) is displayed over the grid based on the [IsBusy](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Notification.SfBusyIndicator.html#Syncfusion_Windows_Controls_Notification_SfBusyIndicator_IsBusy) property in `ViewModel`, until `BackgroundWorker` completes its action. {% tabs %} {% highlight xaml %} @@ -272,7 +272,7 @@ public class ViewModel : INotifyPropertyChanged {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Incremental Data Loading](data-virtualization_images/wpf-datagrid-loading-data.png) +![Incremental Data Loading](data-virtualization_images/wpf-datagrid-loading-data.png) You can download the sample from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/IncrementalLoading_Animation-1160118925.zip). @@ -378,4 +378,4 @@ You can download the sample from [here](https://www.syncfusion.com/downloads/sup ## Paging -SfDataGrid supports to load paged data source using [SfDataPager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Controls.DataPager.SfDataPager.html). You can use the paging in SfDataGrid by go through the [Paging](https://help.syncfusion.com/wpf/datagrid/paging) section. +The Data Grid supports loading a paged data source using the [SfDataPager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Controls.DataPager.SfDataPager.html). You can use paging in the control by going through the [Paging](https://help.syncfusion.com/wpf/datagrid/paging) section. diff --git a/wpf/DataGrid/Editing.md b/wpf/DataGrid/Editing.md index 850215007..69ddb2a6e 100644 --- a/wpf/DataGrid/Editing.md +++ b/wpf/DataGrid/Editing.md @@ -9,7 +9,7 @@ documentation: ug # Editing in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides support for editing and it can be enabled or disabled by setting [SfDataGrid.AllowEditing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowEditing) property. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides support for editing and it can be enabled or disabled by setting [SfDataGrid.AllowEditing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowEditing) property. {% tabs %} {% highlight xaml %} @@ -38,7 +38,7 @@ dataGrid.Columns["OrderID"].AllowEditing = true; N> [GridColumn.AllowEditing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_AllowEditing) takes higher priority than [SfDataGrid.AllowEditing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowEditing). -![WPF DataGrid Cell Editing](editing_images/wpf-datagrid-cell-editing.jpeg) +![Cell editing](editing_images/wpf-datagrid-cell-editing.jpeg) N> It is mandatory to set the [NavigationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_NavigationMode) to Cell to enable [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCurrentCellManager.html#Syncfusion_UI_Xaml_Grid_GridCurrentCellManager_CurrentCell) navigation and editing. @@ -84,7 +84,7 @@ dataGrid.EditorSelectionBehavior = EditorSelectionBehavior.SelectAll; ## Retain editing on lost focus -The editing of current cell will be ended by default while the focus is moving from DataGrid to another control. You can set the [LostFocusBehavior](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LostFocusBehavior) property to `LostFocusBehavior.Default` if you want to retain the editing of the current cell even when focus is moved to another control. +The editing of the current cell will be ended by default while the focus is moving from the Data Grid to another control. You can set the [LostFocusBehavior](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_LostFocusBehavior) property to `LostFocusBehavior.Default` if you want to retain the editing of the current cell even when focus is moved to another control. {% tabs %} {% highlight xaml %} @@ -101,7 +101,7 @@ dataGrid.LostFocusBehavior = LostFocusBehavior.Default; ## Working with IEditableObject interface -WPF DataGrid (SfDataGrid) supports to commit and roll back the changes in row level when underlying data object implements [IEditableObject](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject?view=net-5.0) interface. +WPF Data Grid supports to commit and roll back the changes in row level when underlying data object implements [IEditableObject](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject?view=net-5.0) interface. The editing changes in a row will be committed only when user move to next row or pressing enter key in [EndEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.endedit?view=net-5.0). Also when user press Esc key, then the changes made in a row will be reverted in [CancelEdit](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.ieditableobject.canceledit?view=net-5.0). @@ -277,15 +277,15 @@ public class NotificationObject : INotifyPropertyChanged ## Edit events -SfDataGrid triggers the following events during editing. +Data Grid triggers the following events during editing. ### CurrentCellBeginEdit Event [CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellBeginEdit) event occurs when the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCurrentCellManager.html#Syncfusion_UI_Xaml_Grid_GridCurrentCellManager_CurrentCell) enter into edit mode. [CurrentCellBeginEditEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellBeginEditEventArgs.html) has following members which provides information for `CurrentCellBeginEdit` event. * [Cancel](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.canceleventargs.cancel?view=net-5.0) : When set to `true`, the event is canceled and the `CurrentCell` does not enter into the edit mode. -* [RowColumnIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellBeginEditEventArgs.html#Syncfusion_UI_Xaml_Grid_CurrentCellBeginEditEventArgs_RowColumnIndex) : Gets the current row column index of the DataGrid. -* [Column](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellBeginEditEventArgs.html#Syncfusion_UI_Xaml_Grid_CurrentCellBeginEditEventArgs_Column) : Gets the Grid Column of the SfDataGrid. +* [RowColumnIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellBeginEditEventArgs.html#Syncfusion_UI_Xaml_Grid_CurrentCellBeginEditEventArgs_RowColumnIndex) : Gets the current row column index of the Data Grid. +* [Column](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellBeginEditEventArgs.html#Syncfusion_UI_Xaml_Grid_CurrentCellBeginEditEventArgs_Column) : Gets the Grid Column of the Data Grid. {% tabs %} {% highlight c# %} @@ -321,7 +321,7 @@ void dataGrid_CurrentCellEndEdit(object sender, Syncfusion.UI.Xaml.Grid.CurrentC [CurrentCellValueChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellValueChanged) event occurs whenever a value changes in GridColumn's that supports editing. [CurrentCellValueChangedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellValueChangedEventArgs.html) has following members which provides information for `CurrentCellValueChanged` event. -* [Column](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellBeginEditEventArgs.html#Syncfusion_UI_Xaml_Grid_CurrentCellBeginEditEventArgs_Column) : Gets the Grid Column of the SfDataGrid. +* [Column](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellBeginEditEventArgs.html#Syncfusion_UI_Xaml_Grid_CurrentCellBeginEditEventArgs_Column) : Gets the Grid Column of the Data Grid. * [RowColumnIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CurrentCellValueChangedEventArgs.html#Syncfusion_UI_Xaml_Grid_CurrentCellValueChangedEventArgs_RowColumnIndex) : Gets the value of the current RowColumnIndex. {% tabs %} @@ -364,7 +364,7 @@ void dataGrid_CurrentCellDropDownSelectionChanged(object sender, CurrentCellDrop ### BeginEdit -WPF DataGrid (SfDataGrid) allows you to edit the cell programmatically by calling the [BeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCurrentCellManager.html#Syncfusion_UI_Xaml_Grid_GridCurrentCellManager_BeginEdit) method. Initially the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCurrentCellManager.html#Syncfusion_UI_Xaml_Grid_GridCurrentCellManager_CurrentCell) need to set before calling the `BeginEdit` method when the CurrentCell value is null. +WPF Data Grid allows you to edit the cell programmatically by calling the [BeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCurrentCellManager.html#Syncfusion_UI_Xaml_Grid_GridCurrentCellManager_BeginEdit) method. Initially the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCurrentCellManager.html#Syncfusion_UI_Xaml_Grid_GridCurrentCellManager_CurrentCell) need to set before calling the `BeginEdit` method when the CurrentCell value is null. {% tabs %} {% highlight c# %} @@ -433,11 +433,11 @@ void dataGrid_CurrentCellBeginEdit(object sender, Syncfusion.UI.Xaml.Grid.Curren ## Cell click events -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides `CellTapped` and `CellDoubleTapped` events to handle cell click actions. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides `CellTapped` and `CellDoubleTapped` events to handle cell click actions. ### Cell tapped event -WPF DataGrid `CellTapped` event occurs when the user clicks or touches a cell in DataGrid with [GridCellTappedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCellTappedEventArgs.html). `CellTapped` event does not occur for the non-selectable cells. The `GridCellTappedEventArgs` has following members which provides information for `CellTapped` event. +The `CellTapped` event occurs when the user clicks or touches a cell in the Data Grid with [GridCellTappedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCellTappedEventArgs.html). `CellTapped` event does not occur for the non-selectable cells. The `GridCellTappedEventArgs` has following members which provides information for `CellTapped` event. * [Column](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CellTappedEventArgs.html#Syncfusion_UI_Xaml_Grid_CellTappedEventArgs_Column) - Gets the GridColumn of the tapped cell. * [Record](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CellTappedEventArgs.html#Syncfusion_UI_Xaml_Grid_CellTappedEventArgs_Record) - Gets the data context of the tapped cell. * [RowColumnIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CellTappedEventArgs.html#Syncfusion_UI_Xaml_Grid_CellTappedEventArgs_RowColumnIndex) - Gets the RowColumnIndex of the tapped cell. @@ -463,7 +463,7 @@ private void Datagrid_CellTapped(object sender, GridCellTappedEventArgs e) ### Cell double tapped event -`CellDoubleTapped` event occurs when the user double clicks or double taps a cell in DataGrid with [GridCellDoubleTappedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCellDoubleTappedEventArgs.html). `CellDoubleTapped` event does not occur for non-selectable cells. `GridCellDoubleTappedEventArgs` has following members which provides information for `CellDoubleTapped ` event. +`CellDoubleTapped` event occurs when the user double clicks or double taps a cell in the Data Grid with [GridCellDoubleTappedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCellDoubleTappedEventArgs.html). `CellDoubleTapped` event does not occur for non-selectable cells. `GridCellDoubleTappedEventArgs` has following members which provides information for `CellDoubleTapped ` event. * [Column](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CellDoubleTappedEventArgs.html#Syncfusion_UI_Xaml_Grid_CellDoubleTappedEventArgs_Column) - Gets the GridColumn of the double tapped cell. * [Record](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CellDoubleTappedEventArgs.html#Syncfusion_UI_Xaml_Grid_CellDoubleTappedEventArgs_Record) - Gets the data context of the double tapped cell. * [RowColumnIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CellDoubleTappedEventArgs.html#Syncfusion_UI_Xaml_Grid_CellDoubleTappedEventArgs_RowColumnIndex) - Gets the RowColumnIndex of the double tapped cell. @@ -564,7 +564,7 @@ You can allow `UIElement` loaded inside template to handle mouse interaction in ## How to -### How to track edited cells in WPF DataGrid? +### How to track edited cells in WPF Data Grid? You can change the foreground color of edited cells through the `CellStyleSelector` to track edited cells. @@ -637,12 +637,12 @@ public class CellStyleSelector : StyleSelector {% endhighlight %} {% endtabs %} -![Changing Foreground of Edited Cells in WPF DataGrid](editing_images/wpf-datagrid-edited-cells.jpeg) +![Changing foreground of edited cells](editing_images/wpf-datagrid-edited-cells.jpeg) ### Allow editing when pressing minus key -SfDataGrid does not allow the cell to get into the edit mode while pressing the Minus key or any special character. You can overcome this behavior by customizing the SfDataGrid class, and overriding its `OnTextInput()` method. +Data Grid does not allow the cell to get into the edit mode while pressing the Minus key or any special character. You can overcome this behavior by customizing the `SfDataGrid` class, and overriding its `OnTextInput()` method. {% tabs %} {% highlight c# %} @@ -696,9 +696,9 @@ public class SfDataGridExt : SfDataGrid ## See Also -[How to change row background based on RowState.Modified when underlying itemsSource is DataTable in SfDataGrid?](https://support.syncfusion.com/kb/article/8757/how-to-change-row-background-based-on-row-state-when-underlying-source-is-data-table-in-wpf) +[How to change row background based on RowState.Modified when underlying itemsSource is DataTable in Data Grid?](https://support.syncfusion.com/kb/article/8757/how-to-change-row-background-based-on-row-state-when-underlying-source-is-data-table-in-wpf) -[How to show different controls in same column of SfDataGrid?](https://support.syncfusion.com/kb/article/6667/how-to-show-different-controls-in-same-column-of-wpf-datagrid-sfdatagrid) +[How to show different controls in same column of Data Grid?](https://support.syncfusion.com/kb/article/6667/how-to-show-different-controls-in-same-column-of-wpf-datagrid-sfdatagrid) [How to edit GridHyperLinkColumn?](https://support.syncfusion.com/kb/article/6115/how-to-edit-gridhyperlinkcolumn-in-wpf-datagrid-sfdatagrid) @@ -714,33 +714,33 @@ public class SfDataGridExt : SfDataGrid [How to change the CheckBox value for all SelectedItems when any selected CheckBox value changed?](https://support.syncfusion.com/kb/article/5755/how-to-change-the-checkbox-value-for-all-selecteditems-when-any-selected-checkbox-value-changed-in-wpf-datagrid) -[How to fire RowValidating event for GridCheckBoxColumn in SfDataGrid](https://support.syncfusion.com/kb/article/5634/how-to-fire-rowvalidating-event-for-gridcheckboxcolumn-in-sfdatagrid-in-wpf-) +[How to fire RowValidating event for GridCheckBoxColumn in Data Grid](https://support.syncfusion.com/kb/article/5634/how-to-fire-rowvalidating-event-for-gridcheckboxcolumn-in-sfdatagrid-in-wpf-) [How to create ReadOnly UnboundRows?](https://support.syncfusion.com/kb/article/5257/how-to-create-readonly-unboundrows) [How to load null value to the GridDateTimeColumn when AllowInlineEditing is set to true?](https://support.syncfusion.com/kb/article/5211/how-to-load-null-value-to-the-griddatetimecolumn-when-allowinlineediting-is-set-to-true-in-wpf-datagrid) -[How to move the CurrentCell to the first column of the AddNewRow when the Tab key is pressed from the last column and its position is at the Bottom of the SfDataGrid?](https://support.syncfusion.com/kb/article/4551/how-to-move-the-currentcell-to-the-first-column-in-wpf-datagrid) +[How to move the CurrentCell to the first column of the AddNewRow when the Tab key is pressed from the last column and its position is at the Bottom of the Data Grid?](https://support.syncfusion.com/kb/article/4551/how-to-move-the-currentcell-to-the-first-column-in-wpf-datagrid) -[How to customize edit mode behavior of GridCell in SfDataGrid?](https://support.syncfusion.com/kb/article/3838/how-to-customize-edit-mode-behavior-of-gridcell-in-sfdatagrid) +[How to customize edit mode behavior of GridCell in Data Grid?](https://support.syncfusion.com/kb/article/3838/how-to-customize-edit-mode-behavior-of-gridcell-in-sfdatagrid) -[How to change the Enter key behavior in SfDataGrid?](https://support.syncfusion.com/kb/article/3830/how-to-change-the-enter-key-behavior-in-sfdatagrid) +[How to change the Enter key behavior in Data Grid?](https://support.syncfusion.com/kb/article/3830/how-to-change-the-enter-key-behavior-in-sfdatagrid) [How to change the Enter key behavior to insert line break when the CurrentCell is in the edit mode?](https://support.syncfusion.com/kb/article/3874/how-to-change-the-enter-key-behavior-to-insert-line-break-when-the-currentcell-is-in-the-edit-mode-for-wpf-grid) -[How to edit SfDataGrid Template column by single tap?](https://support.syncfusion.com/kb/article/3307/how-to-edit-datagrid-template-column-by-single-tap-in-wpf-application) +[How to edit Data Grid Template column by single tap?](https://support.syncfusion.com/kb/article/3307/how-to-edit-datagrid-template-column-by-single-tap-in-wpf-application) [How to set the Copy and Paste option of the Grid by using ContextMenu and SfRibbon?](https://support.syncfusion.com/kb/article/3306/how-to-set-the-copy-and-paste-option-of-the-grid-by-using-contextmenu-and-sfribbion) -[How to hide the rows based on condition in SfDataGrid?](https://support.syncfusion.com/kb/article/3324/how-to-hide-the-rows-based-on-condition-in-wpf-datagrid) +[How to hide the rows based on condition in Data Grid?](https://support.syncfusion.com/kb/article/3324/how-to-hide-the-rows-based-on-condition-in-wpf-datagrid) -[How to disable Edit mode for cells in SfDataGrid with different background for those disabled cells?](https://support.syncfusion.com/kb/article/2981/how-to-disable-edit-mode-for-cells-in-sfdatagrid-with-different-background-for-those-disabled-cells-in-wpf) +[How to disable Edit mode for cells in Data Grid with different background for those disabled cells?](https://support.syncfusion.com/kb/article/2981/how-to-disable-edit-mode-for-cells-in-sfdatagrid-with-different-background-for-those-disabled-cells-in-wpf) [How to focus a particular UIElement inside DataTemplate after calling CurrentCell.BeginEdit() or when entering edit mode?](https://support.syncfusion.com/kb/article/2835/how-to-focus-a-particular-uielement-inside-datatemplate-after-calling-currentcellbeginedit-or-when-entering-edit-mode-in-wpf-grid) [How to change the same values in all records when the ComboBox column value is changed?](https://support.syncfusion.com/kb/article/2893/how-to-change-the-same-values-in-all-records-when-the-combobox-column-value-is-changed-in-wpf-datagrid) -[How to disable the edit mode of AddNewRow in SfDataGrid when AllowEditing is set as False?](https://support.syncfusion.com/kb/article/2931/how-to-disable-the-edit-mode-of-addnewrow-in-wpf-sfdatagrid-when-allowediting-is-set-as-false-) +[How to disable the edit mode of AddNewRow in Data Grid when AllowEditing is set as False?](https://support.syncfusion.com/kb/article/2931/how-to-disable-the-edit-mode-of-addnewrow-in-wpf-sfdatagrid-when-allowediting-is-set-as-false-) [How to get the parent grid while editing the child grid?](https://support.syncfusion.com/kb/article/2795/how-to-get-the-parent-grid-while-editing-the-child-grid-in-wpf-datagrid) diff --git a/wpf/DataGrid/Export-To-Excel.md b/wpf/DataGrid/Export-To-Excel.md index e407460c3..1921d93ca 100644 --- a/wpf/DataGrid/Export-To-Excel.md +++ b/wpf/DataGrid/Export-To-Excel.md @@ -9,7 +9,7 @@ documentation: ug # Export To Excel in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to export data to excel. It also provides support for grouping, filtering, sorting, paging, unbound rows, merged cells, stacked headers and Details View while exporting. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to export data to excel. It also provides support for grouping, filtering, sorting, paging, unbound rows, merged cells, stacked headers and Details View while exporting. The following assemblies needs to be added for exporting to excel. @@ -18,7 +18,7 @@ The following assemblies needs to be added for exporting to excel. For NuGet package, have to install [Syncfusion.DataGridExcelExport.WPF](https://www.nuget.org/packages/Syncfusion.DataGridExcelExport.WPF) package. For more details refer this [UG link](https://help.syncfusion.com/wpf/control-dependencies#exporting-datagrid-to-excel-pdf-and-csv). -You can export SfDataGrid to excel by using the [ExportToExcel](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridExcelExportExtension.html#Syncfusion_UI_Xaml_Grid_Converter_GridExcelExportExtension_ExportToExcel_Syncfusion_UI_Xaml_Grid_SfDataGrid_Syncfusion_Data_ICollectionViewAdv_Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_) extension method present in the [Syncfusion.UI.Xaml.Grid.Converter](https://help.syncfusion.com/cr/wpf/Syncfusion.html) namespace. +You can export the Data Grid to excel by using the [ExportToExcel](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridExcelExportExtension.html#Syncfusion_UI_Xaml_Grid_Converter_GridExcelExportExtension_ExportToExcel_Syncfusion_UI_Xaml_Grid_SfDataGrid_Syncfusion_Data_ICollectionViewAdv_Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_) extension method present in the [Syncfusion.UI.Xaml.Grid.Converter](https://help.syncfusion.com/cr/wpf/Syncfusion.html) namespace. {% tabs %} {% highlight c# %} @@ -31,7 +31,7 @@ workBook.SaveAs("Sample.xlsx"); {% endhighlight %} {% endtabs %} -N> SfDataGrid exports data to excel by using [XlsIO](https://help.syncfusion.com/file-formats/xlsio/overview). You can refer [XlsIO documentation](https://help.syncfusion.com/file-formats/xlsio/working-with-excel-worksheet) for manipulating exported work sheets. +N> Data Grid exports data to excel by using [XlsIO](https://help.syncfusion.com/file-formats/xlsio/overview). You can refer [XlsIO documentation](https://help.syncfusion.com/file-formats/xlsio/working-with-excel-worksheet) for manipulating exported work sheets. ## Excel exporting options @@ -53,7 +53,7 @@ workBook.SaveAs("Sample.xlsx"); ### Export groups with outlines -By default, all the groups in dataGrid will be exported in expanded state. You can enable outlines in excel based on groups by setting the [AllowOutlining](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_AllowOutlining) property as `true` in [ExcelExportingOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html).  +By default, all the groups in the Data Grid will be exported in expanded state. You can enable outlines in excel based on groups by setting the [AllowOutlining](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_AllowOutlining) property as `true` in [ExcelExportingOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html). {% tabs %} {% highlight c# %} @@ -65,11 +65,11 @@ workBook.SaveAs("Sample.xlsx"); {% endhighlight %} {% endtabs %} -![Exporting to Excel with Outlines for Groups in WPF DataGrid](export-to-excel_images/wpf-datagrid-export-to-excel.png) +![Exporting to Excel with outlines for groups](export-to-excel_images/wpf-datagrid-export-to-excel.png) ### Exclude columns while exporting -By default, all the columns (including hidden columns) in SfDataGrid will be exported to Excel. If you want to exclude some columns while exporting to Excel, you can use [ExcludeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_ExcludeColumns) field in [ExcelExportingOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html). +By default, all the columns (including hidden columns) in the Data Grid will be exported to Excel. If you want to exclude some columns while exporting to Excel, you can use [ExcludeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_ExcludeColumns) field in [ExcelExportingOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html). {% tabs %} {% highlight c# %} @@ -155,7 +155,7 @@ workBook.SaveAs("Sample.xlsx"); {% endhighlight %} {% endtabs %} -![Exporting to Excel with Custom Row and Column Index in WPF DataGrid](export-to-excel_images/wpf-datagrid-export-with-row-column-index.png) +![Exporting to Excel with custom row and column index](export-to-excel_images/wpf-datagrid-export-with-row-column-index.png) ## Saving options @@ -253,9 +253,9 @@ window1.Show(); {% endhighlight %} {% endtabs %} -![Exported Excel without Saving in WPF DataGrid](export-to-excel_images/wpf-datagrid-export-excel-without-saving.png) +![Exported Excel without saving](export-to-excel_images/wpf-datagrid-export-excel-without-saving.png) -## Export DataGrid pages to Excel +## Export Data Grid pages to Excel While exporting data to excel, if paging is used, current page only will be exported, by default. If you want to export all pages, you need to set [ExportAllPages](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_ExportAllPages) property as `true`. @@ -282,7 +282,7 @@ workBook.SaveAs("Sample.xlsx"); {% endhighlight %} {% endtabs %} -## Export DataGrid SelectedItems to Excel +## Export Data Grid SelectedItems to Excel By default, entire grid will be exported to Excel. You can export selected items only by passing `SelectedItems` to [ExportToExcel](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridExcelExportExtension.html#Syncfusion_UI_Xaml_Grid_Converter_GridExcelExportExtension_ExportToExcel_Syncfusion_UI_Xaml_Grid_SfDataGrid_Syncfusion_Data_ICollectionViewAdv_Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_Syncfusion_XlsIO_IWorksheet_) method. @@ -299,9 +299,9 @@ workBook.SaveAs("Sample.xlsx"); {% endhighlight %} {% endtabs %} -![Exporting Selected Items only to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-export-selected-item.png) +![Exporting selected items only to Excel](export-to-excel_images/wpf-datagrid-export-selected-item.png) -## Export DataGrid to HTML +## Export Data Grid to HTML You can save exported workbook as HTML by using [SaveAsHtml](https://help.syncfusion.com/cr/wpf/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAsHtml_System_IO_Stream_) method. @@ -317,9 +317,9 @@ workBook.SaveAsHtml("Sample.html", HtmlSaveOptions.Default); It is also possible to save worksheet as HTML by using [SaveAsHtml](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAsHtml_System_IO_Stream_) method. You can refer [XlsIO documentation](https://help.syncfusion.com/file-formats/xlsio/working-with-excel-worksheet#save-worksheet-as-html) for this. -## Export DataGrid to Mail +## Export Data Grid to Mail -You can export SfDataGrid to mail by converting it into Excel and save exported worksheet as HTML. Then exported HTML contents is embedded in mail body. +You can export the Data Grid to mail by converting it into Excel and save exported worksheet as HTML. Then exported HTML contents is embedded in mail body. {% tabs %} {% highlight c# %} @@ -370,7 +370,7 @@ Console.WriteLine("Mail has been sent..."); {% endhighlight %} {% endtabs %} -## Export DataGrid to XML +## Export Data Grid to XML You can save exported workbook as `Xml` file also by using [SaveAsXml](https://help.syncfusion.com/cr/wpf/Syncfusion.XlsIO.IWorkbook.html#Syncfusion_XlsIO_IWorkbook_SaveAsXml_System_IO_Stream_Syncfusion_XlsIO_ExcelXmlSaveType_) methods. @@ -384,7 +384,7 @@ workBook.SaveAsXml("Sample.xml", ExcelXmlSaveType.MSExcel); {% endhighlight %} {% endtabs %} -## Export DataGrid to CSV +## Export Data Grid to CSV You can save exported workbook as CSV by using `SaveAs` method. @@ -453,7 +453,7 @@ private static void ExportingHandler(object sender, GridExcelExportingEventArgs {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Customized Cell Style based on CellType in Exported Excel](export-to-excel_images/wpf-datagrid-cell-style-customization.png) +![Displays customized cell style based on CellType in exported Excel](export-to-excel_images/wpf-datagrid-cell-style-customization.png) ## Cell customization in Excel while exporting @@ -492,7 +492,7 @@ private static void CellExportingHandler(object sender, GridCellExcelExportingEv {% endhighlight %} {% endtabs %} -![Customizing Cell Values while Exporting to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-cell-value-customization.png) +![Customizing cell values while exporting to Excel](export-to-excel_images/wpf-datagrid-cell-value-customization.png) Here, cell values are changed for `IsClosed` column based on custom condition. @@ -524,7 +524,7 @@ private static void CellExportingHandler(object sender, GridCellExcelExportingEv {% endhighlight %} {% endtabs %} -![Customizing Row Style based on Data while Exporting to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-row-style-customization.png) +![Customizing row style based on data while exporting to Excel](export-to-excel_images/wpf-datagrid-row-style-customization.png) Here, records having the `Country` name as `Mexico` are customized. @@ -553,16 +553,16 @@ private static void CellExportingHandler(object sender, GridCellExcelExportingEv {% endhighlight %} {% endtabs %} -![Customizing Cell Values based on Column name while Exporting to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-export-cell-value-based-on-column.png) +![Customizing cell values based on column name while exporting to Excel](export-to-excel_images/wpf-datagrid-export-cell-value-based-on-column.png) Here, `OrderID` column cells are customized while exporting. ## Customize exported workbook and worksheet -SfDataGrid exports to excel by using [XlsIO](https://help.syncfusion.com/file-formats/xlsio/overview). You can refer [XlsIO documentation](https://help.syncfusion.com/file-formats/xlsio/working-with-excel-worksheet) for manipulating workbook and sheet after exporting. +Data Grid exports to excel by using [XlsIO](https://help.syncfusion.com/file-formats/xlsio/overview). You can refer [XlsIO documentation](https://help.syncfusion.com/file-formats/xlsio/working-with-excel-worksheet) for manipulating workbook and sheet after exporting. ### Workbook -SfDataGrid provides option to return [ExcelEngine](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.ExcelEngine.html) from that you can get exported workbook. This allows you to protect, encrypt and add worksheet before saving. +Data Grid provides option to return [ExcelEngine](https://help.syncfusion.com/cr/file-formats/Syncfusion.XlsIO.ExcelEngine.html) from that you can get exported workbook. This allows you to protect, encrypt and add worksheet before saving. {% tabs %} {% highlight c# %} @@ -575,7 +575,7 @@ workBook.SaveAs("Sample.xlsx"); ### Worksheet customization -SfDataGrid provides support to export to already existing file or worksheet. +Data Grid provides support to export to already existing file or worksheet. In the below code snippet, worksheet is created and passed to `ExportToExcel` method. In the same way, you can open already existing excel also using `XlsIO`. @@ -608,7 +608,7 @@ workBook.SaveAs("Sample.xlsx"); {% endhighlight %} {% endtabs %} -![Changing Border Style in Exported Excel for WPF DataGrid](export-to-excel_images/wpf-datagrid-change-border-style.png) +![Changing border style in exported Excel](export-to-excel_images/wpf-datagrid-change-border-style.png) #### Enabling Filters @@ -625,7 +625,7 @@ workBook.SaveAs("Sample.xlsx"); {% endhighlight %} {% endtabs %} -![Filters on Exported Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-filter-on-exported-excel.png) +![Filters on exported Excel](export-to-excel_images/wpf-datagrid-filter-on-exported-excel.png) While using `stacked headers`, you can specify the `range` based on Stacked headers count. @@ -660,7 +660,7 @@ workBook.SaveAs("Sample.xlsx"); {% endhighlight %} {% endtabs %} -![Customizing Range of Cells in Exported Excel for WPF DataGrid](export-to-excel_images/wpf-datagrid-range-of-cells-customization.png) +![Customizing range of cells in exported Excel](export-to-excel_images/wpf-datagrid-range-of-cells-customization.png) ## Exporting DetailsView @@ -688,7 +688,7 @@ private static void ChildExportingHandler(object sender, GridChildExportingEvent {% endhighlight %} {% endtabs %} -![Excluding Specific DetailsView while Exporting to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-export-data-in-details-view.png) +![Excluding specific DetailsView while exporting to Excel](export-to-excel_images/wpf-datagrid-export-data-in-details-view.png) Here, `DetailsViewDataGrid` is not exported for the parent record having `OrderID` as 1002. @@ -711,13 +711,13 @@ private static void ChildExportingHandler(object sender, GridChildExportingEvent {% endhighlight %} {% endtabs %} -![Excluding Columns in DetailsViewDataGrid while Exporting to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-export-without-column.png) +![Excluding columns in DetailsViewDataGrid while exporting to Excel](export-to-excel_images/wpf-datagrid-export-without-column.png) Here, `OrderID` column is displayed in `DetailsViewDataGrid` and it is excluded while exporting to excel. ### Customizing DetailsViewDataGrid cells -Like parent DataGrid, You can customize the `DetailsViewDataGrid` cells also by using [CellsExportingEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_ChildExportingEventHandler). Based on [GridCellExcelExportingEventArgs.GridViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridCellExcelExportingEventArgs.html#Syncfusion_UI_Xaml_Grid_Converter_GridCellExcelExportingEventArgs_GridViewDefinition) property, you can identify the particular `DetailsViewDataGrid` and customize it. +Like parent Data Grid, You can customize the `DetailsViewDataGrid` cells also by using [CellsExportingEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.ExcelExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_ExcelExportingOptions_ChildExportingEventHandler). Based on [GridCellExcelExportingEventArgs.GridViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridCellExcelExportingEventArgs.html#Syncfusion_UI_Xaml_Grid_Converter_GridCellExcelExportingEventArgs_GridViewDefinition) property, you can identify the particular `DetailsViewDataGrid` and customize it. {% tabs %} {% highlight c# %} @@ -743,7 +743,7 @@ private static void CellExportingHandler(object sender, GridCellExcelExportingEv {% endhighlight %} {% endtabs %} -![Customizing DetailsViewDataGrid Cells while Exporting to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-exported-cell-customization.png) +![Customizing DetailsViewDataGrid cells while exporting to Excel](export-to-excel_images/wpf-datagrid-exported-cell-customization.png) ## Performance @@ -771,7 +771,7 @@ workBook.ActiveSheet.Columns[4].NumberFormat = "0.0"; {% endtabs %} -![Formatting the Column while Exporting to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-column-formatting.png) +![Formatting the column while exporting to Excel](export-to-excel_images/wpf-datagrid-column-formatting.png) ### Alternate row styling without using CellsExportingEventHandler @@ -800,6 +800,6 @@ condition2.BackColorRGB = System.Drawing.Color.LightGray; {% endhighlight %} {% endtabs %} -![Displaying Row Style while Exporting to Excel in WPF DataGrid](export-to-excel_images/wpf-datagrid-row-style.png) +![Displaying row style while exporting to Excel](export-to-excel_images/wpf-datagrid-row-style.png) diff --git a/wpf/DataGrid/Export-To-PDF.md b/wpf/DataGrid/Export-To-PDF.md index 41d0bcb26..9efc8da77 100644 --- a/wpf/DataGrid/Export-To-PDF.md +++ b/wpf/DataGrid/Export-To-PDF.md @@ -9,7 +9,7 @@ documentation: ug # Export To PDF in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to export data to PDF file. It also provides support for grouping, filtering, sorting, paging, unbound rows, merged cells, stacked headers and details View while exporting. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to export data to PDF file. It also provides support for grouping, filtering, sorting, paging, unbound rows, merged cells, stacked headers and details View while exporting. The following assemblies needs to be added for exporting to PDF file. @@ -18,7 +18,7 @@ The following assemblies needs to be added for exporting to PDF file. For NuGet package, have to install [Syncfusion.DataGridExcelExport.WPF](https://www.nuget.org/packages/Syncfusion.DataGridExcelExport.WPF) package. For more details refer this [UG link](https://help.syncfusion.com/wpf/control-dependencies#exporting-datagrid-to-excel-pdf-and-csv). -You can export SfDataGrid to PDF by using the following extension methods present in the [Syncfusion.UI.Xaml.Grid.Converter](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.html) namespace. +You can export Data Grid to PDF by using the following extension methods present in the [Syncfusion.UI.Xaml.Grid.Converter](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.html) namespace. * [ExportToPdf](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridPdfExportExtension.html#Syncfusion_UI_Xaml_Grid_Converter_GridPdfExportExtension_ExportToPdf_Syncfusion_UI_Xaml_Grid_SfDataGrid_) * [ExportToPdfGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridPdfExportExtension.html#Syncfusion_UI_Xaml_Grid_Converter_GridPdfExportExtension_ExportToPdfGrid_Syncfusion_UI_Xaml_Grid_SfDataGrid_Syncfusion_Data_ICollectionViewAdv_Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_) @@ -31,7 +31,7 @@ document.Save("Sample.pdf"); {% endhighlight %} {% endtabs %} -N> SfDataGrid exports data to PDF file by using [Essential PDF](https://help.syncfusion.com/file-formats/pdf/overview). You can refer [PDF documentation](https://help.syncfusion.com/file-formats/pdf/working-with-document) for manipulating. +N> Data Grid exports data to PDF file by using [Essential PDF](https://help.syncfusion.com/file-formats/pdf/overview). You can refer [PDF documentation](https://help.syncfusion.com/file-formats/pdf/working-with-document) for manipulating. ## PDF exporting options @@ -39,7 +39,7 @@ Exporting operation can be customized by passing [PdfExportingOptions](https://h ### Auto size column widths in PDF -You can export SfDataGrid to PDF by fitting column widths based on its content by setting [AutoColumnWidth](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_AutoColumnWidth) property as `true`. +You can export Data Grid to PDF by fitting column widths based on its content by setting [AutoColumnWidth](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_AutoColumnWidth) property as `true`. {% tabs %} {% highlight c# %} @@ -52,7 +52,7 @@ document.Save("Sample.pdf"); ### Auto size row heights in PDF -You can export SfDataGrid to PDF by fitting row heights based on its content by setting [AutoRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_AutoRowHeight) property as `true`. +You can export Data Grid to PDF by fitting row heights based on its content by setting [AutoRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_AutoRowHeight) property as `true`. {% tabs %} {% highlight c# %} @@ -65,7 +65,7 @@ document.Save("Sample.pdf"); ### Exclude columns while exporting -By default, all the columns (including hidden columns) in SfDataGrid will be exported to PDF. If you want to exclude some columns while exporting to PDF, you can use [ExcludeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExcludeColumns) property in [PdfExportingOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html). +By default, all the columns (including hidden columns) in Data Grid will be exported to PDF. If you want to exclude some columns while exporting to PDF, you can use [ExcludeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExcludeColumns) property in [PdfExportingOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html). {% tabs %} {% highlight c# %} @@ -133,7 +133,7 @@ document.Save("Sample.pdf"); ### Exclude groups while exporting -By default, all the groups in dataGrid will be exported to PDF. If you want to export without Groups, you need to set [ExportGroups](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExportGroups) property as `false`. +By default, all the groups in the Data Grid will be exported to PDF. If you want to export without Groups, you need to set [ExportGroups](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExportGroups) property as `false`. {% tabs %} {% highlight c# %} @@ -146,7 +146,7 @@ document.Save("Sample.pdf"); ### Exclude group Summaries while exporting -By default, group summaries in dataGrid will be exported to PDF. If you want to export without group summaries, you need to set [ExportGroupSummary](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExportGroupSummary) property as `false`. +By default, group summaries in the Data Grid will be exported to PDF. If you want to export without group summaries, you need to set [ExportGroupSummary](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExportGroupSummary) property as `false`. {% tabs %} {% highlight c# %} @@ -159,7 +159,7 @@ document.Save("Sample.pdf"); ### Exclude table Summaries while exporting -By default, table summaries in dataGrid will be exported to PDF. If you want to export without table summaries, you need to set [ExportTableSummary](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExportTableSummary) property as `false`. +By default, table summaries in the Data Grid will be exported to PDF. If you want to export without table summaries, you need to set [ExportTableSummary](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExportTableSummary) property as `false`. {% tabs %} {% highlight c# %} @@ -211,7 +211,7 @@ document.Save("Sample.pdf"); ## Setting Header and Footer -SfDataGrid provides a way to display additional content at the top (Header) or bottom (Footer) of the page while exporting to PDF. This can be achieved by setting [PageHeaderFooterEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_PageHeaderFooterEventHandler) in [PdfExportingOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html). +Data Grid provides a way to display additional content at the top (Header) or bottom (Footer) of the page while exporting to PDF. This can be achieved by setting [PageHeaderFooterEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_PageHeaderFooterEventHandler) in [PdfExportingOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html). You can insert string, image or any drawing in header and footer in `PdfHeaderFooterEventHandler`. Setting [PdfPageTemplateElement](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.PdfPageTemplateElement.html) to [PdfHeaderFooterEventArgs.PdfDocumentTemplate.Top](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.PdfDocumentTemplate.html#Syncfusion_Pdf_PdfDocumentTemplate_Top) loads the content at top of the page and setting the `PdfPageTemplateElement` to [PdfHeaderFooterEventArgs.PdfDocumentTemplate.Bottom](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.PdfDocumentTemplate.html#Syncfusion_Pdf_PdfDocumentTemplate_Bottom) loads the content at bottom of the page. @@ -233,7 +233,7 @@ static void PdfHeaderFooterEventHandler(object sender, PdfHeaderFooterEventArgs {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Export to PDF with Header and Footer](export-to-pdf_images/wpf-datagrid-header-footer.png) +![Export to PDF with Header and Footer](export-to-pdf_images/wpf-datagrid-header-footer.png) Here, `string` is inserted in the header of exported PDF file using [DrawString](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Graphics.PdfGraphics.html#Syncfusion_Pdf_Graphics_PdfGraphics_DrawString_System_String_Syncfusion_Pdf_Graphics_PdfFont_Syncfusion_Pdf_Graphics_PdfBrush_System_Drawing_PointF_) method. Similarly, you can insert image, line,etc. using [DrawImage](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Graphics.PdfGraphics.html#Syncfusion_Pdf_Graphics_PdfGraphics_DrawImage_Syncfusion_Pdf_Graphics_PdfImage_System_Drawing_PointF_), [DrawLine](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Graphics.PdfGraphics.html#Syncfusion_Pdf_Graphics_PdfGraphics_DrawLine_Syncfusion_Pdf_Graphics_PdfPen_System_Drawing_PointF_System_Drawing_PointF_) methods respectively. @@ -261,7 +261,7 @@ document.Save("Sample.pdf"); {% endhighlight %} {% endtabs %} -## Export DataGrid SelectedItems to PDF +## Export Data Grid SelectedItems to PDF By default, entire grid will be exported to PDF. You can export selected items only by passing `SelectedItems` to [ExportToPdf](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridPdfExportExtension.html#Syncfusion_UI_Xaml_Grid_Converter_GridPdfExportExtension_ExportToPdf_Syncfusion_UI_Xaml_Grid_SfDataGrid_) and [ExportToPdfGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridPdfExportExtension.html#Syncfusion_UI_Xaml_Grid_Converter_GridPdfExportExtension_ExportToPdfGrid_Syncfusion_UI_Xaml_Grid_SfDataGrid_Syncfusion_Data_ICollectionViewAdv_Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_) methods. @@ -274,7 +274,7 @@ document.Save("Sample.pdf"); {% endhighlight %} {% endtabs %} -![WPF DataGrid SelectedItems Exported to PDF](export-to-pdf_images/wpf-datagrid-export-selected-items.png) +![SelectedItems Exported to PDF](export-to-pdf_images/wpf-datagrid-export-selected-items.png) ## Saving options @@ -355,7 +355,7 @@ window.Show(); {% endhighlight %} {% endtabs %} -![WPF DataGrid Exported to PDF Viewer](export-to-pdf_images/wpf-datagrid-export-pdf-viewer.png) +![Exported to PDF Viewer](export-to-pdf_images/wpf-datagrid-export-pdf-viewer.png) ## Exporting Customization @@ -385,7 +385,7 @@ void GridPdfExportingEventHandler(object sender, GridPdfExportingEventArgs e) {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Exported PDF File](export-to-pdf_images/wpf-datagrid-export-pdf-file.png) +![Exported PDF File](export-to-pdf_images/wpf-datagrid-export-pdf-file.png) ### Embedding fonts in PDF file @@ -448,7 +448,7 @@ private void CellsExportingEventHandler(object sender, GridCellPdfExportingEvent {% endhighlight %} {% endtabs %} -![Customizing Cell Values while Exporting PDF File in WPF DataGrid](export-to-pdf_images/wpf-datagrid-cell-values-customization.png) +![Customizing Cell Values while Exporting PDF File](export-to-pdf_images/wpf-datagrid-cell-values-customization.png) Here, cell values are changed for `IsClosed` column based on custom condition. @@ -480,11 +480,11 @@ private void CellsExportingEventHandler(object sender, GridCellPdfExportingEvent {% endhighlight %} {% endtabs %} -![Changing PDF Grid Row Style while Exporting from WPF DataGrid](export-to-pdf_images/wpf-datagrid-row-style.png) +![Changing PDF Grid Row Style while Exporting](export-to-pdf_images/wpf-datagrid-row-style.png) -### Exporting Middle Eastern Languages (Arabic, Hebrew) from SfDataGrid to PDF +### Exporting Middle Eastern Languages (Arabic, Hebrew) from Data Grid to PDF -By default, [Middle Eastern languages ](https://en.wikipedia.org/wiki/Middle_East)(Arabic, Hebrew) in SfDataGrid are exported as left to right in PDF. You can export them as displayed in SfDataGrid (export from Right to Left) by enabling [RightToLeft](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Graphics.PdfStringFormat.html#Syncfusion_Pdf_Graphics_PdfStringFormat_RightToLeft) property in [PdfStringFormat](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Graphics.PdfStringFormat.html) class and apply the format to the [PdfGridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Grid.PdfGridCell.html) by using [CellsExportingEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_CellsExportingEventHandler). +By default, [Middle Eastern languages ](https://en.wikipedia.org/wiki/Middle_East)(Arabic, Hebrew) in Data Grid are exported as left to right in PDF. You can export them as displayed in the control (export from Right to Left) by enabling [RightToLeft](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Graphics.PdfStringFormat.html#Syncfusion_Pdf_Graphics_PdfStringFormat_RightToLeft) property in [PdfStringFormat](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Graphics.PdfStringFormat.html) class and apply the format to the [PdfGridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.Pdf.Grid.PdfGridCell.html) by using [CellsExportingEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_CellsExportingEventHandler). {% tabs %} {% highlight c# %} @@ -508,7 +508,7 @@ private void CellsExportingEventHandler(object sender, GridCellPdfExportingEvent {% endhighlight %} {% endtabs %} -![Exporting Middle Eastern Languages from WPF DataGrid to PDF File](export-to-pdf_images/wpf-datagrid-export-with-eastern-language.png) +![Exporting Middle Eastern Languages to PDF File](export-to-pdf_images/wpf-datagrid-export-with-eastern-language.png) ### Exporting images to PDF document @@ -555,7 +555,7 @@ private void CellsExportingEventHandler(object sender, GridCellPdfExportingEvent {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Export to PDF File with Image](export-to-pdf_images/wpf-datagrid-export-with-image.png) +![Export to PDF File with Image](export-to-pdf_images/wpf-datagrid-export-with-image.png) ## Exporting DetailsView @@ -570,7 +570,7 @@ document.Save("Sample.pdf"); {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Nested Grid Exported to PDF File](export-to-pdf_images/wpf-datagrid-export-nested-grid.png) +![Nested Grid Exported to PDF File](export-to-pdf_images/wpf-datagrid-export-nested-grid.png) By default, only expanded DetailsViewDataGrids only will be exported to PDF document. If you want to export all the DetailsViewDataGrids, you need to set [ExportAllDetails](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ExportAllDetails) as `true`. @@ -584,9 +584,9 @@ document.Save("Sample.pdf"); {% endhighlight %} {% endtabs %} -![WPF Nested DataGrid Exported to PDF File](export-to-pdf_images/wpf-datagrid-export-with-multiple-grid.png) +![Nested Grids Exported to PDF File](export-to-pdf_images/wpf-datagrid-export-with-multiple-grid.png) -Here, first record only expanded in SfDataGrid. But all the DetailsViewDataGrid’s are shown in exported PDF document. +Here, first record only expanded in the Data Grid. But all the DetailsViewDataGrid’s are shown in exported PDF document. You can customize its exporting operation by using [ChildGridExportingEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_ChildGridExportingEventHandler). @@ -614,7 +614,7 @@ void ChildGridExportingEventHandler(object sender, ChildGridPdfExportingEventArg {% endhighlight %} {% endtabs %} -![Exporting PDF File from WPF MasterDetailsView DataGrid](export-to-pdf_images/wpf-datagrid-export-with-details-view.png) +![Exporting PDF File from MasterDetailsView](export-to-pdf_images/wpf-datagrid-export-with-details-view.png) Here, `DetailsViewDataGrid` is not exported for the parent record having `OrderID` as 1002. @@ -637,13 +637,13 @@ void ChildGridExportingEventHandler(object sender, ChildGridPdfExportingEventArg {% endhighlight %} {% endtabs %} -![Exporting PDF File from WPF DataGrid without DetailsView](export-to-pdf_images/wpf-datagrid-export-without-details-view.png) +![Exporting PDF File without DetailsView](export-to-pdf_images/wpf-datagrid-export-without-details-view.png) Here, `OrderID` column is displayed in `DetailsViewDataGrid` and it is excluded while exporting to PDF. ### Customizing DetailsViewDataGrid cells -Like parent DataGrid, You can customize the `DetailsViewDataGrid` cells also by using [CellsExportingEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_CellsExportingEventHandler). Based on [GridCellPdfExportingEventArgs.GridViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridCellPdfExportingEventArgs.html#Syncfusion_UI_Xaml_Grid_Converter_GridCellPdfExportingEventArgs_GridViewDefinition) property, you can identify the particular `DetailsViewDataGrid` and customize it. +Like the parent grid, You can customize the `DetailsViewDataGrid` cells also by using [CellsExportingEventHandler](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.PdfExportingOptions.html#Syncfusion_UI_Xaml_Grid_Converter_PdfExportingOptions_CellsExportingEventHandler). Based on [GridCellPdfExportingEventArgs.GridViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Converter.GridCellPdfExportingEventArgs.html#Syncfusion_UI_Xaml_Grid_Converter_GridCellPdfExportingEventArgs_GridViewDefinition) property, you can identify the particular `DetailsViewDataGrid` and customize it. {% tabs %} {% highlight c# %} @@ -670,6 +670,6 @@ private void CellsExportingEventHandler(object sender, GridCellPdfExportingEvent {% endhighlight %} {% endtabs %} -![Customizing WPF DetailsView DataGrid Cells Exported to PDF File](export-to-pdf_images/wpf-datagrid-details-view-cells-customization.png) +![Customizing DetailsView Cells Exported to PDF File](export-to-pdf_images/wpf-datagrid-details-view-cells-customization.png) diff --git a/wpf/DataGrid/FilterRow.md b/wpf/DataGrid/FilterRow.md index 34ce0e85c..43f479c5a 100644 --- a/wpf/DataGrid/FilterRow.md +++ b/wpf/DataGrid/FilterRow.md @@ -8,7 +8,7 @@ documentation: ug --- # Filter Row in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides built-in row (called FilterRow) to filter the records. You can enable the FilterRow by specifying the position where it should be displayed by setting [SfDataGrid.FilterRowPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.FilterRowPosition.html) property. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides built-in row (called FilterRow) to filter the records. You can enable the FilterRow by specifying the position where it should be displayed by setting [SfDataGrid.FilterRowPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.FilterRowPosition.html) property. {% tabs %} {% highlight xaml %} @@ -22,7 +22,7 @@ this.dataGrid.FilterRowPosition = FilterRowPosition.FixedTop; {% endhighlight %} {% endtabs %} -![WPF DataGrid with Filter Row](FilterRow_images/wpf-datagrid-filter-row.png) +![With Filter Row](FilterRow_images/wpf-datagrid-filter-row.png) You can get the row index of FilterRow by using the [SfDataGrid.GetFilterRowIndex ](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridIndexResolver.html#Syncfusion_UI_Xaml_Grid_GridIndexResolver_GetFilterRowIndex_Syncfusion_UI_Xaml_Grid_SfDataGrid_)method. @@ -53,9 +53,9 @@ By default, FilterRow loads the editors based on underlying property type to fil this.dataGrid.Columns[2].FilterRowEditorType = "MultiSelectComboBox"; {% endhighlight %} {% endtabs %} -![WPF DataGrid Filter Row Cell with MultiSelect ComboBox](FilterRow_images/wpf-datagrid-multiselect-combobox.png) +![Filter Row with MultiSelect ComboBox](FilterRow_images/wpf-datagrid-multiselect-combobox.png) -Below are the built-in FilterRow editor types supported in SfDataGrid. +Below are the built-in FilterRow editor types supported in the Data Grid.
+Resolves the start index of group in the Data Grid associated with SfDataGrid.View.Groups. When there is no group in the Data Grid it returns -1.
@@ -171,9 +171,9 @@ Based on the editor type, FilterRowCell displays the filter conditions in dropdo this.dataGrid.Columns[0].FilterRowOptionsVisibility = System.Windows.Visibility.Collapsed; {% endhighlight %} {% endtabs %} -![WPF DataGrid with Filter Row](FilterRow_images/wpf-datagrid-filter-option.png) +![Filter Row with Filter Option](FilterRow_images/wpf-datagrid-filter-option.png) -Below are the filter conditions supported by different filter row editors in SfDataGrid. +Below are the filter conditions supported by different filter row editors in the Data Grid.
@@ -277,7 +277,7 @@ this.dataGrid.Columns[0].FilterRowCondition = FilterRowCondition.LessThanOrEqual {% endhighlight %} {% endtabs %} -![Filter Row with Numeric Editor in WPF DataGrid](FilterRow_images/wpf-datagrid-filter-row-editor.png) +![Filter Row with Numeric Editor](FilterRow_images/wpf-datagrid-filter-row-editor.png) ## Filtering null values You can enable or disable filtering of null values by setting [GridColumn.AllowBlankFilters](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_AllowBlankFilters) property. The default value is `true`. @@ -293,7 +293,7 @@ When null value filtering is enabled, the filter options loaded with two additio this.dataGrid.Columns[0].AllowBlankFilters = false; {% endhighlight %} {% endtabs %} -![Filter Row without Null option in WPF DataGrid](FilterRow_images/wpf-datagrid-filter-without-null.png) +![Filter Row without Null option](FilterRow_images/wpf-datagrid-filter-without-null.png) {% tabs %} {% highlight xaml %} @@ -305,7 +305,7 @@ this.dataGrid.Columns[0].AllowBlankFilters = false; this.dataGrid.Columns[2].AllowBlankFilters = true; {% endhighlight %} {% endtabs %} -![Filter Row with Null option in WPF DataGrid](FilterRow_images/wpf-datagrid-filter-with-null-option.png) +![Filter Row with Null option](FilterRow_images/wpf-datagrid-filter-with-null-option.png) ## Instant Filtering By default, filters are applied to the columns when moving to other cells or pressing enter key. You can apply filter when typing or selecting in editor itself by setting [GridColumn.ImmediateUpdateColumnFilter](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_ImmediateUpdateColumnFilter) as `true`. @@ -319,7 +319,7 @@ By default, filters are applied to the columns when moving to other cells or pre this.dataGrid.Columns[2].ImmediateUpdateColumnFilter = true; {% endhighlight %} {% endtabs %} -![Immediate Column Filter with Filter Row in WPF DataGrid](FilterRow_images/wpf-datagrid-immediate-column-filter.png) +![Immediate Column Filter with Filter Row](FilterRow_images/wpf-datagrid-immediate-column-filter.png) ## Disable filtering for a particular FilterRowCell By default, you can filter the records by editing filter row cell. You can disable this editing by using [CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. @@ -357,7 +357,7 @@ You can customize the style of filter row by writing style of TargetType [Filte {% endhighlight %} {% endtabs %} -![Customizing Filter Row Style in WPF DataGrid](FilterRow_images/wpf-datagrid-filter-row-style.png) +![Customizing Filter Row Style](FilterRow_images/wpf-datagrid-filter-row-style.png) ### Filter row - cell style You can customize the style of filter row cell by writing style of TargetType [GridFilterRowCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowFilter.GridFilterRowCell.html). @@ -390,7 +390,7 @@ public class FilterRowCellStyleConverter : IValueConverter } {% endhighlight %} {% endtabs %} -![Customizing Filter Row Cell Style in WPF DataGrid](FilterRow_images/wpf-datagrid-filter-row-cell-style.png) +![Customizing Filter Row Cell Style](FilterRow_images/wpf-datagrid-filter-row-cell-style.png) ## Customizing filter row cell You can customize the filter row cell by overriding the [GridFilterRowCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowFilter.GridFilterRowCell.html). You have to override the GetGridCell method in [RowGenerator](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowGenerator.html) to load the customized `GridFilterRowCell`. @@ -510,12 +510,12 @@ public class CustomRowGenerator : RowGenerator } {% endhighlight %} {% endtabs %} -![Customizing Filter Row Option in WPF DataGrid](FilterRow_images/wpf-datagrid-filter-row-option.png) +![Customizing Filter Row Option](FilterRow_images/wpf-datagrid-filter-row-option.png) ## Customizing Filter row editors ### Customizing the filter row renderer -SfDataGrid allows you to customize the filter row renderer behavior by overriding the corresponding renderer associated with the filter row cell. Each renderer have a set of virtual methods for handling the filter row behaviors. You can also create new renderers instead of overriding the existing renderer. +The Data Grid allows you to customize the filter row renderer behavior by overriding the corresponding renderer associated with the filter row cell. Each renderer have a set of virtual methods for handling the filter row behaviors. You can also create new renderers instead of overriding the existing renderer. You can customize the default TextBox editor behavior by overriding `GridFilterRowTextBoxRenderer` class and add the custom renderer to [FilterRowCellRenderers](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_FilterRowCellRenderers). {% tabs %} {% highlight xaml %} @@ -796,7 +796,7 @@ public class GridFilterRowComboBoxRendererExt : GridFilterRowComboBoxRenderer, I } {% endhighlight %} {% endtabs %} -![WPF DataGrid Filter Row with MultiSelectComboBox](FilterRow_images/wpf-datagrid-filter-row-multiselect-combobox.png) +![Filter Row with MultiSelectComboBox](FilterRow_images/wpf-datagrid-filter-row-multiselect-combobox.png) ### Numeric filter row conditions for string typed column By default, TextBox filter is loaded when underlying property type is string which is bound to a column. The below code shows how to apply the numeric filter row conditions for that particular column using converters in [ValueBinding](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_ValueBinding) property. @@ -846,7 +846,7 @@ public class GridFilterRowNumericRendererExt : GridFilterRowNumericRenderer ## Customizing GridFilterRowMultiSelectRenderer -By default, in SfDataGrid ComboBox is loaded while enter into edit mode in FilterRow but you can customize the [GridFilterRowMultiSelectRenderer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowFilter.GridFilterRowMultiSelectRenderer.html) for display the combobox while FilterRow loading itself. +By default, in the Data Grid ComboBox is loaded while enter into edit mode in FilterRow but you can customize the [GridFilterRowMultiSelectRenderer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowFilter.GridFilterRowMultiSelectRenderer.html) for display the combobox while FilterRow loading itself. {% tabs %} {% highlight xaml %} @@ -894,7 +894,7 @@ public class GridMultiSelectComboBoxRendererExt: GridFilterRowMultiSelectRendere {% endhighlight %} {% endtabs %} -![Customizing Filter Row in WPF DataGrid](FilterRow_images/wpf-datagrid-filter-row-customization.png) +![Customizing Filter Row](FilterRow_images/wpf-datagrid-filter-row-customization.png) You can get the sample from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/GridMultiselect1545001818). diff --git a/wpf/DataGrid/Filtering.md b/wpf/DataGrid/Filtering.md index a8330ef32..3b1e19c0b 100644 --- a/wpf/DataGrid/Filtering.md +++ b/wpf/DataGrid/Filtering.md @@ -7,11 +7,11 @@ control: Data Grid documentation: ug --- # Filtering in WPF Data Grid -Filtering is the process of retrieving the values from the collection which satisfy the specified condition. In the [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) the filtering can be applied though the UI as well as the programmatic filters. +Filtering is the process of retrieving the values from the collection which satisfy the specified condition. In the [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) the filtering can be applied though the UI as well as the programmatic filters. ## Programmatic filtering -The [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) Filter allows you to filter the data programmatically in below ways, +The [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) filter allows you to filter the data programmatically in below ways, * Through View Predicate * Through Column Filter @@ -101,7 +101,7 @@ private void OnApplyFilterPredicate(object obj) ### Clear Filtering -The WPF DataGrid (SfDataGrid) allows you to clear the filters by clearing the filter predicates. This is achieved by invoking the following methods. +The WPF Data Grid allows you to clear the filters by clearing the filter predicates. This is achieved by invoking the following methods. * [SfDataGrid.ClearFilters](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ClearFilters) - Clears filters for all the columns programmatically. * [SfDataGrid.ClearFilter(String columnName)](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ClearFilter_System_String_) - Clears the filter for particular column that has the columnName as `MappingName`. @@ -118,7 +118,7 @@ this.dataGrid.ClearFilter(this.dataGrid.Columns[0]); ## Excel like UI Filtering -The WPF DataGrid (SfDataGrid) provides excel like filtering UI and also advanced filter UI to filter the data easily. UI filtering can be enabled by setting [SfDataGrid.AllowFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowFiltering) property to `true` , where you can open filter UI by clicking the Filter icon in column header and filter the records. +The WPF Data Grid provides excel like filtering UI and also advanced filter UI to filter the data easily. UI filtering can be enabled by setting [SfDataGrid.AllowFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowFiltering) property to `true` , where you can open filter UI by clicking the Filter icon in column header and filter the records. {% tabs %} {% highlight xaml %} @@ -152,7 +152,7 @@ N> ### Built-in UI Views -SfDataGrid filter UI comprises of two different UIs. +The Data Grid filter UI comprises of two different UIs. * **Checkbox Filter UI** - Provides excel like filter interface with list of check box’s. @@ -160,17 +160,17 @@ SfDataGrid filter UI comprises of two different UIs. By default, both Checkbox Filter and Advanced Filter are loaded while opening the filter pop-up. You can switch between AdvancedFilter and CheckboxFilter by using AdvancedFilter button in the UI View. -SfDataGrid with Checkbox Filter View: +Data Grid with Checkbox Filter View: -![WPF DataGrid with CheckBox Filter](filtering_images/wpf-datagrid-checkbox-filter.png) +![With CheckBox Filter](filtering_images/wpf-datagrid-checkbox-filter.png) -SfDataGrid with Advanced Filter View: +Data Grid with Advanced Filter View: -![WPF DataGrid with Advanced Filter](filtering_images/wpf-datagrid-advanced-filter.png) +![With Advanced Filter](filtering_images/wpf-datagrid-advanced-filter.png) ## Choose between built-in UI Views -The WPF DataGrid (SfDataGrid) lets you to customize the UI Views displayed for particular column or grid using [FilterMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridFilterControl.html#Syncfusion_UI_Xaml_Grid_GridFilterControl_FilterMode) property in [GridFilterControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridFilterControl.html). +The WPF Data Grid lets you to customize the UI Views displayed for particular column or grid using [FilterMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridFilterControl.html#Syncfusion_UI_Xaml_Grid_GridFilterControl_FilterMode) property in [GridFilterControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridFilterControl.html). Below are the options, @@ -418,7 +418,7 @@ N> When you use [DataTable](https://learn.microsoft.com/en-us/dotnet/api/system. {% endhighlight %} {% endtabs %} -![Improving Performance while Applying Filter in WPF DataGrid](filtering_images/wpf-datagrid-apply-filter.png) +![Improving Performance while Applying Filter](filtering_images/wpf-datagrid-apply-filter.png) By default, [CanGenerateUniqueItems](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AdvancedFilterControl.html#Syncfusion_UI_Xaml_Grid_AdvancedFilterControl_CanGenerateUniqueItems) is true. So all the unique items in the column are loaded in the AdvancedFilter ComboBox that allows you to select the value easily from the combo box and filter it. @@ -437,11 +437,11 @@ dataGrid.Columns["Country"].AllowBlankFilters = false; Checkbox Filter with `AllowBlankFilters` as `True` -![Filter Null Values using CheckBox Filter in WPF DataGrid](filtering_images/wpf-datagrid-null-values-in-checkbox-filter.png) +![Filter Null Values using CheckBox Filter](filtering_images/wpf-datagrid-null-values-in-checkbox-filter.png) Advanced Filter with `AllowBlankFilters` as `True` -![Filter Null Values using Advanced Filter in WPF DataGrid](filtering_images/wpf-datagrid-null-values-in-advanced-filter.png) +![Filter Null Values using Advanced Filter](filtering_images/wpf-datagrid-null-values-in-advanced-filter.png) ## Instant Filtering @@ -460,11 +460,11 @@ Here, the OK and Cancel buttons are unavailable and Done button is available to Checkbox Filter with `ImmediateUpdateColumnFilter` is `True` -![CheckBox Filter with Immediate Filter in WPF DataGrid](filtering_images/wpf-datagrd-checkbox-immediate-filter.png) +![CheckBox Filter with Immediate Filter](filtering_images/wpf-datagrd-checkbox-immediate-filter.png) Advanced Filter with `ImmediateUpdateColumnFilter` is `True` -![Advanced Filter with Immediate Filter in WPF DataGrid](filtering_images/wpf-datagrd-advanced-immediate-filter.png) +![Advanced Filter with Immediate Filter](filtering_images/wpf-datagrd-advanced-immediate-filter.png) N> In Checkbox Filter, the `SelectAll` option is not reflected in the filter updates if [ImmediateUpdateColumnFilter](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_ImmediateUpdateColumnFilter) is true. @@ -481,25 +481,25 @@ dataGrid.Columns["OrderDate"].ColumnFilter = ColumnFilter.DisplayText; {% endhighlight %} {% endtabs %} -Consider in the following dataGrid, first and second records have same display value for OrderDate column but both have different actual value (E.g. 2/10/2010 12:00:00 AM and 2/10/2010 6:30:00 PM). +Consider in the following grid, first and second records have same display value for OrderDate column but both have different actual value (E.g. 2/10/2010 12:00:00 AM and 2/10/2010 6:30:00 PM). -![Filter WPF DataGrid using Actual Value instead of Formatted String](filtering_images/wpf-datagrid-filter-formatted-string.png) +![Filtering using Actual Value instead of Formatted String](filtering_images/wpf-datagrid-filter-formatted-string.png) By default, based on the actual value only filter will be applied. So it will consider both values as different. And while opening filter popup, both values will be displayed like below. -![Filtering WPF DataGrid based on Formatted String](filtering_images/wpf-datagrid-string-format.png) +![Filtering based on Formatted String](filtering_images/wpf-datagrid-string-format.png) If you set [ColumnFilter](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_ColumnFilter) as DisplayText, display value only will be considered for filtering. So filter popup will be shown like below. -![Filter based on actual value in WPF DataGrid](filtering_images/wpf-datagrid-filter-actual-value.png) +![Filter based on actual value](filtering_images/wpf-datagrid-filter-actual-value.png) After filtering, both records having the same OrderDate display value will be displayed in view. -![Filtered same Record Values in WPF DataGrid](filtering_images/wpf-datagrid-filter-same-records.png) +![Filtered same Record Values](filtering_images/wpf-datagrid-filter-same-records.png) ## Events -SfDataGrid provides the following events for filtering. +The Data Grid provides the following events for filtering. ### FilterChanging event @@ -582,7 +582,7 @@ void dataGrid_FilterChanged(object sender, GridFilterEventArgs e) ## Show image in CheckBoxFilterControl instead of image path -By default, in SfDataGrid image path is shown inside the CheckBoxFilterControl instead of image but you can show the image in CheckBoxFilterControl by setting [CheckBoxFilterControl.ItemTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CheckboxFilterControl.html#Syncfusion_UI_Xaml_Grid_CheckboxFilterControl_ItemTemplate) as like below. +By default, in the Data Grid image path is shown inside the CheckBoxFilterControl instead of image but you can show the image in CheckBoxFilterControl by setting [CheckBoxFilterControl.ItemTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CheckboxFilterControl.html#Syncfusion_UI_Xaml_Grid_CheckboxFilterControl_ItemTemplate) as like below. {% tabs %} {% highlight xaml %} @@ -648,7 +648,7 @@ public class StringToImageConverter : IValueConverter {% endhighlight %} {% endtabs %} -![Filter with Image in WPF DataGrid Column](filtering_images/wpf-datagrid-filter-with-image.png) +![Filter with Image in Column](filtering_images/wpf-datagrid-filter-with-image.png) You can get the sample from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/CheckBoxFilterControlImage1515534249.zip). @@ -768,7 +768,7 @@ Sort Options can be collapsed by setting [SortOptionVisibility](https://help.syn {% endhighlight %} {% endtabs %} -![Collapse sort option from filter popup in WPF DataGrid](filtering_images/wpf-datagrid-collapse-sort-option.png) +![Collapse sort option from filter popup](filtering_images/wpf-datagrid-collapse-sort-option.png) ### Customizing Sort Options text @@ -806,7 +806,7 @@ You can customize the FilterPopup size using [FilterPopupHeight](https://help.sy {% endhighlight %} {% endtabs %} -![Customizing Sort Option Text from Filter Popup in WPF DataGrid](filtering_images/wpf-datagrid-filter-popup-customization.png) +![Customizing Sort Option Text from Filter Popup](filtering_images/wpf-datagrid-filter-popup-customization.png) ### Changing filter icon style after applying filters @@ -924,7 +924,7 @@ When you apply above style to [FilterToggleButton](https://help.syncfusion.com/c [How to apply search and filter for one column in SfDataGrid?](https://support.syncfusion.com/kb/article/7984/how-to-apply-search-and-filter-for-one-column-in-wpf-datagrid-sfdatagrid) -[How to customize the Filtering and Sorting icons in the SfDataGrid ?](https://support.syncfusion.com/kb/article/7261/how-to-customize-the-filtering-and-sorting-icons-in-wpf-datagrid-sfdatagrid) +[How to customize the Filtering and Sorting icons in the Data Grid ?](https://support.syncfusion.com/kb/article/7261/how-to-customize-the-filtering-and-sorting-icons-in-wpf-datagrid-sfdatagrid) [How to change the Filter Predicate showing in CheckBoxFilter UI ?](https://support.syncfusion.com/kb/article/6956/how-to-change-the-filter-predicate-showing-in-checkboxfilter-ui-in-wpf-datagrid-sfdatagrid) diff --git a/wpf/DataGrid/Getting-Started.md b/wpf/DataGrid/Getting-Started.md index 6581fee7d..49b08817e 100644 --- a/wpf/DataGrid/Getting-Started.md +++ b/wpf/DataGrid/Getting-Started.md @@ -10,15 +10,15 @@ documentation: ug # Getting Started with WPF Data Grid -This section provides a quick overview for working with the [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) for WPF. Walk through the entire process of creating a real world of this control. +This section provides a quick overview for working with the [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) for WPF. Walk through the entire process of creating a real world of this control. -To get start quickly with WPF DataGrid, you can check on this video: +To get start quickly with the WPF Data Grid, you can check on this video: ## Assembly deployment -The following list of assemblies needs to be added as reference to use SfDataGrid control in any application, +The following list of assemblies needs to be added as reference to use the Data Grid control in any application, @@ -34,7 +34,7 @@ Description Syncfusion.Data.WPF @@ -42,7 +42,7 @@ Syncfusion.Data.WPF assembly contains fundamental and base classes for {{'[Colle Syncfusion.SfGrid.WPF @@ -50,12 +50,12 @@ Syncfusion.SfGrid.WPF assembly contains classes that handles all UI operations o Syncfusion.Shared.WPF
-Syncfusion.Data.WPF assembly contains fundamental and base classes for {{'[CollectionViewAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.CollectionViewAdv.html)'| markdownify }} which is responsible for data processing operations handled in SfDataGrid. +Syncfusion.Data.WPF assembly contains fundamental and base classes for {{'[CollectionViewAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.CollectionViewAdv.html)'| markdownify }} which is responsible for data processing operations handled in the Data Grid.
-Syncfusion.SfGrid.WPF assembly contains classes that handles all UI operations of SfDataGrid. SfDataGrid control present Syncfusion.UI.Xaml.Grid namespace. This namespace also added in http://schemas.syncfusion.com/wpf Syncfusion® WPF schema. +Syncfusion.SfGrid.WPF assembly contains classes that handles all UI operations of the Data Grid. The Data Grid control present Syncfusion.UI.Xaml.Grid namespace. This namespace also added in http://schemas.syncfusion.com/wpf Syncfusion® WPF schema.
-Syncfusion.Shared.WPF contains various editor controls (such as IntegerTextBox, DoubleTextBox and etc) which are used in SfDataGrid. +Syncfusion.Shared.WPF contains various editor controls (such as IntegerTextBox, DoubleTextBox and etc) which are used in the Data Grid.
-In order to use export to excel and export to PDF functionalities of SfDataGrid control, add the reference to following assemblies, +In order to use export to excel and export to PDF functionalities of the Data Grid control, add the reference to following assemblies, @@ -71,7 +71,7 @@ Description Syncfusion.SfGridConverter.WPF @@ -93,9 +93,9 @@ Syncfusion.Pdf.Base contains fundamental and base classes for creating PDF.
-Syncfusion.SfGridConverter.WPF contains static extension classes for exporting SfDataGrid to excel and PDF in Syncfusion.UI.Xaml.Grid.Converter namespace. +Syncfusion.SfGridConverter.WPF contains static extension classes for exporting the Data Grid to excel and PDF in Syncfusion.UI.Xaml.Grid.Converter namespace.
-## Creating simple application with SfDataGrid +## Creating simple application with Data Grid -In this walk through, you will create WPF application that contains SfDataGrid control. +In this walk through, you will create WPF application that contains the Data Grid control. 1. [Creating project](#creating-the-project) 2. [Adding control via Designer](#adding-control-via-designer) @@ -110,12 +110,12 @@ In this walk through, you will create WPF application that contains SfDataGrid c ### Creating the project -Create new WPF Project in Visual Studio to display SfDataGrid with data objects. +Create new WPF Project in Visual Studio to display the Data Grid with data objects. ### Adding control via Designer -SfDataGrid control can be added to the application by dragging it from Toolbox and dropping it in Designer view. The required assembly references will be added automatically. - ![Dragging WPF DataGrid Control from Toolbox to Designer](getting-started_images/wpf-datagrid-toolbox.png) +The Data Grid control can be added to the application by dragging it from Toolbox and dropping it in Designer view. The required assembly references will be added automatically. + ![Dragging the control from Toolbox to Designer](getting-started_images/wpf-datagrid-toolbox.png) ### Adding control manually in XAML @@ -125,8 +125,8 @@ In order to add control manually in XAML, do the below steps, * Syncfusion.Data.WPF * Syncfusion.SfGrid.WPF * Syncfusion.Shared.WPF -2. Import Syncfusion® WPF schema **http://schemas.syncfusion.com/wpf** or SfDataGrid control namespace **Syncfusion.UI.Xaml.Grid** in XAML page. -3. Declare SfDataGrid control in XAML page. +2. Import Syncfusion® WPF schema **http://schemas.syncfusion.com/wpf** or the Data Grid control namespace **Syncfusion.UI.Xaml.Grid** in XAML page. +3. Declare the Data Grid control in XAML page. {% capture codesnippet1 %} {% tabs %} @@ -153,8 +153,8 @@ In order to add control manually in C#, do the below steps, * Syncfusion.Data.WPF * Syncfusion.SfGrid.WPF * Syncfusion.Shared.WPF -2. Import SfDataGrid namespace **Syncfusion.UI.Xaml.Grid** . -3. Create SfDataGrid control instance and add it to the Page. +2. Import the Data Grid namespace **Syncfusion.UI.Xaml.Grid** . +3. Create the Data Grid control instance and add it to the Page. {% capture codesnippet2 %} {% tabs %} @@ -181,7 +181,7 @@ namespace WpfApplication1 ### Creating Data Model for sample application -SfDataGrid is a data-bound control. So before create binding to the control, you must create data model for Application. +The Data Grid is a data-bound control. So before create binding to the control, you must create data model for Application. 1. Create data object class named **OrderInfo** and declare properties as shown below, @@ -284,7 +284,7 @@ public class ViewModel ### Binding to Data -To bind the SfDataGrid to data, set the [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property to an IEnumerable implementation. Each row in SfDataGrid is bound to an object in data source and each column in SfDataGrid bound to a property in data object. +To bind the Data Grid to data, set the [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property to an IEnumerable implementation. Each row in the Data Grid is bound to an object in data source and each column bound to a property in data object. Bind the collection created in previous step to `SfDataGrid.ItemsSource` property in XAML by setting ViewModel as `DataContext`. @@ -315,10 +315,10 @@ dataGrid.ItemsSource = viewModel.Orders; Now, run the application and you can expect the see the below output, -![WPF DataGrid](getting-started_images/wpf-datagrid-output.png) +![Output](getting-started_images/wpf-datagrid-output.png) ## Defining Columns -By default, the SfDataGrid control generates the columns automatically when value assigned to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property. The type of the column generated depends on the type of data in the column and the attribute of the property the column bound with. +By default, the Data Grid control generates the columns automatically when value assigned to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) property. The type of the column generated depends on the type of data in the column and the attribute of the property the column bound with. The following table lists the column types and its constraints for auto column generation. @@ -381,7 +381,7 @@ Property of type Bool.
-When columns are auto-generated, you can handle the [SfDataGrid.AutoGeneratingColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGeneratingColumn) event to `customize` or `cancel` the columns before they are added to the SfDataGrid. +When columns are auto-generated, you can handle the [SfDataGrid.AutoGeneratingColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGeneratingColumn) event to `customize` or `cancel` the columns before they are added to the grid. You can prevent the automatic column generation by setting [SfDataGrid.AutoGenerateColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AutoGenerateColumns "") property to `false`. When [SfDataGrid.AutoGenerateColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AutoGenerateColumns "") property is `false`, you have to define the columns to be displayed as below, @@ -404,7 +404,7 @@ dataGrid.Columns.Add(new GridTextColumn() { MappingName = "CustomerName" }); {% endhighlight %} {% endtabs %} -Below is the list of column types provided in SfDataGrid. +Below is the list of column types provided in the Data Grid. @@ -420,7 +420,7 @@ Comments GridTextColumn @@ -428,7 +428,7 @@ Represents SfDataGrid column that hosts textual content in its cells. GridNumericColumn @@ -436,7 +436,7 @@ Represents SfDataGrid column that hosts {{'[DoubleTextBox](https://help.syncfusi GridCurrencyColumn @@ -444,7 +444,7 @@ Represents SfDataGrid column that hosts {{'[CurrencyTextBox](https://help.syncfu GridPercentColumn @@ -452,7 +452,7 @@ Represents SfDataGrid column that hosts {{'[PercentTextBox](https://help.syncfus GridMaskColumn @@ -460,7 +460,7 @@ Represents SfDataGrid column that hosts MaskedTextBox controls in its cel GridTimeSpanColumn @@ -468,7 +468,7 @@ Represents SfDataGrid column that hosts {{'[TimeSpanEdit](https://help.syncfusio GridDateTimeColumn @@ -476,7 +476,7 @@ Represents SfDataGrid column that hosts {{'[DateTimeEdit](https://help.syncfusio GridComboBoxColumn @@ -484,7 +484,7 @@ Represents SfDataGrid column that hosts ComboBox controls in its cells. GridCheckBoxColumn @@ -492,7 +492,7 @@ Represents SfDataGrid column that hosts CheckBox controls in its cells. GridImageColumn @@ -500,7 +500,7 @@ Represents SfDataGrid column that hosts Image controls in its cells. GridHyperlinkColumn @@ -508,7 +508,7 @@ Represents SfDataGrid column that hosts Hyperlink controls in its cells. GridTemplateColumn @@ -516,7 +516,7 @@ Represents SfDataGrid column that hosts template-specified content in its cells GridUnboundColumn @@ -524,26 +524,26 @@ Represents SfDataGrid column that hosts textual or template-specified content wh GridMultiColumnDropdownList
-Represents SfDataGrid column that hosts textual content in its cells. +Represents the Data Grid column that hosts textual content in its cells.
-Represents SfDataGrid column that hosts {{'[DoubleTextBox](https://help.syncfusion.com/wpf/double-textbox/overview)'| markdownify}} controls in its cells which is used to format and display Numeric values. +Represents the Data Grid column that hosts {{'[DoubleTextBox](https://help.syncfusion.com/wpf/double-textbox/overview)'| markdownify}} controls in its cells which is used to format and display Numeric values.
-Represents SfDataGrid column that hosts {{'[CurrencyTextBox](https://help.syncfusion.com/wpf/currency-textbox/overview)'|markdownify}} controls in its cells which is used to display numeric values with currency format. +Represents the Data Grid column that hosts {{'[CurrencyTextBox](https://help.syncfusion.com/wpf/currency-textbox/overview)'|markdownify}} controls in its cells which is used to display numeric values with currency format.
-Represents SfDataGrid column that hosts {{'[PercentTextBox](https://help.syncfusion.com/wpf/percent-textbox/overview)'|markdownify}} controls in its cells which is used to display numeric values with percent format. +Represents the Data Grid column that hosts {{'[PercentTextBox](https://help.syncfusion.com/wpf/percent-textbox/overview)'| markdownify}} controls in its cells which is used to display numeric values with percent format.
-Represents SfDataGrid column that hosts MaskedTextBox controls in its cells which is used to display textual content by applying Mask. +Represents the Data Grid column that hosts MaskedTextBox controls in its cells which is used to display textual content by applying Mask.
-Represents SfDataGrid column that hosts {{'[TimeSpanEdit](https://help.syncfusion.com/wpf/timespan-editor/overview)'|markdownify}} controls in its cells which is used to display format and display TimeSpan values. +Represents the Data Grid column that hosts {{'[TimeSpanEdit](https://help.syncfusion.com/wpf/timespan-editor/overview)'| markdownify}} controls in its cells which is used to display format and display TimeSpan values.
-Represents SfDataGrid column that hosts {{'[DateTimeEdit](https://help.syncfusion.com/wpf/datetimepicker/overview)'|markdownify}} controls in its cells which is used to display and format DateTime values. +Represents the Data Grid column that hosts {{'[DateTimeEdit](https://help.syncfusion.com/wpf/datetimepicker/overview)'| markdownify}} controls in its cells which is used to display and format DateTime values.
-Represents SfDataGrid column that hosts ComboBox controls in its cells. +Represents the Data Grid column that hosts ComboBox controls in its cells.
-Represents SfDataGrid column that hosts CheckBox controls in its cells. +Represents the Data Grid column that hosts CheckBox controls in its cells.
-Represents SfDataGrid column that hosts Image controls in its cells. +Represents the Data Grid column that hosts Image controls in its cells.
-Represents SfDataGrid column that hosts Hyperlink controls in its cells. +Represents the Data Grid column that hosts Hyperlink controls in its cells.
-Represents SfDataGrid column that hosts template-specified content in its cells +Represents the Data Grid column that hosts template-specified content in its cells
-Represents SfDataGrid column that hosts textual or template-specified content which are not actually bound with data object of row. +Represents the Data Grid column that hosts textual or template-specified content which are not actually bound with data object of row.
-Represents SfDataGrid column that hosts {{'[SfMultiColumnDropDownControl](https://help.syncfusion.com/wpf/multi-column-dropdown/overview)'|markdownify}} in its cells. +Represents the Data Grid column that hosts {{'[SfMultiColumnDropDownControl](https://help.syncfusion.com/wpf/multi-column-dropdown/overview)'|markdownify}} in its cells.
## Selection -By default, the entire row is selected when a user clicks a cell in a SfDataGrid. You can set the [SfDataGrid.SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode) property to specify whether a user can select single row or cell, or multiple rows or cells. Set the [SfDataGrid.SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) property to specify whether rows can be selected, or cells can selected. +By default, the entire row is selected when a user clicks a cell in the Data Grid. You can set the [SfDataGrid.SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode) property to specify whether a user can select single row or cell, or multiple rows or cells. Set the [SfDataGrid.SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) property to specify whether rows can be selected, or cells can selected. When `SelectionUnit` is `Row`, you can get information about the rows that are selected using [SfDataGrid.SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) and [SfDataGrid.SelectedItems](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItems) properties. When `SfDataGrid.SelectionUnit` is `Cell`, you can get information about the cells that are selected by calling [SfDataGrid.GetSelectedCells](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GetSelectedCells) method. -You can handle the selection operations with the help of [SfDataGrid.SelectionChanging](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionChanging) and [SfDataGrid.SelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionChanged) events of SfDataGrid. +You can handle the selection operations with the help of [SfDataGrid.SelectionChanging](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionChanging) and [SfDataGrid.SelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionChanged) events of the Data Grid. ## Sorting, Grouping, and Filtering ### Sorting -By default, you can sort columns in a SfDataGrid by clicking the column header. You can configure the sorting by setting [SfDataGrid.SortColumnDescriptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SortColumnDescriptions) property as below, +By default, you can sort columns in the Data Grid by clicking the column header. You can configure the sorting by setting [SfDataGrid.SortColumnDescriptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SortColumnDescriptions) property as below, {% tabs %} {% highlight xaml %} @@ -556,7 +556,7 @@ By default, you can sort columns in a SfDataGrid by clicking the column header. {% endhighlight %} {% endtabs %} -![WPF DataGrid Sorting](getting-started_images/wpf-datagrid-sorting.png) +![Sorting](getting-started_images/wpf-datagrid-sorting.png) You can customize sorting by handling the [SfDataGrid.SortColumnsChanging](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SortColumnsChanging) and [SfDataGrid.SortColumnsChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SortColumnsChanged) events. To cancel the default sort, set the `Cancel` property to `true` in `SfDataGrid.SortColumnsChanging` event. @@ -588,30 +588,30 @@ Grouping can be enabled by setting [SfDataGrid.ShowGroupDropArea](https://help.s {% endhighlight %} {% endtabs %} -![WPF DataGrid Grouping](getting-started_images/wpf-datagrid-grouping.png) +![Grouping](getting-started_images/wpf-datagrid-grouping.png) ### Filtering -Filtering can be enabled by setting [SfDataGrid.AllowFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowFiltering) property to `true` , where you can open advanced filter UI by clicking the Filter icon in column header and filter the SfDataGrid. You can customize the filtering operations by handling [SfDataGrid.FilterChanging](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_FilterChanging) and [SfDataGrid.FilterChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_FilterChanged) events. +Filtering can be enabled by setting [SfDataGrid.AllowFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowFiltering) property to `true` , where you can open advanced filter UI by clicking the Filter icon in column header and filter the Data Grid. You can customize the filtering operations by handling [SfDataGrid.FilterChanging](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_FilterChanging) and [SfDataGrid.FilterChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_FilterChanged) events. -![WPF DataGrid Filtering](getting-started_images/wpf-datagrid-filter.png) +![Filtering](getting-started_images/wpf-datagrid-filter.png) ## Editing Editing can be enabled by setting [SfDataGrid.AllowEditing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowEditing) property to `true` . Set [SfDataGrid.AllowDeleting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowDeleting) property to specify whether user can delete rows by pressing Delete key. -Set [SfDataGrid.AddNewRowPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowPosition) property to enable additional row either Top or Bottom of SfDataGrid, where user can enter new items into the blank row. Adding new row adds an item to the [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource). +Set [SfDataGrid.AddNewRowPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AddNewRowPosition) property to enable additional row either Top or Bottom of the Data Grid, where user can enter new items into the blank row. Adding new row adds an item to the [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource). You can customize the editing operations by handling [SfDataGrid.CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellBeginEdit) and [SfDataGrid.CurrentCellEndEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellEndEdit) events. ## Theme -SfDataGrid supports various built-in themes. Refer to the below links to apply themes for the SfDataGrid, +The Data Grid supports various built-in themes. Refer to the below links to apply themes for the control, * [Apply theme using SfSkinManager](https://help.syncfusion.com/wpf/themes/skin-manager) * [Create a custom theme using ThemeStudio](https://help.syncfusion.com/wpf/themes/theme-studio#creating-custom-theme) - ![Applying Theme to WPF DataGrid](getting-started_images/wpf-datagrid-theme.png) + ![Applying Theme](getting-started_images/wpf-datagrid-theme.png) diff --git a/wpf/DataGrid/GridLines.md b/wpf/DataGrid/GridLines.md index 2df99e0aa..6dc1035f2 100644 --- a/wpf/DataGrid/GridLines.md +++ b/wpf/DataGrid/GridLines.md @@ -9,7 +9,7 @@ documentation: ug # Grid Lines Customization in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to customize the grid lines visibility to vertical, horizontal, both or none. To achieve this, use the following properties. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to customize the grid lines visibility to vertical, horizontal, both or none. To achieve this, use the following properties. [SfDataGrid.GridLinesVisibility](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_GridLinesVisibility): To set the border lines for the cells other than header and stacked header cells. [SfDataGrid.HeaderLinesVisibility](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_HeaderLinesVisibility): To set the border lines only for header and stacked header cells. @@ -25,7 +25,7 @@ The following are the list of options available to customize grid lines visibili ### Both -The [GridLinesVisibility.Both](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridLinesVisibility.html#Syncfusion_UI_Xaml_Grid_GridLinesVisibility_Both) displays the DataGrid with both horizontal and vertical grid lines. By default GridLinesVisibility value set as Both. +The [GridLinesVisibility.Both](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridLinesVisibility.html#Syncfusion_UI_Xaml_Grid_GridLinesVisibility_Both) displays the Data Grid with both horizontal and vertical grid lines. By default GridLinesVisibility value set as Both. {% tabs %} {% highlight xaml %} @@ -42,11 +42,11 @@ this.sfDataGrid.GridLinesVisibility = GridLinesVisibility.Both; {% endhighlight %} {% endtabs %} -![GridLinesVisibility in WPF DataGrid](GridLines_images/GridLines_image1.png) +![GridLinesVisibility](GridLines_images/GridLines_image1.png) ### Horizontal -The [GridLinesVisibility.Horizontal](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridLinesVisibility.html#Syncfusion_UI_Xaml_Grid_GridLinesVisibility_Horizontal) displays the DataGrid with horizontal grid lines only. +The [GridLinesVisibility.Horizontal](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridLinesVisibility.html#Syncfusion_UI_Xaml_Grid_GridLinesVisibility_Horizontal) displays the Data Grid with horizontal grid lines only. {% tabs %} {% highlight xaml %} @@ -63,11 +63,11 @@ xmlns:syncfusion="http://schemas.syncfusion.com/wpf" {% endhighlight %} {% endtabs %} -![Horizontal GridLinesVisibility in WPF DataGrid](GridLines_images/GridLines_image2.png) +![Horizontal GridLinesVisibility](GridLines_images/GridLines_image2.png) ### Vertical -The [GridLinesVisibility.Vertical](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridLinesVisibility.html#Syncfusion_UI_Xaml_Grid_GridLinesVisibility_Vertical) displays the DataGrid with vertical grid lines only. +The [GridLinesVisibility.Vertical](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridLinesVisibility.html#Syncfusion_UI_Xaml_Grid_GridLinesVisibility_Vertical) displays the Data Grid with vertical grid lines only. {% tabs %} {% highlight xaml %} @@ -83,10 +83,10 @@ xmlns:syncfusion="http://schemas.syncfusion.com/wpf" {% endhighlight %} {% endtabs %} -![Vertical GridLinesVisibility in WPF DataGrid](GridLines_images/GridLines_image3.png) +![Vertical GridLinesVisibility](GridLines_images/GridLines_image3.png) ### None -[GridLinesVisibility.None](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridLinesVisibility.html#Syncfusion_UI_Xaml_Grid_GridLinesVisibility_None) displays the DataGrid without grid lines. +[GridLinesVisibility.None](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridLinesVisibility.html#Syncfusion_UI_Xaml_Grid_GridLinesVisibility_None) displays the Data Grid without grid lines. {% tabs %} {% highlight xaml %} @@ -103,11 +103,11 @@ xmlns:syncfusion="http://schemas.syncfusion.com/wpf" {% endhighlight %} {% endtabs %} -![None GridLinesVisibility in WPF DataGrid](GridLines_images/GridLines_image4.png) +![None GridLinesVisibility](GridLines_images/GridLines_image4.png) ## Header rows -You can customize the DataGrid header lines visibility by using the [SfDataGrid.HeaderLinesVisibility](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_HeaderLinesVisibility) property. You can also customize the header lines visibility to horizontal, vertical, none or both. By default HeaderLinesVisibility value set as Both. +You can customize the Data Grid header lines visibility by using the [SfDataGrid.HeaderLinesVisibility](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_HeaderLinesVisibility) property. You can also customize the header lines visibility to horizontal, vertical, none or both. By default HeaderLinesVisibility value set as Both. {% tabs %} {% highlight xaml %} @@ -124,11 +124,11 @@ this.sfDataGrid.HeaderLinesVisibility = GridLinesVisibility.Horizontal; {% endhighlight %} {% endtabs %} -![Horizontal HeaderLinesVisibility in WPF DataGrid](GridLines_images/GridLines_image5.png) +![Horizontal HeaderLinesVisibility](GridLines_images/GridLines_image5.png) ## Grid lines for Master-Details view -SfDataGrid allows you to customize the grid lines for Master-Details view also like parent DataGrid by changing the grid lines properties in GridViewDefinition.DataGrid. +The Data Grid allows you to customize the grid lines for Master-Details view also like parent grid by changing the grid lines properties in GridViewDefinition.DataGrid. {% tabs %} {% highlight xaml %} @@ -164,7 +164,7 @@ this.FirstLevelNestedGrid.HeaderLinesVisibility = GridLinesVisibility.Horizontal {% endhighlight %} {% endtabs %} -![DetailsViewDataGrid GridLinesVisibility customization in WPF DataGrid](GridLines_images/GridLines_image6.png) +![DetailsViewDataGrid GridLinesVisibility customization](GridLines_images/GridLines_image6.png) ## Limitations diff --git a/wpf/DataGrid/Grouping.md b/wpf/DataGrid/Grouping.md index 429143b7e..ceaef5365 100644 --- a/wpf/DataGrid/Grouping.md +++ b/wpf/DataGrid/Grouping.md @@ -9,9 +9,9 @@ documentation: ug # Grouping in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to group the data against one or more columns. When grouping is applied, the data is organized into a hierarchical structure based on matching column values and it is sorted by ascending order. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to group the data against one or more columns. When grouping is applied, the data is organized into a hierarchical structure based on matching column values and it is sorted by ascending order. -SfDataGrid allows you to group the data in below ways, +The Data Grid allows you to group the data in below way, * UI Grouping * Programmatic Grouping @@ -60,11 +60,11 @@ this.dataGrid.Columns["CustomerID"].AllowGrouping = true; N> [GridColumn.AllowGrouping](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_AllowGroupingProperty) takes higher priority than [SfDataGrid.AllowGrouping](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowGrouping). -![WPF DataGrid Grouping](Grouping_images/wpf-datagrid-grouping.png) +![Grouping](Grouping_images/wpf-datagrid-grouping.png) The data can be grouped by an unlimited number of columns. To group more than one columns, drag-and-drop the desired columns in to `GroupDropArea`. -![Multiple Grouping in WPF DataGrid](Grouping_images/wpf-datagrid-multiple-grouping.png) +![Multiple Grouping](Grouping_images/wpf-datagrid-multiple-grouping.png) Each group is identified by its `CaptionSummaryRows` and it is used to organize the data into a hierarchical tree structure based on identical values of that column. The underlying records in each caption summary row can be expanded or collapsed by clicking its group caption. @@ -73,7 +73,7 @@ Each `CaptionSummaryRow` carries information about a particular group like group ## Programmatic grouping -The WPF DataGrid (SfDataGrid) allows you to group the data programmatically by adding or removing [GroupColumnDescription](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GroupColumnDescription.html) to [SfDataGrid.GroupColumnDescriptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupColumnDescriptions) collection. +The WPF Data Grid allows you to group the data programmatically by adding or removing [GroupColumnDescription](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GroupColumnDescription.html) to [SfDataGrid.GroupColumnDescriptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupColumnDescriptions) collection. For example, if you want to group the OrderID column programmatically, define its [MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_MappingName) to [ColumnName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GroupColumnDescription.html#Syncfusion_UI_Xaml_Grid_GroupColumnDescription_ColumnName) property of `GroupColumnDescription`. Then add the `GroupColumnDescription` to the `SfDataGrid.GroupColumnDescriptions` collection. @@ -120,7 +120,7 @@ this.dataGrid.View.EndInit(); ## Group based on display text -You can group the column in DataGrid based on the value being displayed in cell by setting [GridColumn.GroupMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_GroupMode) as `Display`. +You can group the column in the Data Grid based on the value being displayed in cell by setting [GridColumn.GroupMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_GroupMode) as `Display`. In the below example, OrderID column displays value with one decimal digit in cell. But when you group, groups will be created based on actual value considering all decimal digits of value (Refer right side screen shot). You can group based value displayed in the cell by setting [GridColumn.GroupMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_GroupMode) as `Display` (Refer left side screen shot for the same data). {% tabs %} @@ -132,11 +132,11 @@ this.datagrid.Columns["OrderID"].GroupMode = DataReflectionMode.Display; {% endhighlight %} {% endtabs %} -![Grouped Column in WPF DataGrid based on Display Text](Grouping_images/wpf-datagrid-grouped-column.png) +![Grouped Column based on Display Text](Grouping_images/wpf-datagrid-grouped-column.png) ### Group caption based on DisplayMember when grouping GridComboBoxColumn and GridMultiColumnDropDownList -In WPF DataGrid (SfDataGrid), you can group the column based on display value and also the same can be displayed in caption summary by setting [GridColumn.GroupMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_GroupMode) as `Display`. +In the WPF Data Grid (SfDataGrid), you can group the column based on display value and also the same can be displayed in caption summary by setting [GridColumn.GroupMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_GroupMode) as `Display`. {% tabs %} {% highlight xaml %} @@ -154,7 +154,7 @@ this.datagrid.Columns.Add(new GridComboBoxColumn() {% endhighlight %} {% endtabs %} -![Grouped Column in WPF DataGrid based on Display Member](Grouping_images/wpf-datagrid-member-group-column.png) +![Grouped Column based on Display Member](Grouping_images/wpf-datagrid-member-group-column.png) ## Clearing or removing group @@ -182,7 +182,7 @@ this.dataGrid.View.EndInit(); To ungroup the column in UI, click the close button on column header or drag the column header from the `GroupDropArea` and drop it on the header row. -![WPF DataGrid Column without Grouping](Grouping_images/wpf-datagrid-without-grouping.png) +![Column without Grouping](Grouping_images/wpf-datagrid-without-grouping.png) ## Hiding the column when grouped @@ -204,7 +204,7 @@ this.dataGrid.ShowColumnWhenGrouped = false; {% endtabs %} -![Hide Grouping Column in WPF DataGrid](Grouping_images/wpf-datagrid-hide-grouping.png) +![Hide Grouping Column](Grouping_images/wpf-datagrid-hide-grouping.png) ## Freezing caption rows when scrolling @@ -225,7 +225,7 @@ this.dataGrid.AllowFrozenGroupHeaders = true; {% endtabs %} -![WPF DataGrid with Frozen Caption Summary Rows](Grouping_images/wpf-datagrid-freeze-caption-rows.png) +![With Frozen Caption Summary Rows](Grouping_images/wpf-datagrid-freeze-caption-rows.png) ## Expanding or collapsing the groups @@ -293,7 +293,7 @@ this.dataGrid.CollapseGroup(group); ## Customize indent column width -You can customize the width of IndentColumn in SfDataGrid by using [IndentColumnWidth](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_IndentColumnWidth) property as like below. +You can customize the width of IndentColumn in the Data Grid by using [IndentColumnWidth](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_IndentColumnWidth) property as like below. {% tabs %} {% highlight xaml %} @@ -324,12 +324,12 @@ You can change the `GroupDropArea’ s` text can by setting [SfDataGrid.GroupDro {% endtabs %} -![WPF DataGrid with Custom Group Drop Area Text](Grouping_images/wpf-datagrid-custom-group-text.png) +![With Custom Group Drop Area Text](Grouping_images/wpf-datagrid-custom-group-text.png) ### GroupDropArea height and appearance -SfDataGrid allows you to customize the appearance and height of `GroupDropArea` by writing the style of TargetType `GroupDropArea`. +The Data Grid allows you to customize the appearance and height of `GroupDropArea` by writing the style of TargetType `GroupDropArea`. {% tabs %} @@ -346,7 +346,7 @@ SfDataGrid allows you to customize the appearance and height of `GroupDropArea` {% endtabs %} -![Customizing GroupDropDrea Height in WPF DataGrid](Grouping_images/wpf-datagrid-group-drop-area-height.png) +![Customizing GroupDropArea Height](Grouping_images/wpf-datagrid-group-drop-area-height.png) ### Expanding GroupDropArea while loading @@ -369,7 +369,7 @@ this.dataGrid.IsGroupDropAreaExpanded = true; ## Custom grouping -DataGrid allows you to group the data based on custom logic when the built-in grouping functionality doesn’t meet your requirement. +The Data Grid allows you to group the data based on custom logic when the built-in grouping functionality doesn’t meet your requirement. To perform custom grouping on a particular column , specify the custom logic through [GroupColumnDescription.Converter](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupColumnDescriptions) property and the column name to [GroupColumnDescription.ColumnName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GroupColumnDescription.html#Syncfusion_UI_Xaml_Grid_GroupColumnDescription_ColumnNameProperty) property. @@ -447,7 +447,7 @@ Now , assign the `GroupDateTimeConverter` into [GroupColumnDescription.Converter {% endtabs %} -![WPF DataGrid with Custom Grouping](Grouping_images/wpf-datagrid-custom-grouping.png) +![With Custom Grouping](Grouping_images/wpf-datagrid-custom-grouping.png) You can download samples from below location, Refer [sample](https://www.syncfusion.com/downloads/support/directtrac/general/ze/CustomGroupingDemo541349132.zip) for Custom grouping when ItemsSource is ObservableCollection. @@ -483,11 +483,11 @@ dataGrid.GroupColumnDescriptions.Add(groupColumnDesc); In the below screenshot custom grouping is applied based on `SickLeaveHours` column and the inner records in each group are sorted based on `SickLeaveHours` value. -![Sorting Inner Records Group in WPF DataGrid](Grouping_images/wpf-datagrid-sort-inner-records.png) +![Sorting Inner Records Group](Grouping_images/wpf-datagrid-sort-inner-records.png) ## Sorting groups based on summary values -DataGrid allows you to sort the groups based its summary values. You can sort the groups based on summary aggregate value by using [SfDataGrid. SummaryGroupComparer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SummaryGroupComparer) property. +The Data Grid allows you to sort the groups based its summary values. You can sort the groups based on summary aggregate value by using [SfDataGrid. SummaryGroupComparer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SummaryGroupComparer) property. Follow the below steps to sort the groups based on caption aggregate value. @@ -518,9 +518,9 @@ public class SortGroupComparers : IComparer, ISortDirection {% endhighlight %} {% endtabs %} -### Defining custom group comparer to DataGrid +### Defining custom group comparer to the Data Grid -Custom group comparer can be defined in SfDataGrid using [SfDataGrid.SummaryGroupComparer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SummaryGroupComparer) property. `SummaryGroupComparer` maintains the custom comparers and the custom comparer gets called when corresponding column is grouped. +Custom group comparer can be defined in the Data Grid using [SfDataGrid.SummaryGroupComparer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SummaryGroupComparer) property. `SummaryGroupComparer` maintains the custom comparers and the custom comparer gets called when corresponding column is grouped. {% tabs %} @@ -551,7 +551,7 @@ Custom group comparer can be defined in SfDataGrid using [SfDataGrid.SummaryGrou {% endtabs %} -![Displaying Grouping in WPF DataGrid using Custom Group Comparer](Grouping_images/wpf-datagrid-custom-group-comparer.png) +![Displaying Grouping using Custom Group Comparer](Grouping_images/wpf-datagrid-custom-group-comparer.png) You can download the sample demo [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/SortBySummaryDemo-355692747.zip). @@ -628,13 +628,13 @@ The [SfDataGrid.GroupCollapsed](https://help.syncfusion.com/cr/wpf/Syncfusion.UI [Group](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GroupChangedEventArgs.html#Syncfusion_UI_Xaml_Grid_GroupChangedEventArgs_Group) - Gets the collapsed group. ## See Also -[How to remove the gridline of WPF DataGrid (SfDataGrid) with grouping?](https://support.syncfusion.com/kb/article/9540/how-to-remove-the-gridline-of-wpf-datagrid-sfdatagrid-with-grouping) +[How to remove the gridline of the Data Grid with grouping?](https://support.syncfusion.com/kb/article/9540/how-to-remove-the-gridline-of-wpf-datagrid-sfdatagrid-with-grouping) [How to maintain expanded state of groups in printing?](https://support.syncfusion.com/kb/article/8842/how-to-maintain-expanded-state-of-groups-in-printing-in-wpf-datagrid-sfdatagrid) [How to show vertical border to the column wise summary rows?](https://support.syncfusion.com/kb/article/8850/how-to-show-vertical-border-to-the-column-wise-summary-rows-in-wpf-datagrid-sfdatagrid) -[How to define summary rows using AttachedProperty in datagrid](https://support.syncfusion.com/kb/article/8658/how-to-define-summary-rows-using-attached-property-in-wpf-datagrid-) +[How to define summary rows using AttachedProperty in the Data Grid](https://support.syncfusion.com/kb/article/8658/how-to-define-summary-rows-using-attached-property-in-wpf-datagrid-) [How to displaying Group header name based on other column](https://support.syncfusion.com/kb/article/7208/how-to-display-the-group-header-based-on-the-column-name-in-wpf-datagrid-sfdatagrid) @@ -648,10 +648,10 @@ The [SfDataGrid.GroupCollapsed](https://help.syncfusion.com/cr/wpf/Syncfusion.UI [How to add controls like TextBox in GroupDropArea?](https://support.syncfusion.com/kb/article/3759/how-to-add-controls-like-textbox-in-groupdroparea-in-wpf-datagrid) -[How to customize the CaptionSummaryCell text in the SfDataGrid?](https://support.syncfusion.com/kb/article/3433/how-to-customize-the-captionsummarycell-text-in-wpf-datagrid) +[How to customize the CaptionSummaryCell text in the Data Grid?](https://support.syncfusion.com/kb/article/3433/how-to-customize-the-captionsummarycell-text-in-wpf-datagrid) [How to apply the Custom Grouping while grouping the column using GroupDropArea?](https://support.syncfusion.com/kb/article/2940/how-to-apply-the-custom-grouping-while-grouping-the-column-using-groupdroparea) -[How to avoid selection while grouping and ungrouping in SfDataGrid?](https://support.syncfusion.com/kb/article/2809/how-to-avoid-selection-while-grouping-and-ungrouping-in-sfdatagrid) +[How to avoid selection while grouping and ungrouping in the Data Grid?](https://support.syncfusion.com/kb/article/2809/how-to-avoid-selection-while-grouping-and-ungrouping-in-sfdatagrid) [How to customize the GroupDropArea?](https://support.syncfusion.com/kb/article/2878/how-to-customize-the-groupdroparea-in-wpf-datagrid-control) diff --git a/wpf/DataGrid/Helpers.md b/wpf/DataGrid/Helpers.md index 46a4bb0e1..f4be77795 100644 --- a/wpf/DataGrid/Helpers.md +++ b/wpf/DataGrid/Helpers.md @@ -11,7 +11,7 @@ documentation: ug ## IndexResolver -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) has [GridIndexResolver](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridIndexResolver.html) static class present in [Syncfusion.UI.Xaml.Grid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.html) namespace that has some extension methods used to Resolve from row or column index to record or visible column index and `vice versa`. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) has [GridIndexResolver](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridIndexResolver.html) static class present in [Syncfusion.UI.Xaml.Grid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.html) namespace that has some extension methods used to Resolve from row or column index to record or visible column index and `vice versa`. ## Example: You can find the record index from row index using ResolveToRecordIndex method. @@ -37,7 +37,7 @@ Resolves row index from the record associated with SfDataGrid.View.Records
ResolveStartIndexOfGroup(Group group) -Resolves the start index of group in DataGrid associated with SfDataGrid.View.Groups. When there is no group in DataGrid it returns -1.
ResolveToTableSummaryIndex(int rowIndex) @@ -95,7 +95,7 @@ Decides whether the given row index is HeaderTableSummaryRow or not ## Dispose -The method is associated with relinquishes memory and clears all references associated with SfDataGrid. When you call this method, it releases all the reference for SfDataGrid. So the memory it is occupying using the DataGrid is reclaimed. You have to call `SfDataGrid.Dispose` method to release the memory. +The method is associated with relinquishes memory and clears all references associated with the Data Grid. When you call this method, it releases all the reference for the Data Grid. So the memory it is occupying using the Data Grid is reclaimed. You have to call `SfDataGrid.Dispose` method to release the memory. diff --git a/wpf/DataGrid/Interactive-Features.md b/wpf/DataGrid/Interactive-Features.md index 77b6e8641..96c4e0154 100644 --- a/wpf/DataGrid/Interactive-Features.md +++ b/wpf/DataGrid/Interactive-Features.md @@ -11,7 +11,7 @@ documentation: ug ## Column Chooser -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to show and hide the Columns from the view at runtime via drag and drop using `ColumnChooser`. You can enable a column chooser in an application by creating an instance for `GridColumnChooserController` and assign to `SfDataGrid.GridColumnDragDropController`. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to show and hide the Columns from the view at runtime via drag and drop using `ColumnChooser`. You can enable a column chooser in an application by creating an instance for `GridColumnChooserController` and assign to `SfDataGrid.GridColumnDragDropController`. While dropping columns in `ColumnChooser` window, the particular column will be hidden by setting `GridColumn.IsHidden` as `true`. @@ -38,7 +38,7 @@ void MainWindow_Loaded(object sender, RoutedEventArgs e) {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Column Chooser](Interactive-Features_images/wpf-datagrid-column-chooser.png) +![Column Chooser](Interactive-Features_images/wpf-datagrid-column-chooser.png) ### Custom Column Chooser @@ -220,7 +220,7 @@ viewModel.ShowColumnChooser = false; {% endhighlight %} {% endtabs %} -![Customizing Column Chooser in WPF DataGrid](Interactive-Features_images/wpf-datagrid-column-chooser-customization.png) +![Customizing Column Chooser](Interactive-Features_images/wpf-datagrid-column-chooser-customization.png) ### Appearance Customization @@ -248,6 +248,6 @@ void MainWindow_Loaded(object sender, RoutedEventArgs e) {% endhighlight %} {% endtabs %} -![Customizing Column Chooser Appearance in wpf datagrid](Interactive-Features_images/wpf-datagrid-column-chooser-customization.png) +![Customizing Column Chooser Appearance](Interactive-Features_images/wpf-datagrid-column-chooser-customization.png) diff --git a/wpf/DataGrid/Localization.md b/wpf/DataGrid/Localization.md index c835cbdec..10869845f 100644 --- a/wpf/DataGrid/Localization.md +++ b/wpf/DataGrid/Localization.md @@ -10,7 +10,7 @@ documentation: ug # Localization in WPF Data Grid -Localization is the process of translating the application resources into different language for the specific cultures. You can localize the [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) by adding [resource](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/aa992030(v=vs.100)) file. Application culture can be changed by setting [CurrentUICulture](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.currentuiculture?view=net-7.0&redirectedfrom=MSDN#System_Globalization_CultureInfo_CurrentUICulture) before `InitializeComponent()` method. +Localization is the process of translating the application resources into different language for the specific cultures. You can localize the [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) by adding [resource](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/aa992030(v=vs.100)) file. Application culture can be changed by setting [CurrentUICulture](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo.currentuiculture?view=net-7.0&redirectedfrom=MSDN#System_Globalization_CultureInfo_CurrentUICulture) before `InitializeComponent()` method. Below application culture changed to German. @@ -26,12 +26,12 @@ public MainWindow() {% endtabs %} -To localize the SfDataGrid based on `CurrentUICulture` using resource files, follow the below steps. +To localize the Data Grid based on `CurrentUICulture` using resource files, follow the below steps. 1.Create new folder and named as **Resources** in your application. -2.Add the default resource file of SfDataGrid into **Resources** folder. You can download the Syncfusion.SfGrid.WPF.resx [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.SfGrid.WPF71700028.zip). +2.Add the default resource file of the Data Grid into **Resources** folder. You can download the Syncfusion.SfGrid.WPF.resx [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.SfGrid.WPF71700028.zip). -![Displaying Default Resource File of WPF DataGrid into Resources Folder](Localization_images/wpf-datagrid-default-resource-file.png) +![Displaying Default Resource File into Resources Folder](Localization_images/wpf-datagrid-default-resource-file.png) 3.Right-click on the Resources folder, select **Add** and then **NewItem**. @@ -39,23 +39,23 @@ To localize the SfDataGrid based on `CurrentUICulture` using resource files, fol 5.The culture name that indicates the name of language and country. -![Changing name of New Resource File for WPF DataGrid](Localization_images/wpf-datagrid-change-resource-file-name.png) +![Changing name of New Resource File](Localization_images/wpf-datagrid-change-resource-file-name.png) 6.Now, select `Add` option to add the resource file in **Resources** folder. -![Displaying Resource File with German Language for WPF DataGrid](Localization_images/wpf-datagrid-with-german-resource-file.png) +![Displaying Resource File with German Language](Localization_images/wpf-datagrid-with-german-resource-file.png) 7.Add the Name/Value pair in Resource Designer of **Syncfusion.SfGrid.WPF.de.resx** file and change its corresponding value to corresponding culture. -![Displaying Added Resource File Name and Value pair in WPF DataGrid](Localization_images/wpf-datagrid-resource-file-name-and-value.png) +![Displaying Added Resource File Name and Value pair](Localization_images/wpf-datagrid-resource-file-name-and-value.png) -![Displaying Localized File in German for WPF DataGrid](Localization_images/wpf-datagrid-localized-file.png) +![Displaying Localized File in German](Localization_images/wpf-datagrid-localized-file.png) You can get the sample from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Localization1013710435.zip) ## Localize when the resource file present in different assembly or different namespace? -By default, SfDataGrid try to read the resource file from executing assembly and its default namespace by using [Assembly.GetExecuteAssembly](https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getexecutingassembly?view=net-7.0) method. When the resource file is located at different assembly or namespace, then you can let SfDataGrid know by using [GridResourceWrapper.SetResources](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridResourceWrapper.html#Syncfusion_UI_Xaml_Grid_GridResourceWrapper_SetResources_System_Reflection_Assembly_) method. +By default, the Data Grid try to read the resource file from executing assembly and its default namespace by using [Assembly.GetExecuteAssembly](https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getexecutingassembly?view=net-7.0) method. When the resource file is located at different assembly or namespace, then you can let the Data Grid know by using [GridResourceWrapper.SetResources](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridResourceWrapper.html#Syncfusion_UI_Xaml_Grid_GridResourceWrapper_SetResources_System_Reflection_Assembly_) method. {% tabs %} {% highlight c# %} @@ -71,14 +71,14 @@ public MainWindow() ## Editing default culture resource -You can edit default resource file by adding it to **Resources** folder of your application where SfDataGrid reads the static texts from here. You can download the default resource file from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.SfGrid.WPF71700028.zip). +You can edit default resource file by adding it to **Resources** folder of your application where the Data Grid reads the static texts from here. You can download the default resource file from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Syncfusion.SfGrid.WPF71700028.zip). -![Displaying Default Culture Resource File Editing for WPF DataGrid](Localization_images/wpf-datagrid-edit-localized-file.png) +![Displaying Default Culture Resource File Editing](Localization_images/wpf-datagrid-edit-localized-file.png) Now, change the Name/Value pair in Resource Designer of **Syncfusion.SfGrid.WPF.resx** file. -![Displaying Name and Value pair in Resource Designer for Default Culture in WPF DataGrid](Localization_images/wpf-datagrid-resource-file-name-and-value.png) +![Displaying Name and Value pair in Resource Designer for Default Culture](Localization_images/wpf-datagrid-resource-file-name-and-value.png) -![WPF DataGrid displays Editing Default Culture Resource](Localization_images/wpf-datagrid-edit-default-resource.png) +![Editing Default Culture Resource](Localization_images/wpf-datagrid-edit-default-resource.png) diff --git a/wpf/DataGrid/MVVM.md b/wpf/DataGrid/MVVM.md index 0502f40a1..462873fec 100644 --- a/wpf/DataGrid/MVVM.md +++ b/wpf/DataGrid/MVVM.md @@ -9,9 +9,9 @@ documentation: ug # MVVM in WPF Data Grid -## DataGrid SelectedItem Binding +## SelectedItem Binding -You can bind the [SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) property directly to the DataGrid by setting the `SfDataGrid.SelectedItem` property. +You can bind the [SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) property directly to Data Grid by setting the `SfDataGrid.SelectedItem` property. {% tabs %} {% highlight xaml %} @@ -51,9 +51,9 @@ public class PersonModel : INotifyPropertyChanged You can download the sample [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/SelectedItem-1872250691.zip). -## DataGrid SelectedItems Binding +## Data Grid SelectedItems Binding -You can bind the [SelectedItems](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) property directly to the DataGrid by setting the `SfDataGrid.SelectedItems` property. +You can bind the [SelectedItems](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) property directly to Data Grid by setting the `SfDataGrid.SelectedItems` property. {% tabs %} {% highlight xaml %} @@ -96,7 +96,7 @@ You can download the sample [here](https://www.syncfusion.com/downloads/support/ ## Button command binding to ViewModel -You can load a button for the columns in the DataGrid by using [GridTemplateColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridTemplateColumn.html). When loading the buttons, you can bind command in `ViewModel` by using `ElementName` binding. +You can load a button for the columns in Data Grid by using [GridTemplateColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridTemplateColumn.html). When loading the buttons, you can bind command in `ViewModel` by using `ElementName` binding. In the following example, `ViewModel` command receives the underlying data object as command parameter since the `DataContext` is binding as command parameter. @@ -123,7 +123,7 @@ In the following example, `ViewModel` command receives the underlying data objec {% endhighlight %} {% endtabs %} -![Binding Button Command to ViewModel in WPF DataGrid](MVVM_images/wpf-datagrid-binding-button.png) +![Binding Button Command to ViewModel](MVVM_images/wpf-datagrid-binding-button.png) You can download the sample [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/ShowSelectedRowInformation-414969750.zip). @@ -167,7 +167,7 @@ class ViewModel:INotifyPropertyChanged {% endhighlight %} {% endtabs %} -![Binding ComboBoxColumn ItemsSource from ViewModel in WPF DataGrid](MVVM_images/wpf-datagrid-binding-combobox-item.png) +![Binding ComboBoxColumn ItemsSource from ViewModel](MVVM_images/wpf-datagrid-binding-combobox-item.png) You can download the sample [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/BindViewModelItemstoComboBoxColumn-223289547.zip). @@ -199,13 +199,13 @@ You can load the `ComboBox` inside the `GridTemplateColumn` and bind the `ItemsS {% endhighlight %} {% endtabs %} -![WPF DataGrid displays ComboBox with MVVM Data Template Binding](MVVM_images/wpf-datagrid-combobox-item.png) +![ComboBox with MVVM Data Template Binding](MVVM_images/wpf-datagrid-combobox-item.png) You can download the sample [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/BindViewModelItemstotemplateComboBoxColumn-1705267981.zip). -## Binding DataGrid Columns from ViewModel +## Binding Data Grid Columns from ViewModel -You can bind the [SfDataGrid.Columns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Columns) to a property in the `ViewModel` by having the `binding` property of type `Syncfusion.SfGrid.UI.Xaml.Grid.Columns`. Thus, you can set binding to the `SfDataGrid.Columns` property that provides `DataContext` of the DataGrid is `ViewModel`. +You can bind the [SfDataGrid.Columns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Columns) to a property in the `ViewModel` by having the `binding` property of type `Syncfusion.SfGrid.UI.Xaml.Grid.Columns`. Thus, you can set binding to the `SfDataGrid.Columns` property that provides `DataContext` of Data Grid is `ViewModel`. {% tabs %} {% highlight xaml %} diff --git a/wpf/DataGrid/Master-Details-View.md b/wpf/DataGrid/Master-Details-View.md index 5c1cca91d..58433f75f 100644 --- a/wpf/DataGrid/Master-Details-View.md +++ b/wpf/DataGrid/Master-Details-View.md @@ -9,9 +9,9 @@ documentation: ug # Master-Details View in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to represent the hierarchical data in the form of nested tables using Master-Details View. You can expand or collapse the nested tables ([DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html)) by using an expander in a row or programmatically. The number of tables nested with relations is unlimited. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to represent the hierarchical data in the form of nested tables using Master-Details View. You can expand or collapse the nested tables ([DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html)) by using an expander in a row or programmatically. The number of tables nested with relations is unlimited. -![WPF DataGrid with Master Details View](Master-Details-View_images/wpf-datagrid-master-details-view.png) +![With Master Details View](Master-Details-View_images/wpf-datagrid-master-details-view.png) ## Generating Master-Details view from IEnumerable @@ -272,11 +272,11 @@ public class ViewModel {% endhighlight %} {% endtabs %} -### Defining relations in DataGrid +### Defining relations in the Data Grid #### Auto-generating relations -SfDataGrid will automatically generate relations and inner relations for the `IEnumerable` property types in the data object. This can be enabled by setting [SfDataGrid.AutoGenerateRelations](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGenerateRelations) to `true`. +The Data Grid will automatically generate relations and inner relations for the `IEnumerable` property types in the data object. This can be enabled by setting [SfDataGrid.AutoGenerateRelations](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGenerateRelations) to `true`. Bind the collection created in the previous step to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) and set the [SfDataGrid.AutoGenerateRelations](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGenerateRelations) to `true`. @@ -296,7 +296,7 @@ When relations are auto-generated, you can handle the [SfDataGrid.AutoGenerating Here, two relations are created from `Sales` and `Orders` collection property. -![WPF DataGrid displays Master Details View based on Auto Generated Relations](Master-Details-View_images/wpf-datagrid-auto-generated-columns.png) +![Master Details View based on Auto Generated Relations](Master-Details-View_images/wpf-datagrid-auto-generated-columns.png) #### Manually defining Relations @@ -344,7 +344,7 @@ dataGrid.DetailsViewDefinition.Add(gridViewDefinition2); {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Master Details View based on Manual Relations](Master-Details-View_images/wpf-datagrid-manual-relations.png) +![Master Details View based on Manual Relations](Master-Details-View_images/wpf-datagrid-manual-relations.png) In the same way, you can define relations for first level nested grids by defining relations to the [ViewDefinition.DataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridViewDefinition.html#Syncfusion_UI_Xaml_Grid_GridViewDefinition_DataGrid) of first level nested grid. @@ -396,7 +396,7 @@ dataGrid.DetailsViewDefinition.Add(gridViewDefinition1); {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Nested Relations](Master-Details-View_images/wpf-datagrid-nested-relations.png) +![Nested Relations](Master-Details-View_images/wpf-datagrid-nested-relations.png) ## Generating Master-Details view from DataTable @@ -460,11 +460,11 @@ public class ViewModel {% endhighlight %} {% endtabs %} -### Defining relations in DataGrid +### Defining relations in the Data Grid #### Auto-generating relations -SfDataGrid will automatically generate relations and inner relations based on relations defined in [DataSet](https://learn.microsoft.com/en-us/dotnet/api/system.data.dataset?view=net-7.0). This can be enabled by setting [SfDataGrid.AutoGenerateRelations](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGenerateRelations) to `true`. +The Data Grid will automatically generate relations and inner relations based on relations defined in [DataSet](https://learn.microsoft.com/en-us/dotnet/api/system.data.dataset?view=net-7.0). This can be enabled by setting [SfDataGrid.AutoGenerateRelations](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGenerateRelations) to `true`. Bind the `Suppliers` table created in the previous step to [SfDataGrid.ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ItemsSource) and set the [SfDataGrid.AutoGenerateRelations](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGenerateRelations) to `true`. @@ -484,13 +484,13 @@ When relations are auto-generated, you can handle the [SfDataGrid.AutoGenerating Here, Master-Details View relation is auto generated based on the `Supplier_Product` relation. -![WPF DataGrid displays Nested DataGrid](Master-Details-View_images/wpf-datagrid-nested-collection.png) +![Nested Grid](Master-Details-View_images/wpf-datagrid-nested-collection.png) #### Manually defining Relations You can define the Master-Details View’s relation manually using [SfDataGrid.DetailsViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_DetailsViewDefinition), when the [SfDataGrid.AutoGenerateRelations](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AutoGenerateRelations) is `false`. -To define Master-Details View relations, create [GridViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridViewDefinition.html) and set the relation name `Supplier_Product` to [ViewDefinition.RelationalColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ViewDefinition.html#Syncfusion_UI_Xaml_Grid_ViewDefinition_RelationalColumn). Then, the `GridViewDefinition` is added to the [SfDataGrid.DetailsViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_DetailsViewDefinition) collection of parent DataGrid. +To define Master-Details View relations, create [GridViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridViewDefinition.html) and set the relation name `Supplier_Product` to [ViewDefinition.RelationalColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ViewDefinition.html#Syncfusion_UI_Xaml_Grid_ViewDefinition_RelationalColumn). Then, the `GridViewDefinition` is added to the [SfDataGrid.DetailsViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_DetailsViewDefinition) collection of the parent grid. {% tabs %} {% highlight xaml %} @@ -518,7 +518,7 @@ this.dataGrid.DetailsViewDefinition.Add(gridViewDefinition); {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Master Details View based on Manual Relations](Master-Details-View_images/wpf-datagrid-hierarchical-view.png) +![Master Details View based on Manual Relations](Master-Details-View_images/wpf-datagrid-hierarchical-view.png) ## Populating Master-Details view through events @@ -552,7 +552,7 @@ private ObservableCollection GetItemSource() {% endhighlight %} {% endtabs %} -N> This event will be trigged only when underlying data object contains relations. Otherwise, you have to define dummy relation to notify DataGrid to fire this event. +N> This event will be trigged only when underlying data object contains relations. Otherwise, you have to define dummy relation to notify the Data Grid to fire this event. In the below code snippet, `AutoGenerateRelations` set to false and also relation is defined with some name to `RelationalColumn`. For example, `ProductDetails` is the dummy relational column and underlying data object does not contain the `IEnumerable` type property with name `ProductDetails`. @@ -753,7 +753,7 @@ Void FirstLevelNestedGrid_AutoGeneratingRelations(object sender, N> When you make any change in one [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html), that change will be applied to all [DetailsViewDataGrid’s](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) in the same level. For example, when you resize the first column in one [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html), the same column width is applied to all [DetailsViewDataGrid’s](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) at that level. This is applicable for features like filtering, sorting, grouping and re-ordering columns also. -![WPF DataGrid in Master Details View](Master-Details-View_images/wpf-datagrid-details-view.png) +![Master Details View](Master-Details-View_images/wpf-datagrid-details-view.png) Here, `SalesID` column is sorted in all DetailsViewDataGrid at the same level. @@ -761,7 +761,7 @@ N> [AllowFrozenGroupHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xa ## Defining columns for DetailsViewDataGrid -The [ViewDefinition.DataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridViewDefinition.html#Syncfusion_UI_Xaml_Grid_GridViewDefinition_DataGrid)’s columns can be generated either automatically or manually like parent DataGrid. You can refer [here](https://help.syncfusion.com/wpf/datagrid/columns) to know more about columns. +The [ViewDefinition.DataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridViewDefinition.html#Syncfusion_UI_Xaml_Grid_GridViewDefinition_DataGrid)’s columns can be generated either automatically or manually like parent grid. You can refer [here](https://help.syncfusion.com/wpf/datagrid/columns) to know more about columns. ### Auto-generating columns @@ -846,7 +846,7 @@ void dataGrid_AutoGeneratingRelations(object sender, Syncfusion.UI.Xaml.Grid.Aut ### Creating Custom Column -You can also define your own column type to [ViewDefinition.DataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridViewDefinition.html#Syncfusion_UI_Xaml_Grid_GridViewDefinition_DataGrid) like parent DataGrid. For more information about creating custom column, refer the [Custom Column support](https://help.syncfusion.com/wpf/datagrid/columns). +You can also define your own column type to [ViewDefinition.DataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridViewDefinition.html#Syncfusion_UI_Xaml_Grid_GridViewDefinition_DataGrid) like the parent grid. For more information about creating custom column, refer the [Custom Column support](https://help.syncfusion.com/wpf/datagrid/columns). After creating the custom column, add the customized renderer to [CellRenderers](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CellRenderers) collection of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html). @@ -892,7 +892,7 @@ Now, you can add the custom column to `Columns` collection of [ViewDefinition.Da {% endhighlight %} {% endtabs %} -![WPF DataGrid with Editing in Master Details View](Master-Details-View_images/wpf-datagrid-editing.png) +![Editing in Master Details View](Master-Details-View_images/wpf-datagrid-editing.png) ## Handling events for DetailsViewDataGrid @@ -1155,9 +1155,9 @@ public class CommandHandler : ICommand {% endhighlight %} {% endtabs %} -### Getting the parent DataGrid while editing DetailsViewDataGrid +### Getting the parent Data Grid while editing DetailsViewDataGrid -You can get the corresponding parent DataGrid while editing [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) through its [CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event handler. +You can get the corresponding parent grid while editing [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) through its [CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event handler. {% tabs %} {% highlight c# %} @@ -1175,13 +1175,13 @@ Here, sender is [ViewDefinition.DataGrid](https://help.syncfusion.com/cr/wpf/Syn ## Column sizing -SfDataGrid allows you to apply column sizer to `DetailsViewDataGrid` by setting the [GridViewDefinition.DataGrid.ColumnSizer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ColumnSizer) like parent DataGrid. For more information, refer the [Column Sizing](https://help.syncfusion.com/wpf/datagrid/autosize-columns) section. +The Data Grid allows you to apply column sizer to `DetailsViewDataGrid` by setting the [GridViewDefinition.DataGrid.ColumnSizer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ColumnSizer) like parent grid. For more information, refer the [Column Sizing](https://help.syncfusion.com/wpf/datagrid/autosize-columns) section. -### Disable resizing of last column in parent DataGrid +### Disable resizing of last column in parent Data Grid -By default, the [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) is clipped while resizing the last column of parent DataGrid if the parent DataGrid width is less than the `DetailsViewDataGrid` width. +By default, the [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) is clipped while resizing the last column of the parent grid if the parent grid width is less than the `DetailsViewDataGrid` width. -You can disable the resizing of last column of parent DataGrid by setting [DetailsViewManager.DisableLastColumnResizing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewManager.html#Syncfusion_UI_Xaml_Grid_DetailsViewManager_DisableLastColumnResizingProperty) attached property to `true`. +You can disable the resizing of last column of the parent grid by setting [DetailsViewManager.DisableLastColumnResizing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewManager.html#Syncfusion_UI_Xaml_Grid_DetailsViewManager_DisableLastColumnResizingProperty) attached property to `true`. {% tabs %} {% highlight xaml %} @@ -1197,13 +1197,13 @@ DetailsViewManager.SetDisableLastColumnResizing(this.dataGrid, true); {% endhighlight %} {% endtabs %} -### Resizing parent DataGrid and DetailsViewDataGrid simultaneously +### Resizing parent Data Grid and DetailsViewDataGrid simultaneously -By default, [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) column width will not be adjusted while resizing the parent DataGrid’s columns. You can adjust DetailsViewDataGrid’s column width simultaneously while resizing parent DataGrid. This can be achieved by handling [DetailsViewLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) and [ResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) events. +By default, [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) column width will not be adjusted while resizing the parent grid’s columns. You can adjust DetailsViewDataGrid’s column width simultaneously while resizing the parent grid. This can be achieved by handling [DetailsViewLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) and [ResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) events. N> It is applicable only when the parent and [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) having same number of columns. -The column width of `DetailsViewDataGrid` is set based on the parent DataGrid’s column in [DetailsViewLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. +The column width of `DetailsViewDataGrid` is set based on the parent grid’s column in [DetailsViewLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. {% tabs %} {% highlight c# %} @@ -1232,7 +1232,7 @@ void dataGrid_DetailsViewLoading(object sender, DetailsViewLoadingAndUnloadingEv {% endhighlight %} {% endtabs %} -When the column is resized in parent DataGrid column, then the new [Width](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_Width) is set to corresponding column of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) based on the [ColumnIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ResizingColumnsEventArgs.html#Syncfusion_UI_Xaml_Grid_ResizingColumnsEventArgs_ColumnIndex) argument in [ResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. +When the column is resized in parent grid column, then the new [Width](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_Width) is set to corresponding column of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) based on the [ColumnIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ResizingColumnsEventArgs.html#Syncfusion_UI_Xaml_Grid_ResizingColumnsEventArgs_ColumnIndex) argument in [ResizingColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. {% tabs %} {% highlight c# %} @@ -1381,11 +1381,11 @@ N> To display parent and [DetailsViewDataGrid](https://help.syncfusion.com/cr/wp ## Selection -[DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) allows you to select rows or cells based on the [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) property in its parent DataGrid. +[DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) allows you to select rows or cells based on the [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) property in its parent grid. ### Getting the selected DetailsViewDataGrid -You can get the currently selected [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) by using the [SelectedDetailsViewGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectedDetailsViewGrid) property of parent DataGrid. +You can get the currently selected [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) by using the [SelectedDetailsViewGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectedDetailsViewGrid) property of the parent grid. {% tabs %} {% highlight c# %} @@ -1401,7 +1401,7 @@ var detailsViewDataGrid = this.dataGrid.SelectedDetailsViewGrid.SelectedDetailsV {% endhighlight %} {% endtabs %} -You can also get the selected [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) using [GetDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Helpers.SelectionHelper.html#Syncfusion_UI_Xaml_Grid_Helpers_SelectionHelper_GetDataGrid_Syncfusion_UI_Xaml_Grid_SfDataGrid_) helper method which returns the DataGrid that contains the current cell. +You can also get the selected [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) using [GetDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Helpers.SelectionHelper.html#Syncfusion_UI_Xaml_Grid_Helpers_SelectionHelper_GetDataGrid_Syncfusion_UI_Xaml_Grid_SfDataGrid_) helper method which returns the Data Grid that contains the current cell. {% tabs %} {% highlight c# %} @@ -1434,7 +1434,7 @@ var selectedItems = this.dataGrid.SelectedDetailsViewGrid.SelectedItems; ### Getting the CurrentCell of DetailsViewDataGrid -You can get the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCurrentCellManager.html#Syncfusion_UI_Xaml_Grid_GridCurrentCellManager_CurrentCell) of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) by using the [SelectedDetailsViewGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectedDetailsViewGrid) property of parent DataGrid or [CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event of `DetailsViewDataGrid`. +You can get the [CurrentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCurrentCellManager.html#Syncfusion_UI_Xaml_Grid_GridCurrentCellManager_CurrentCell) of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) by using the [SelectedDetailsViewGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectedDetailsViewGrid) property of the parent grid or [CurrentCellBeginEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event of `DetailsViewDataGrid`. {% tabs %} {% highlight c# %} @@ -1451,9 +1451,9 @@ void FirstLevelNestedGrid_CurrentCellBeginEdit(object sender, CurrentCellBeginEd You can refer [here](#handling-events-for-detailsviewdatagrid) to know about handling events for `DetailsViewDataGrid`. -### Getting the parent DataGrid +### Getting the parent Data Grid -You can get the immediate parent DataGrid of corresponding [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) through [GetParentDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Helpers.SelectionHelper.html#Syncfusion_UI_Xaml_Grid_Helpers_SelectionHelper_GetParentDataGrid_Syncfusion_UI_Xaml_Grid_SfDataGrid_) helper method. +You can get the immediate parent grid of corresponding [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) through [GetParentDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Helpers.SelectionHelper.html#Syncfusion_UI_Xaml_Grid_Helpers_SelectionHelper_GetParentDataGrid_Syncfusion_UI_Xaml_Grid_SfDataGrid_) helper method. {% tabs %} {% highlight c# %} @@ -1481,7 +1481,7 @@ var detailsViewDataGrid = this.dataGrid.GetDetailsViewGrid(0, "ProductDetails"); ### Programmatic Selection in DetailsViewDataGrid -In [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html), you can add or remove the selection programmatically like parent DataGrid. You can get particular `DetailsViewDataGrid` by using [DetailsViewLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event or [GetDetailsViewGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Helpers.SelectionHelper.html#Syncfusion_UI_Xaml_Grid_Helpers_SelectionHelper_GetDetailsViewGrid_Syncfusion_UI_Xaml_Grid_SfDataGrid_System_Int32_) method to process the selection operations. +In [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html), you can add or remove the selection programmatically like parent grid. You can get particular `DetailsViewDataGrid` by using [DetailsViewLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event or [GetDetailsViewGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Helpers.SelectionHelper.html#Syncfusion_UI_Xaml_Grid_Helpers_SelectionHelper_GetDetailsViewGrid_Syncfusion_UI_Xaml_Grid_SfDataGrid_System_Int32_) method to process the selection operations. #### Selecting records @@ -1531,7 +1531,7 @@ detailsViewDataGrid.SelectionController.SelectRows(1, 2); {% endhighlight %} {% endtabs %} -Here, first and second rows are selected in the `DetailsViewDataGrid` which is present in second row of the parent DataGrid. +Here, first and second rows are selected in the `DetailsViewDataGrid` which is present in second row of the parent Data Grid. #### Cell selection @@ -1539,7 +1539,7 @@ You can select cells also by using [SelectCell](https://help.syncfusion.com/cr/w ### Programmatically expand and bring DetailsViewDataGrid into view -SfDataGrid allows you to bring the specified [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) in to view by using [DetailsViewManager.BringInToView](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewManager.html#Syncfusion_UI_Xaml_Grid_DetailsViewManager_BringIntoView_System_Int32_) method. +The Data Grid allows you to bring the specified [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) in to view by using [DetailsViewManager.BringInToView](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewManager.html#Syncfusion_UI_Xaml_Grid_DetailsViewManager_BringIntoView_System_Int32_) method. Before bringing the `DetailsViewDataGrid` into view, you have to expand the corresponding parent record if it is not already expanded. @@ -1597,7 +1597,7 @@ You can get the sample from [here](https://www.syncfusion.com/downloads/support/ ### Customizing Selection for DetailsViewDataGrid -You can also customize the selection behavior of `DetailsViewDataGrid` like the parent DataGrid. For more information about customizing selection behavior, you can refer [here](https://help.syncfusion.com/wpf/datagrid/selection). +You can also customize the selection behavior of `DetailsViewDataGrid` like the parent grid. For more information about customizing selection behavior, you can refer [here](https://help.syncfusion.com/wpf/datagrid/selection). Follow the steps mentioned in selection customization section to customize selection behavior of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) and set the customized selection controller to [DetailsViewDataGrid.SelectionController](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionController) in [DetailsViewLoading](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. {% tabs %} @@ -1626,7 +1626,7 @@ N> For customizing selection in second level nested grid, you can refer [here](# ## Appearance customization -The visual appearance of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) can be customized like parent DataGrid through [Styling and Templates support](https://help.syncfusion.com/wpf/datagrid/styles-and-templates) in SfDataGrid. +The visual appearance of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) can be customized like parent grid through [Styling and Templates support](https://help.syncfusion.com/wpf/datagrid/styles-and-templates) in the Data Grid. ### Changing Header appearance of DetailsViewDataGrid @@ -1674,7 +1674,7 @@ void dataGrid_AutoGeneratingRelations(object sender, Syncfusion.UI.Xaml.Grid.Aut {% endhighlight %} {% endtabs %} -![Changing Header Appearance of WPF Master Details View DataGrid](Master-Details-View_images/wpf-datagrid-header-customization.png) +![Changing Header Appearance of Master Details View](Master-Details-View_images/wpf-datagrid-header-customization.png) ### Hiding header row of Master-Details View @@ -1702,11 +1702,11 @@ FirstLevelNestedGrid.HeaderRowHeight = 0; {% endhighlight %} {% endtabs %} -![WPF Nested DataGrid without Header](Master-Details-View_images/wpf-nested-datagrid-without-header.png) +![Nested Grid without Header](Master-Details-View_images/wpf-nested-datagrid-without-header.png) ### Customizing padding of the DetailsViewDataGrid -The padding of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) can be customized through the [DetailsViewPadding](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_DetailsViewPadding) property and it will be set to its corresponding parent DataGrid. +The padding of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) can be customized through the [DetailsViewPadding](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_DetailsViewPadding) property and it will be set to its corresponding parent grid. {% tabs %} {% highlight xaml %} @@ -1730,13 +1730,13 @@ this.dataGrid.DetailsViewPadding = new Thickness(15); {% endhighlight %} {% endtabs %} -![Customized Padding of WPF Nested DataGrid](Master-Details-View_images/wpf-datagrid-padding-customization.png) +![Customized Padding of Nested Grid](Master-Details-View_images/wpf-datagrid-padding-customization.png) N> For customizing appearance for second level nested grid, you can refer [here](#defining-properties-for-detailsviewdatagrid). ### Customize ExpanderColumn width -You can customize the width of ExpanderColumn in SfDataGrid by using [ExpanderColumnWidth](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ExpanderColumnWidth) property as like below. +You can customize the width of ExpanderColumn in the Data Grid by using [ExpanderColumnWidth](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ExpanderColumnWidth) property as like below. {% tabs %} {% highlight xaml %} @@ -1752,7 +1752,7 @@ this.dataGrid.ExpanderColumnWidth = 50; ## Expanding and collapsing the DetailsViewDataGrid programmatically -SfDataGrid allows you to expand or collapse the [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) programmatically in different ways. +The Data Grid allows you to expand or collapse the [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) programmatically in different ways. ### Expand or collapse all the DetailsViewDataGrid @@ -1790,7 +1790,7 @@ this.dataGrid.CollapseDetailsViewAt(0); ## Hiding expander when parent record’s relation property has an empty collection or null -By default, the expander will be visible for all the data rows in parent DataGrid even if its [RelationalColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ViewDefinition.html#Syncfusion_UI_Xaml_Grid_ViewDefinition_RelationalColumn) property has an empty collection or null. +By default, the expander will be visible for all the data rows in parent grid even if its [RelationalColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ViewDefinition.html#Syncfusion_UI_Xaml_Grid_ViewDefinition_RelationalColumn) property has an empty collection or null. You can hide the expander from the view when corresponding `RelationalColumn` property has an empty collection or null, by setting [HideEmptyGridViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_HideEmptyGridViewDefinition) property as `true`. @@ -1804,13 +1804,13 @@ You can hide the expander from the view when corresponding `RelationalColumn` pr {% endhighlight %} {% endtabs %} -![WPF Master Details View DataGrid displays Expander View](Master-Details-View_images/wpf-datagrid-expander-view.png) +![Expander View](Master-Details-View_images/wpf-datagrid-expander-view.png) -## Hiding GridDetailsViewIndentCell in SfDataGrid +## Hiding GridDetailsViewIndentCell in the Data Grid [GridDetailsViewIndentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridDetailsViewIndentCell.html) is used to indicate the space between the expander and first column of the [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html). You can hide the [GridDetailsViewIndentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridDetailsViewIndentCell.html) by setting [SfDataGrid.ShowDetailsViewIndentCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ShowDetailsViewIndentCell) property to `False` for the respective parent grid. -![WPF DataGrid displays Master Details View with Indent Cells](Master-Details-View_images/wpf-datagrid-indent-cell.png) +![Master Details View with Indent Cells](Master-Details-View_images/wpf-datagrid-indent-cell.png) {% tabs %} {% highlight xaml %} @@ -1834,11 +1834,11 @@ dataGrid.ShowDetailsViewIndentCell= False; {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Master Details View without Indentation](Master-Details-View_images/wpf-datgrid-without-indent-cell.png) +![Master Details View without Indentation](Master-Details-View_images/wpf-datgrid-without-indent-cell.png) ## Hiding the details view expander icon based on child items count -By default, the state of expander icon is visible for all the data rows in parent DataGrid even if its `RelationalColumn` property has an empty collection or null. +By default, the state of expander icon is visible for all the data rows in parent grid even if its `RelationalColumn` property has an empty collection or null. You can customize hiding the details view expander icon by handling the `SfDataGrid.QueryDetailsViewExpanderState` event. This event occurs when expander icon is changed on expanding or collapsing the details view. You can hide the expander icon by setting the `ExpanderVisibility` property to `false` in the `SfDataGrid.QueryDetailsViewExpanderState` event based on condition. @@ -1861,7 +1861,7 @@ private void DataGrid_QueryDetailsViewExpanderState(object sender, Syncfusion.UI {% endtabs %} The following screenshot illustrates how to hide the state of expander icon based on child items count. -![Hidw Expander Icon in WPF Master Details View DataGird](Master-Details-View_images/wpf-datagrid-hide-expander-icon.png) +![Hide Expander Icon based on child items count](Master-Details-View_images/wpf-datagrid-hide-expander-icon.png) You can download the sample from the following link: [Sample](https://github.com/SyncfusionExamples/how-to-hide-the-detailsview-expander-icon-based-on-child-records-count-wpf-datagrid). ## Change DetailsViewDataGrid ItemsSource at runtime using LiveDataUpdateMode property @@ -2035,7 +2035,7 @@ N> To cancel expanding or collapsing operation in second level nested grid, you ## Master-Details View limitations -Following are the limitations of Master-Details View in SfDataGrid. +Following are the limitations of Master-Details View in the Data Grid. 1. `DetailsViewDataGrid` does not have `GroupDropArea`. 2. `DetailsViewDataGrid` does not support `AutoGenerateColumnsMode.ResetAll`. Instead it works based on `Reset`. @@ -2043,11 +2043,11 @@ Following are the limitations of Master-Details View in SfDataGrid. 4. Master-Details View doesn’t support [AllowFrozenGroupHeader](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowFrozenGroupHeaders). 5. Master-Details View doesn’t support Freeze Pane. 6. Master-Details View doesn’t support `AutoRowHeight`. -7. For `DetailsViewDataGrid`, `SelectionMode`, `SelectionUnit`, `NavigationMode`, `DetailsViewPadding` properties are assigned from its parent grid only. So both parent DataGrid and `DetailsViewDataGrid` cannot have different values for these properties. +7. For `DetailsViewDataGrid`, `SelectionMode`, `SelectionUnit`, `NavigationMode`, `DetailsViewPadding` properties are assigned from its parent grid only. So both the parent grid and `DetailsViewDataGrid` cannot have different values for these properties. ## See Also -[How to maintain the DetailsView expanded state when Sorting and Grouping the DataGrid (SfDataGrid)?](https://support.syncfusion.com/kb/article/9579/how-to-maintain-the-detailsview-expanded-state-when-sorting-and-grouping-the-datagrid) +[How to maintain the DetailsView expanded state when Sorting and Grouping the Data Grid?](https://support.syncfusion.com/kb/article/9579/how-to-maintain-the-detailsview-expanded-state-when-sorting-and-grouping-the-datagrid) [How to set the background for selected DetailsViewGrid?](https://support.syncfusion.com/kb/article/8282/how-to-set-the-background-for-selected-detailsviewgrid-in-wpf-datagrid-sfdatagrid) @@ -2055,7 +2055,7 @@ Following are the limitations of Master-Details View in SfDataGrid. [How to export the DetailsView records in expanded state to Excel?](https://support.syncfusion.com/kb/article/6537/how-to-export-detailsview-records-in-expanded-state-from-wpf-datagrid) -[How to print the SfDataGrid with DetailsView?](https://support.syncfusion.com/kb/article/6380/how-to-print-wpf-datagrid-sfdatagrid-with-detailsview) +[How to print the Data Grid with DetailsView?](https://support.syncfusion.com/kb/article/6380/how-to-print-wpf-datagrid-sfdatagrid-with-detailsview) [How to get the SelectedItem of the DetailsView?](https://support.syncfusion.com/kb/article/6337/how-to-get-the-selecteditem-of-the-detailsview-in-wpf-datagrid-sfdatagrid) diff --git a/wpf/DataGrid/Merge-Cells.md b/wpf/DataGrid/Merge-Cells.md index 04b7fa0f7..40bef854d 100644 --- a/wpf/DataGrid/Merge-Cells.md +++ b/wpf/DataGrid/Merge-Cells.md @@ -9,11 +9,11 @@ documentation: ug # Merge Cells in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to merge the range of adjacent cells using [QueryCoveredRange](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_QueryCoveredRange) event. Merged cells can be exported and printed. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to merge the range of adjacent cells using [QueryCoveredRange](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_QueryCoveredRange) event. Merged cells can be exported and printed. `QueryCoveredRange` event occurs when each cell gets arranged and the custom range will be stored for visible rows and columns in [SfDataGrid.CoveredCells](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CoveredCells). This event is not fired for the cells that are not visible and also for the cells that are already in `SfDataGrid.CoveredCells`. When scrolling the merged range will be added for newly added rows & columns through this event and also removed for the rows & columns which are out of view. -[GridQueryCoveredRangeEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridQueryCoveredRangeEventArgs.html) of the `QueryCoveredRange` event provides information about the cell triggered this event. [GridQueryCoveredRangeEventArgs.OriginalSender](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridEventArgs.html#Syncfusion_UI_Xaml_Grid_GridEventArgs_OriginalSender) returns the DataGrid fired this event for DetailsView. By [GridQueryCoveredRangeEventArgs.Range](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridQueryCoveredRangeEventArgs.html#Syncfusion_UI_Xaml_Grid_GridQueryCoveredRangeEventArgs_Range) property, the adjacent cells can be merged. +[GridQueryCoveredRangeEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridQueryCoveredRangeEventArgs.html) of the `QueryCoveredRange` event provides information about the cell triggered this event. [GridQueryCoveredRangeEventArgs.OriginalSender](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridEventArgs.html#Syncfusion_UI_Xaml_Grid_GridEventArgs_OriginalSender) returns the Data Grid that fired this event for DetailsView. By [GridQueryCoveredRangeEventArgs.Range](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridQueryCoveredRangeEventArgs.html#Syncfusion_UI_Xaml_Grid_GridQueryCoveredRangeEventArgs_Range) property, the adjacent cells can be merged. {% tabs %} {% highlight xaml %} @@ -61,7 +61,7 @@ void dataGrid_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e) {% endhighlight %} {% endtabs %} -![Horizontally Merged Cells in WPF DataGrid](Merge-Cells_images/wpf-datagrid-horizontally-merged-cells.png) +![Horizontally Merged Cells](Merge-Cells_images/wpf-datagrid-horizontally-merged-cells.png) ### Merging cells vertically by fixed range @@ -85,7 +85,7 @@ void dataGrid_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e) {% endhighlight %} {% endtabs %} -![Vertically Merged Cells in WPF DataGrid](Merge-Cells_images/wpf-datagrid-vertically-merged-cells.png) +![Vertically Merged Cells](Merge-Cells_images/wpf-datagrid-vertically-merged-cells.png) ### Merging range of cells @@ -107,7 +107,7 @@ private void dataGrid_QueryCoveredRange(object sender, GridQueryCoveredRangeEven {% endhighlight %} {% endtabs %} -![Merged Range of Cells in WPF DataGrid](Merge-Cells_images/wpf-datagrid-merge-range-of-cells.png) +![Merged Range of Cells](Merge-Cells_images/wpf-datagrid-merge-range-of-cells.png) ## Merging cells based on the content @@ -337,7 +337,7 @@ private void FirstLevelNestedGrid_QueryCoveredRange(object sender, GridQueryCove {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Merged Range of Cells in Master Details View](Merge-Cells_images/wpf-datagrid-merge-range-of-cells-in-details-view.png) +![Merged Range of Cells in Master Details View](Merge-Cells_images/wpf-datagrid-merge-range-of-cells-in-details-view.png) ### Merging range of parent cells @@ -424,7 +424,7 @@ pdfExportingOption.ExportMergedCells = true; ### Limitations -Below are the limitation when using Cell Merging in SfDataGrid. +Below are the limitation when using Cell Merging in Data Grid. 1. Row selection is not supported. 2. Heterogeneous rows can’t be merged. @@ -436,7 +436,7 @@ Below are the limitation when using Cell Merging in SfDataGrid. ### Allow cell merging with Row Selection or NavigationMode as Row or AllowFrozenGroupHeaders is true -[SfDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) does not allow cell merging when [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) is `Row` or [NavigationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_NavigationMode) is `Row` or [AllowFrozenGroupHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowFrozenGroupHeaders) is `true`. You can overcome this behavior by setting [ExternalExceptionThrownEventArgs.Handled](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ExternalExceptionThrownEventArgs.html#Syncfusion_UI_Xaml_Grid_ExternalExceptionThrownEventArgs_Handled) to `true` using [ExternalExceptionThrown](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. +[Data Grid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) does not allow cell merging when [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) is `Row` or [NavigationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_NavigationMode) is `Row` or [AllowFrozenGroupHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowFrozenGroupHeaders) is `true`. You can overcome this behavior by setting [ExternalExceptionThrownEventArgs.Handled](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ExternalExceptionThrownEventArgs.html#Syncfusion_UI_Xaml_Grid_ExternalExceptionThrownEventArgs_Handled) to `true` using [ExternalExceptionThrown](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. {% tabs %} {% highlight c# %} diff --git a/wpf/DataGrid/Overview.md b/wpf/DataGrid/Overview.md index 962cf28a5..b1ce3acc3 100644 --- a/wpf/DataGrid/Overview.md +++ b/wpf/DataGrid/Overview.md @@ -10,23 +10,23 @@ documentation: ug # About Syncfusion® WPF Data Grid Control -The [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) control for WPF is used to display collection of data in rows and columns. The SfDataGrid control includes editing, exporting and data shaping features (sorting, grouping, filtering and etc) that allows the end users to easily manage the data. +The [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) control for WPF is used to display collection of data in rows and columns. Data Grid includes editing, exporting and data shaping features (sorting, grouping, filtering and etc) that allows the end users to easily manage the data. -Following are the key features of SfDataGrid control +Following are the key features of Data Grid * **Data binding** – Supports to bind different types of data sources. * **Selection** – Support for row and also cell selection. * **Editing** – Interactive support to edit with different column types. * **Columns** – Support for various column types including unbound columns. -* **Sorting** – Interactive support to sort the data in SfDataGrid. -* **Grouping** – Interactive support to group the data in SfDataGrid. +* **Sorting** – Interactive support to sort the data in Data Grid. +* **Grouping** – Interactive support to group the data in Data Grid. * **Summaries** – Extensive support to show concise information about the individual data columns or groups of rows. * **Filtering** – Interactive support for filtering data as like in Excel. * **Data validation** – Support to validate the data on errors. * **Data virtualization** – Support for different modes of data virtualization such as paging, incremental loading. * **Master-Detail View** – Support to display relational data using hierarchies. * **Printing and Exporting** – Support to print and also export the data to Excel, PDF. -* **Styling** – Extensive support for customizing styles of cells and rows in SfDataGrid. +* **Styling** – Extensive support for customizing styles of cells and rows in Data Grid. * **Stacked Headers** – Extensive support to show multiple headers called stacked headers. * **Unbound rows** – Support to display unbound rows. * **Touch support** – Complete support for resizing, drag-drop column, sorting, filtering, grouping and etc in touch devices. @@ -51,12 +51,12 @@ The [GridTreeControl](https://help.syncfusion.com/wpf/classic/gridtree/overview) The [GridDataControl](https://help.syncfusion.com/wpf/classic/griddata/overview) and [SfDataGrid](https://www.syncfusion.com/wpf-controls/datagrid) controls are used to display collection of data in rows and columns. These controls support the data binding directly. -1. **SfDataGrid** - SfDataGrid is designed based on the WPF template-based architecture that provides support to customize the Grid easily and fully supports binding. +1. **SfDataGrid** - Data Grid is designed based on the WPF template-based architecture that provides support to customize the Grid easily and fully supports binding. 2. **GridDataControl** - GridDataControl is designed based on the cell-oriented architecture of the Windows Forms Grid control that provides more control over cells and supports for Excel-like features. -Both SfDataGrid and GridDataControl almost have the same set of features. But SfDataGrid control offers rich set of features over GridDataControl. When you want cell level customization and excel-like features you can use GridDataControl. When you want performance, customization features like styles & template features specific to WPF, you can use SfDataGrid control. Comparatively, the performance of SfDataGrid control is better than the GridDataControl. +Both SfDataGrid and GridDataControl almost have the same set of features. But SfDataGrid control offers rich set of features over GridDataControl. When you want cell level customization and excel-like features you can use GridDataControl. When you want performance, customization features like styles & template features specific to WPF, you can use SfDataGrid control. Comparatively, the performance of Data Grid is better than the GridDataControl. -N> `GridDataControl` is marked as classic control. In future, new features & enhancements will be added only in `SfDataGrid`. It recommended to use `SfDataGrid`. +N> `GridDataControl` is marked as classic control. In future, new features & enhancements will be added only in `SfDataGrid`. It recommended to use Data Grid. You can see the list of some of the specific API difference between `GridDataControl` and `SfDataGrid` as follows: @@ -186,9 +186,9 @@ You can see the list of some of the specific API difference between `GridDataCon The number of columns is freeze from right.
-You can see the list of rich set of features in `SfDataGrid` over `GridDataControl` as follows: +You can see the list of rich set of features in Data Grid over `GridDataControl` as follows: -Rich set of features in `SfDataGrid` over `GridDataControl`. +Rich set of features in Data Grid over `GridDataControl`. @@ -224,8 +224,8 @@ For more information about IEditableObject refer {{ '[IEditableObject](https://h Incremental Loading @@ -233,8 +233,8 @@ SfDataGrid sequentially. It provides support for fast and fluid scrolling and l Printing @@ -242,9 +242,9 @@ compared to GridDataControl.For more information about CustomPrinting, click {{ Exporting To Excel @@ -253,8 +253,8 @@ click {{ '[here](https://help.syncfusion.com/wpf/datagrid/export-to-excel)' | ma Exporting To PDF @@ -273,8 +273,8 @@ about FilterPopupPerformance, click {{ '[here](https://help.syncfusion.com/wpf/d DataVirtualization
-{{ '[IncrementalLoading](https://help.syncfusion.com/wpf/datagrid/data-virtualization#incremental-loading)' | markdownify }} allows you to load a subset of data to  -SfDataGrid sequentially. It provides support for fast and fluid scrolling and loading a huge set of data. +{{ '[IncrementalLoading](https://help.syncfusion.com/wpf/datagrid/data-virtualization#incremental-loading)' | markdownify }} allows you to load a subset of data to +Data Grid sequentially. It provides support for fast and fluid scrolling and loading a huge set of data.
-The Printing feature in SfDataGrid is more flexible and customizable. It also provides a good performance when -compared to GridDataControl.For more information about CustomPrinting, click {{ '[here](https://help.syncfusion.com/wpf/datagrid/printing)' | markdownify }}.The PrintManager of SfDataGrid is designed to support different orientations, sizes, margins etc. +The Printing feature in Data Grid is more flexible and customizable. It also provides a good performance when +compared to GridDataControl.For more information about CustomPrinting, click {{ '[here](https://help.syncfusion.com/wpf/datagrid/printing)' | markdownify }}.The PrintManager of Data Grid is designed to support different orientations, sizes, margins etc.
-SfDataGrid control provides support to Export data to Excel and returns an ExcelEngine that contains the exported -workbook. SfDataGrid Exporting is faster than GridDataControl. It exports the content only to the excel sheet. It -takes very less time to export the huge amounts of data. To know more about exporting in SfDataGrid, +Data Grid control provides support to Export data to Excel and returns an ExcelEngine that contains the exported +workbook. Data Grid Exporting is faster than GridDataControl. It exports the content only to the excel sheet. It +takes very less time to export the huge amounts of data. To know more about exporting in Data Grid, click {{ '[here](https://help.syncfusion.com/wpf/datagrid/export-to-excel)' | markdownify }}.
-SfDataGrid control provides support for exporting the data into a PDF file. You can decide what are the contents -is need to export in PDF file. You can export Grouping, Filtering, Summaries and DetailsView, StackedHeaders in to +Data Grid control provides support for exporting the data into a PDF file. You can decide what are the contents +is need to export in PDF file. You can export Grouping, Filtering, Summaries and DetailsView, StackedHeaders in to PDF file.To get more information about {{ '[ExportToPdf](https://help.syncfusion.com/wpf/datagrid/export-to-pdf)' | markdownify }}.
-{{ '[DataVirtualization](https://help.syncfusion.com/wpf/datagrid/data-virtualization)' | markdownify }} is a term that achieves Virtualization -for the actual data objects that are bound to the DataGrid. For small collection of basic data objects, the memory consumption is not significant. However for large collections, the memory consumption becomes very significant. +{{ '[DataVirtualization](https://help.syncfusion.com/wpf/datagrid/data-virtualization)' | markdownify }} is a term that achieves Virtualization +for the actual data objects that are bound to Data Grid. For small collection of basic data objects, the memory consumption is not significant. However for large collections, the memory consumption becomes very significant.
\ No newline at end of file diff --git a/wpf/DataGrid/Paging.md b/wpf/DataGrid/Paging.md index f63b9bd4e..34ff4ae17 100644 --- a/wpf/DataGrid/Paging.md +++ b/wpf/DataGrid/Paging.md @@ -9,11 +9,11 @@ documentation: ug # Paging in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to manipulate the data using SfDataPager control. You can refer [SfDataPager](https://help.syncfusion.com/wpf/datapager/overview) control user guide for more information. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to manipulate the data using SfDataPager control. You can refer [SfDataPager](https://help.syncfusion.com/wpf/datapager/overview) control user guide for more information. ## Getting started -Follow the below steps to bind SfDataGrid with SfDataPager. +Follow the below steps to bind Data Grid with SfDataPager. 1. Create `IEnumerable` collection that you want to bind and set it to [SfDataPager.Source](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Controls.DataPager.SfDataPager.html#Syncfusion_UI_Xaml_Controls_DataPager_SfDataPager_Source) property. @@ -123,7 +123,7 @@ public class OrderInfo {% endcapture %} {{ codesnippet1 | OrderList_Indent_Level_1 }} -![WPF DataGrid displays Multiple Pages using SfDataPager](paging_images/wpf-datagrid-multiple-page.png) +![Multiple Pages using SfDataPager](paging_images/wpf-datagrid-multiple-page.png) ### Limitations @@ -402,7 +402,7 @@ private void FilterBtn_Click(object sender, RoutedEventArgs e) Here, records are filtered based on the textbox text in clicking event of Filter button. Initially `PageCount` is 5 and it is changed as 3 once the records are filtered. -![WPF DataGrid displays Altering Page Count for DataPager while Filtering](paging_images/wpf-datagrid-datapager.png) +![Altering Page Count for DataPager while Filtering](paging_images/wpf-datagrid-datapager.png) ### Sorting complete collection @@ -483,7 +483,7 @@ private void dataPager_OnDemandLoading(object sender, Syncfusion.UI.Xaml.Control {% endtabs %} -![WPF DataGrid displays Sorting with loaded DataPager](paging_images/wpf-datagrid-sorting.png) +![Sorting with loaded DataPager](paging_images/wpf-datagrid-sorting.png) ### Loading ItemsSource for page using async and await diff --git a/wpf/DataGrid/Performance.md b/wpf/DataGrid/Performance.md index 90a0a3d4e..9c956887e 100644 --- a/wpf/DataGrid/Performance.md +++ b/wpf/DataGrid/Performance.md @@ -9,12 +9,12 @@ documentation: ug # Performance in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides various built-in options to optimize the performance when handling large amount of data or high frequency updates. +The [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides various built-in options to optimize the performance when handling a large amount of data or high frequency updates. ## Improving scrolling performance -You can improve the scrolling performance in SfDataGrid by setting [SfDataGrid.ScrollMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ScrollMode) property to **Async**. -This property enables the SfDataGrid to scroll the rows `asynchronously` with fade in animation. +You can improve the scrolling performance in the Data Grid by setting the [ScrollMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ScrollMode) property to **Async**. +This property enables the control to scroll the rows `asynchronously` with fade in animation. {% tabs %} {% highlight xaml %} @@ -42,11 +42,11 @@ You can style the cell and row conditionally in below three ways, 2. Using Data triggers 3. Using Style selectors -Conditional styling using converter provides better performance compare to Data Trigger approach and Style selector approach. You can refer [Styles and Template](https://help.syncfusion.com/wpf/datagrid/styles-and-templates) section for more information. +Conditional styling using a converter provides better performance compared to the Data Trigger approach and the Style selector approach. You can refer to the [Styles and Template](https://help.syncfusion.com/wpf/datagrid/styles-and-templates) section for more information. ### Improving loading and scrolling performance using LightWeightTemplate -You can improve the loading and scrolling performance in SfDataGrid by setting [SfDataGrid.UseDrawing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_UseDrawing) property as `Default`. When using this property, the grid cell content and its borders are drawn instead of loading `UIElement` and hence it reduces the `VisualTree` of SfDataGrid to improve the loading and scrolling performance. +You can improve the loading and scrolling performance in the Data Grid by setting the [UseDrawing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_UseDrawing) property as `Default`. When using this property, the cell content and its borders are drawn instead of loading `UIElement` and hence it reduces the `VisualTree` of the control to improve the loading and scrolling performance. {% tabs %} {% highlight xaml %} [PrintManagerBase](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html) is the `DataContext` for [PrintPageControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintPageControl.html), where the header and footer templates are loaded. @@ -246,7 +246,7 @@ dataGrid.ShowPrintPreview(); {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Current DateTime in Printing](printing_images/wpf-datagrid-datetime.png) +![Current DateTime in printing](printing_images/wpf-datagrid-datetime.png) ## Different modes of printing for better performance @@ -260,9 +260,9 @@ N> This is default print mode. For appearance customization of rows and cells wh ### Printing using UIElement Rendering -When you want to print the SfDataGrid with same appearance settings as in the display (Background and Foreground) or with custom appearance by writing styles, then you can enable this print option by setting [PrintSettings.AllowPrintByDrawing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintSettings.html#Syncfusion_UI_Xaml_Grid_PrintSettings_AllowPrintByDrawing) property to `false`. +When you want to print the Data Grid with same appearance settings as in the display (Background and Foreground) or with custom appearance by writing styles, then you can enable this print option by setting [PrintSettings.AllowPrintByDrawing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintSettings.html#Syncfusion_UI_Xaml_Grid_PrintSettings_AllowPrintByDrawing) property to `false`. -You can print SfDataGrid as it displayed in View by setting [PrintSettings.AllowPrintStyles](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintSettings.html#Syncfusion_UI_Xaml_Grid_PrintSettings_AllowPrintStyles) to `true`. +You can print Data Grid as it displayed in View by setting [PrintSettings.AllowPrintStyles](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintSettings.html#Syncfusion_UI_Xaml_Grid_PrintSettings_AllowPrintStyles) to `true`. {% tabs %} {% highlight c# %} @@ -285,7 +285,7 @@ dataGrid.ShowPrintPreview(); {% endhighlight %} {% endtabs %} -![Customizing Style in Printing of WPF DataGrid](printing_images/wpf-datagrid-style.png) +![Customizing style in printing](printing_images/wpf-datagrid-style.png) #### Applying custom style @@ -363,7 +363,7 @@ To provide custom appearance for Header cells while printing, [PrintHeaderCell]( {% endhighlight %} {% endtabs %} -To print SfDataGrid with custom styles, set [PrintSettings.AllowPrintByDrawing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintSettings.html#Syncfusion_UI_Xaml_Grid_PrintSettings_AllowPrintByDrawing) and [PrintSettings.AllowPrintStyles](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintSettings.html#Syncfusion_UI_Xaml_Grid_PrintSettings_AllowPrintStyles) properties to `false`. +To print Data Grid with custom styles, set [PrintSettings.AllowPrintByDrawing](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintSettings.html#Syncfusion_UI_Xaml_Grid_PrintSettings_AllowPrintByDrawing) and [PrintSettings.AllowPrintStyles](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintSettings.html#Syncfusion_UI_Xaml_Grid_PrintSettings_AllowPrintStyles) properties to `false`. {% tabs %} {% highlight c# %} @@ -374,7 +374,7 @@ dataGrid.ShowPrintPreview(); {% endhighlight %} {% endtabs %} -![WPF DataGrid with Custom Style while Printing](printing_images/wpf-datagrid-custom-style.png) +![Custom style while printing](printing_images/wpf-datagrid-custom-style.png) ## Printing Customization @@ -382,7 +382,7 @@ Printing operations can be customized by overriding [GridPrintManager](https://h ### Setting different Row Height -SfDataGrid allows you to set different Row height for specific rows while printing. You can achieve this by overriding the [GetRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html#Syncfusion_UI_Xaml_Grid_PrintManagerBase_GetRowHeight_System_Object_System_Int32_Syncfusion_UI_Xaml_Grid_RowType_) method in [PrintManagerBase](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html) class. +The Data Grid allows you to set different row height for specific rows while printing. You can achieve this by overriding the [GetRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html#Syncfusion_UI_Xaml_Grid_PrintManagerBase_GetRowHeight_System_Object_System_Int32_Syncfusion_UI_Xaml_Grid_RowType_) method in the [PrintManagerBase](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html) class. {% tabs %} {% highlight c# %} @@ -417,7 +417,7 @@ dataGrid.ShowPrintPreview(); {% endhighlight %} {% endtabs %} -![Customizing Row Height while Printing in WPF DataGrid](printing_images/wpf-datagrid-row-height-customization.png) +![Customizing row height while printing](printing_images/wpf-datagrid-row-height-customization.png) ### Hiding rows while printing @@ -456,7 +456,7 @@ dataGrid.ShowPrintPreview(); ### Setup columns to be printed -WPF DataGrid (SfDataGrid) allows you to exclude the columns while printing the grid. You can change the column list by overriding the [GetColumnNames](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html#Syncfusion_UI_Xaml_Grid_PrintManagerBase_GetColumnNames) method in [PrintManagerBase](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html) class. +The WPF Data Grid allows you to exclude the columns while printing the grid. You can change the column list by overriding the [GetColumnNames](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html#Syncfusion_UI_Xaml_Grid_PrintManagerBase_GetColumnNames) method in the [PrintManagerBase](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html) class. {% tabs %} {% highlight c# %} @@ -488,11 +488,11 @@ dataGrid.ShowPrintPreview(); Here, `CustomerName` column is displayed in grid. But it is excluded while printing. -![WPF DataGrid Printing with Hidden Column](printing_images/wpf-datagrid-hidden-column.png) +![Printing with hidden column](printing_images/wpf-datagrid-hidden-column.png) ### Customize the header text while printing -SfDataGrid allows you to change column header text while printing the grid. You can change the Column header text by overriding the [GetColumnHeaderText](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html#Syncfusion_UI_Xaml_Grid_GridPrintManager_GetColumnHeaderText_System_String_) method in [GridPrintManager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html). +The Data Grid allows you to change the column header text while printing the grid. You can change the column header text by overriding the [GetColumnHeaderText](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html#Syncfusion_UI_Xaml_Grid_GridPrintManager_GetColumnHeaderText_System_String_) method in the [GridPrintManager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html). {% tabs %} {% highlight c# %} @@ -526,7 +526,7 @@ dataGrid.ShowPrintPreview(); Here, OrderID column Header text is changed as `Order ID` while printing. -![Customizing Column Header Text while Printing in WPF DataGrid](printing_images/wpf-datagrid-header-text-customization.png) +![Customizing column header text while printing](printing_images/wpf-datagrid-header-text-customization.png) ### Styling Rows when AllowPrintByDrawing enabled @@ -572,7 +572,7 @@ dataGrid.ShowPrintPreview(); {% endhighlight %} {% endtabs %} -![Customizing Row Style while Printing in WPF DataGrid](printing_images/wpf-datagrid-row-style-customization.png) +![Customizing row style while printing](printing_images/wpf-datagrid-row-style-customization.png) ### Styling Rows when AllowPrintByDrawing disabled @@ -616,7 +616,7 @@ dataGrid.ShowPrintPreview(); {% endtabs %} -![Customizing Row Style while Printing in WPF DataGrid](printing_images/wpf-datagrid-row-style.png) +![Customizing row style while printing](printing_images/wpf-datagrid-row-style.png) @@ -680,7 +680,7 @@ Unbound row cells ### Setup alternate row style when AllowPrintByDrawing enabled -SfDataGrid allows you to apply alternative row style by overriding [OnRenderCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html#Syncfusion_UI_Xaml_Grid_GridPrintManager_OnRenderCell_System_Windows_Media_DrawingContext_Syncfusion_UI_Xaml_Grid_RowInfo_Syncfusion_UI_Xaml_Grid_CellInfo_) method in [GridPrintManager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html). +The Data Grid allows you to apply an alternate row style by overriding the [OnRenderCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html#Syncfusion_UI_Xaml_Grid_GridPrintManager_OnRenderCell_System_Windows_Media_DrawingContext_Syncfusion_UI_Xaml_Grid_RowInfo_Syncfusion_UI_Xaml_Grid_CellInfo_) method in [GridPrintManager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html). {% tabs %} {% highlight c# %} @@ -715,11 +715,11 @@ dataGrid.ShowPrintPreview(); {% endtabs %} -![Changing Alternate Row Style while Printing in WPF DataGrid](printing_images/wpf-datagrid-alternate-row-style.png) +![Changing alternate row style while printing](printing_images/wpf-datagrid-alternate-row-style.png) ### Setup alternate row style when AllowPrintByDrawing disabled -SfDataGrid allows you to apply alternative row style by overriding [GetPrintGridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html#Syncfusion_UI_Xaml_Grid_GridPrintManager_GetPrintGridCell_System_Object_System_String_) method in [GridPrintManager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html). +The control also allows you to apply an alternate row style by overriding the [GetPrintGridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html#Syncfusion_UI_Xaml_Grid_GridPrintManager_GetPrintGridCell_System_Object_System_String_) method in the [GridPrintManager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridPrintManager.html). {% tabs %} {% highlight c# %} @@ -754,7 +754,7 @@ dataGrid.ShowPrintPreview(); {% endtabs %} -![Changing Alternate Row Style while Printing in WPF DataGrid](printing_images/wpf-datagrid-with-alternate-row-style.png) +![Changing alternate row style while printing](printing_images/wpf-datagrid-with-alternate-row-style.png) ### Styling Columns when AllowPrintByDrawing enabled @@ -803,7 +803,7 @@ dataGrid.ShowPrintPreview(); {% endhighlight %} {% endtabs %} -![Changing Column Style while Printing in WPF DataGrid](printing_images/wpf-datagrid-column-style.png) +![Changing column style while printing](printing_images/wpf-datagrid-column-style.png) Here, OrderID column Font Style and Background are changed. @@ -843,7 +843,7 @@ dataGrid.ShowPrintPreview(); {% endtabs %} -![Changing Column Style while Printing in WPF DataGrid](printing_images/wpf-datagrid-column-style.png) +![Changing column style while printing](printing_images/wpf-datagrid-column-style.png) N> [GetColumnWidth](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html#Syncfusion_UI_Xaml_Grid_PrintManagerBase_GetColumnWidth_System_String_) , [GetColumnTextWrapping](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html#Syncfusion_UI_Xaml_Grid_PrintManagerBase_GetColumnTextWrapping_System_String_), [GetColumnTextAlignment](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html#Syncfusion_UI_Xaml_Grid_PrintManagerBase_GetColumnTextAlignment_System_String_) and [GetColumnPadding](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.PrintManagerBase.html#Syncfusion_UI_Xaml_Grid_PrintManagerBase_GetColumnPadding_System_String_) methods are also used for column customization while printing. @@ -898,7 +898,7 @@ dataGrid.ShowPrintPreview(); {% endtabs %} -![Printing Selected Rows in WPF DataGrid](printing_images/wpf-datagrid-print-selected-rows.png) +![Printing selected rows](printing_images/wpf-datagrid-print-selected-rows.png) ## Creating custom PrintPreview window @@ -969,6 +969,6 @@ this.PrintPreviewArea.PrintManagerBase.Print(); {% endcapture %} {{ codesnippet5 | OrderList_Indent_Level_1 }} -![Custom Print Preview Window in WPF DataGrid](printing_images/wpf-datagrid-custom-print-preview-window.png) +![Custom print preview window](printing_images/wpf-datagrid-custom-print-preview-window.png) You can get the sample for custom print preview [here](https://www.syncfusion.com/downloads/support/directtrac/general/CUSTOM~1272396097.ZIP). diff --git a/wpf/DataGrid/Record-Template-View.md b/wpf/DataGrid/Record-Template-View.md index 27bde2397..52b499433 100644 --- a/wpf/DataGrid/Record-Template-View.md +++ b/wpf/DataGrid/Record-Template-View.md @@ -9,9 +9,9 @@ documentation: ug # Record Template View in WPF Data Grid -The SfDataGrid provides support to represent additional information of a row using [TemplateViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html) that can be defined in datagrid. It allows you to load any WPF controls to [TemplateViewDefinition.RowTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html#Syncfusion_UI_Xaml_Grid_TemplateViewDefinition_RowTemplate) in order to display the additional information of a row. You can expand or collapse the row template view by using an expander in a row or programmatically. +The Data Grid provides support to represent additional information of a row using [TemplateViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html) that can be defined in the control. It allows you to load any WPF controls to [TemplateViewDefinition.RowTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html#Syncfusion_UI_Xaml_Grid_TemplateViewDefinition_RowTemplate) in order to display the additional information of a row. You can expand or collapse the row template view by using an expander in a row or programmatically. -![WPF DataGrid displays Record Template View](Record_Template_View_images/wpf-datagrid-record-template-view.png) +![Record Template View](Record_Template_View_images/wpf-datagrid-record-template-view.png) ## Defining row template @@ -249,7 +249,7 @@ public class detailsViewTemplateSelector : DataTemplateSelector {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Record Template View for Each Row](Record_Template_View_images/wpf-datagrid-record-template-for-rows.png) +![Record Template View for each row](Record_Template_View_images/wpf-datagrid-record-template-for-rows.png) ## Height customization @@ -293,11 +293,11 @@ Arranges template for the ViewPortHeight when the {{'[RowTemplate](
## Handling Row Virtualization in RowTemplate -By default, rows in the `DataGrid` are virtualized and reused to enhance performance. However, when using a RowTemplate that includes interactive controls (such as SfDataGrid, DataGrid, or similar components), this reuse can lead to unexpected behavior during data operations like sorting or filtering. Specifically, the visual state and data bindings of these controls may not persist correctly. +By default, rows in the Data Grid are virtualized and reused to enhance performance. However, when using a RowTemplate that includes interactive controls (such as a nested grid or similar components), this reuse can lead to unexpected behavior during data operations like sorting or filtering. Specifically, the visual state and data bindings of these controls may not persist correctly. This occurs because the same row visual elements are recycled and displayed for different data items during virtualization. -To provide greater flexibility, the [TemplateRenderMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html#Syncfusion_UI_Xaml_Grid_TemplateViewDefinition_TemplateRenderMode) property is available for row templates. This property allows you to configure how the row templates are instantiated and managed within the DataGrid. +To provide greater flexibility, the [TemplateRenderMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html#Syncfusion_UI_Xaml_Grid_TemplateViewDefinition_TemplateRenderMode) property is available for row templates. This property allows you to configure how the row templates are instantiated and managed within the control. ## TemplateRenderMode @@ -317,7 +317,7 @@ Use `Individual` when your row template is contains interactive controls that ne ## Keyboard navigation support for DetailsViewTemplate -In the SfDataGrid, you can navigate from parent row to DetailsViewTemplate and vice-versa using Tab key by default. You can also restrict tab key navigation from parent to DetailsViewTemplate by setting the [TemplateViewDefinition.TemplateNavigationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html#Syncfusion_UI_Xaml_Grid_TemplateViewDefinition_NavigationMode) property value to `ExcludeTemplateRow`. +In the Data Grid, you can navigate from parent row to DetailsViewTemplate and vice-versa using Tab key by default. You can also restrict tab key navigation from parent to DetailsViewTemplate by setting the [TemplateNavigationMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html#Syncfusion_UI_Xaml_Grid_TemplateViewDefinition_NavigationMode) property value to `ExcludeTemplateRow`. {% tabs %} {% highlight xaml %} @@ -367,7 +367,7 @@ private void dataGrid_DetailsViewExpanding(object sender, Syncfusion.UI.Xaml.Gri ## Expanding and collapsing row template programmatically -The SfDataGrid allows you to expand or collapse the [RowTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html#Syncfusion_UI_Xaml_Grid_TemplateViewDefinition_RowTemplate) programmatically in different ways. +The Data Grid allows you to expand or collapse the [RowTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TemplateViewDefinition.html#Syncfusion_UI_Xaml_Grid_TemplateViewDefinition_RowTemplate) programmatically in different ways. ### Expand or collapse all the row template diff --git a/wpf/DataGrid/Row-Height-Customization.md b/wpf/DataGrid/Row-Height-Customization.md index 82eaf9660..291f083ff 100644 --- a/wpf/DataGrid/Row-Height-Customization.md +++ b/wpf/DataGrid/Row-Height-Customization.md @@ -63,15 +63,15 @@ void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) {% endhighlight %} {% endtabs %} -![Customizing Particular Row Height in WPF DataGrid](row-height-customization_images/wpf-datagrid-customizing-row-height.png) +![Customizing particular row height](row-height-customization_images/wpf-datagrid-customizing-row-height.png) ## QueryRowHeight event -You can change the row height in on-demand based on the row index or row data using [SfDataGrid.QueryRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. +You can change the row height on-demand based on the row index or row data using the [QueryRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. -`QueryRowHeight` event triggered for each row when it becomes visible.[QueryRowHeightEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.QueryRowHeightEventArgs.html) provides information to `QueryRowHeight` event with following members, +The `QueryRowHeight` event is triggered for each row when it becomes visible.[QueryRowHeightEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.QueryRowHeightEventArgs.html) provides information to the `QueryRowHeight` event with the following members, -* `RowIndex` – denotes index of the row in SfDataGrid. +* `RowIndex` – denotes the index of the row in the Data Grid. * `Height` – Gets or sets the height of the row. @@ -95,7 +95,7 @@ void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) {% endhighlight %} {% endtabs %} -![Changing Specific Row Height in WPF DataGrid](row-height-customization_images/wpf-datagrid-change-row-height.png) +![Changing specific row height](row-height-customization_images/wpf-datagrid-change-row-height.png) ### Limitations @@ -103,13 +103,13 @@ void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) ## Fit the Row Height based on its content -You can fit the row height based on its content in `QueryRowHeight` event handler using [GetAutoRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnSizer.html#Syncfusion_UI_Xaml_Grid_GridColumnSizer_GetAutoRowHeight_System_Int32_Syncfusion_UI_Xaml_Grid_GridRowSizingOptions_System_Double__System_Boolean_) method. This improves the readability of the content and it does not affect the loading performance of the SfDataGrid as the `QueryRowHeight` event triggered for rows in on-demand. +You can fit the row height based on its content in the `QueryRowHeight` event handler using the [GetAutoRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnSizer.html#Syncfusion_UI_Xaml_Grid_GridColumnSizer_GetAutoRowHeight_System_Int32_Syncfusion_UI_Xaml_Grid_GridRowSizingOptions_System_Double__System_Boolean_) method. This improves the readability of the content and it does not affect the loading performance of the Data Grid as the `QueryRowHeight` event is triggered for rows on-demand. `GetAutoRowHeight` method returns `true` when the row height is calculated for record & header rows and returns `false` for other rows. Calculated height based on content set to the `out` parameter and you can assign the calculated height to the `Height` property of [QueryRowHeightEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.QueryRowHeightEventArgs.html). Below are the parameter to `GetAutoRowHeight` method, -1. `RowIndex` – denotes the index of row in SfDataGrid. +1. `RowIndex` – denotes the index of the row in the Data Grid. 2. `GridRowSizingOptions` – A class with properties to customize the row height calculation. @@ -149,7 +149,7 @@ void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) Here, row heights are customized based on the large text content. -![AutoFit RowHeight in WPF DataGrid](row-height-customization_images/wpf-datagrid-auto-fit-row-height.png) +![AutoFit row height](row-height-customization_images/wpf-datagrid-auto-fit-row-height.png) ### GridRowSizingOptions @@ -161,9 +161,9 @@ Here, row heights are customized based on the large text content. ### Calculate Height based on certain columns -You can exclude columns from row height calculation using [GridRowSizingOptions.ExcludeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowSizingOptions.html#Syncfusion_UI_Xaml_Grid_GridRowSizingOptions_ExcludeColumns). This will helps to reduce the count of loop run for height calculation for better performance. +You can exclude columns from row height calculation using [GridRowSizingOptions.ExcludeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowSizingOptions.html#Syncfusion_UI_Xaml_Grid_GridRowSizingOptions_ExcludeColumns). This will help to reduce the loop count for height calculation for better performance. -You can add the columns which needs to exclude from height calculation using `GridRowSizingOptions.ExcludeColumns` collection. +You can add the columns which need to be excluded from height calculation using the `GridRowSizingOptions.ExcludeColumns` collection. {% tabs %} @@ -195,9 +195,9 @@ void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) {% endtabs %} -Here `CustomerID` and `Country` columns are excluded from height calculation and the row height is calculated based on `CustomerName` column only. +Here, the `CustomerID` and `Country` columns are excluded from height calculation and the row height is calculated based on the `CustomerName` column only. -![AutoFit RowHeight for Specific Columns in WPF DataGrid](row-height-customization_images/wpf-datagrid-autofit-height-based-on-column.png) +![AutoFit row height for specific columns](row-height-customization_images/wpf-datagrid-autofit-height-based-on-column.png) ## Reset Row Height at runtime @@ -234,7 +234,7 @@ dataGrid.GetVisualContainer().InvalidateMeasureInfo(); ### Update Row Height while editing -You can set the height of the row based on the content after editing by refreshing the row height in [SfDataGrid.CurrentCellEndEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. +You can set the height of the row based on the content after editing by refreshing the row height in the [CurrentCellEndEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event. You can call the `InvalidateRowHeight` method in [CurrentCellEndEdit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellEndEdit) event to reset the particular row height. Then call the `InvalidateMeasureInfo` method of `VisualContainer` to refresh the view. Now the `QueryRowHeight` event is called again for edited row alone and row height is calculated based on edited content. @@ -326,7 +326,7 @@ void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) {% endhighlight %} {% endtabs %} -![AutoFit Header RowHeight based on Content in WPF DataGrid](row-height-customization_images/wpf-datagrid-header-row-height.png) +![AutoFit header row height based on content](row-height-customization_images/wpf-datagrid-header-row-height.png) ## Change StackedHeaderRow Height based on its content @@ -384,7 +384,7 @@ void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) {% endhighlight %} {% endtabs %} -![AutoFit Stacked HeaderRow Height based on Content in wpf datagrid](row-height-customization_images/wpf-datagrid-stacked-header-row-height.png) +![AutoFit stacked header row height based on content](row-height-customization_images/wpf-datagrid-stacked-header-row-height.png) ## Change TableSummaryRow Height @@ -408,5 +408,5 @@ void dataGrid_QueryRowHeight(object sender, QueryRowHeightEventArgs e) {% endhighlight %} {% endtabs %} -![Customizing TableSummaryRow Height in WPF DataGrid](row-height-customization_images/wpf-datagrid-table-summary-row-height.png) +![Customizing table summary row height](row-height-customization_images/wpf-datagrid-table-summary-row-height.png) diff --git a/wpf/DataGrid/Rows.md b/wpf/DataGrid/Rows.md index 3daeface2..5c798a42e 100644 --- a/wpf/DataGrid/Rows.md +++ b/wpf/DataGrid/Rows.md @@ -9,7 +9,7 @@ documentation: ug # Rows in WPF Data Grid -This section explains about various row types in [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid). +This section explains about various row types in [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) (Data Grid). [StackedHeaderRow](https://help.syncfusion.com/wpf/datagrid/columns#stacked-headers) @@ -197,7 +197,7 @@ You can change the CurrentRowIndicator in the row header by customizing the cont {% endhighlight %} {% endtabs %} -![Customizing Current Row Indicator in WPF DataGrid](Interactive-Features_images/wpf-datagrid-row-indicator.png) +![Customizing Current Row Indicator](Interactive-Features_images/wpf-datagrid-row-indicator.png) You can get the sample from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/ChangingCurrentRowIndicator257326168.zip). @@ -248,15 +248,15 @@ public class CustomConverter:IValueConverter {% endhighlight %} {% endtabs %} -![Changing Row Header Background of WPF DataGrid](Interactive-Features_images/wpf-datagrid-row-header-background.png) +![Changing Row Header Background](Interactive-Features_images/wpf-datagrid-row-header-background.png) You can get the sample from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/BackgroundColorForRowHeader_WPF18250214901515913833.zip). ## Header Row -Header row is present in top of the WPF DataGrid which has column headers in it. Column header describes the caption to identify the column content. +Header row is present in top of the WPF Data Grid which has column headers in it. Column header describes the caption to identify the column content. -![WPF DataGrid displays Column Header in Header Row](Rows_images/wpf-datagrid-column-header.png) +![Displays Column Header in Header Row](Rows_images/wpf-datagrid-column-header.png) You can change the header row height by setting [SfDataGrid.HeaderRowHeight](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_HeaderRowHeight) property. @@ -294,7 +294,7 @@ You can also hide the header row of DetailsViewDataGrid by setting `HeaderRowHei ## Freeze panes -WPF DataGrid provides support to freeze the rows and columns at top and bottom similar to excel. You can freeze the rows and columns by setting following properties, +Data Grid provides support to freeze the rows and columns at top and bottom similar to excel. You can freeze the rows and columns by setting following properties, @@ -310,7 +310,7 @@ Description {{'[FrozenRowsCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_FrozenRowsCount)'| markdownify }} @@ -318,7 +318,7 @@ Set the frozen rows count at top of the SfDataGrid. {{'[FooterRowsCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_FooterRowsCount)'| markdownify }} @@ -326,7 +326,7 @@ Set the footer rows count at bottom of the SfDataGrid. {{'[FrozenColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_FrozenColumnCount)'| markdownify }} @@ -334,7 +334,7 @@ Set the frozen columns count in left side of the SfDataGrid. {{'[FooterColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_FooterColumnCount)'| markdownify }}
-Set the frozen rows count at top of the SfDataGrid. +Set the frozen rows count at top of the Data Grid.
-Set the footer rows count at bottom of the SfDataGrid. +Set the footer rows count at bottom of the Data Grid.
-Set the frozen columns count in left side of the SfDataGrid. +Set the frozen columns count in left side of the Data Grid.
-Set the frozen columns in right side of the SfDataGrid. +Set the frozen columns in right side of the Data Grid.
@@ -357,7 +357,7 @@ dataGrid.FrozenRowsCount = 3; {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Frozen Rows and columns](Rows_images/wpf-datagrid-freeze-rows-and-columns.png) +![Displays Frozen Rows and columns](Rows_images/wpf-datagrid-freeze-rows-and-columns.png) ### Differentiate frozen rows from normal rows @@ -439,7 +439,7 @@ You can differentiate the frozen rows and footer rows from normal rows by writin {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Differentiating Frozen Rows and Footer Rows from Normal Rows](Rows_images/wpf-datagrid-differentiate-frozen-rows-and-columns.png) +![Displays Differentiating Frozen Rows and Footer Rows from Normal Rows](Rows_images/wpf-datagrid-differentiate-frozen-rows-and-columns.png) ### Disable drag and drop between frozen and non-frozen columns @@ -485,7 +485,7 @@ void dataGrid_QueryColumnDragging(object sender, QueryColumnDraggingEventArgs e) 2. When `AllowFrozenGroupHeaders` is true, frozen rows will not be considered. -3. SfDataGrid has support to freeze the number of rows from top or bottom. There is no support to freeze a specific row. +3. Data Grid has support to freeze the number of rows from top or bottom. There is no support to freeze a specific row. N> 1. Header rows, table summary rows and row header are frozen regardless of `FrozenRowsCount` and `FooterRowsCount`. 2. `FrozenRowsCount` and `FooterRowsCount` values should be less than the number of rows and column visible. diff --git a/wpf/DataGrid/Search.md b/wpf/DataGrid/Search.md index 42c3e11cf..6d5cf95bb 100644 --- a/wpf/DataGrid/Search.md +++ b/wpf/DataGrid/Search.md @@ -9,7 +9,7 @@ documentation: ug # Search in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) control allows you to search the data displayed in the SfDataGrid. You can search the data by using [SearchHelper.Search](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html#Syncfusion_UI_Xaml_Grid_SearchHelper_Search_System_String_) method. +[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) control allows you to search the data displayed in the Data Grid. You can search the data by using [SearchHelper.Search](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html#Syncfusion_UI_Xaml_Grid_SearchHelper_Search_System_String_) method. {% tabs %} {% highlight c# %} @@ -19,7 +19,7 @@ this.dataGrid.SearchHelper.Search(TextBox.Text); {% endhighlight %} {% endtabs %} -![WPF DataGrid with Search Panel](Search_images/wpf-datagrid-search-panel.png) +![Search Panel](Search_images/wpf-Data Grid-search-panel.png) ## Filtering @@ -35,7 +35,7 @@ this.dataGrid.SearchHelper.Search(TextBox.Text); {% endhighlight %} {% endtabs %} -![Enabling Filter based on Search in WPF DataGrid](Search_images/wpf-datagrid-filter-based-on-search.png) +![Enabling Filter based on Search in WPF Data Grid](Search_images/wpf-datagrid-filter-based-on-search.png) You can search the data with the case-sensitivity by setting [SearchHelper.AllowCaseSensitiveSearch](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html#Syncfusion_UI_Xaml_Grid_SearchHelper_AllowCaseSensitiveSearch) property. @@ -50,7 +50,7 @@ this.dataGrid.SearchHelper.AllowCaseSensitiveSearch = true; ### Changing Search Highlight Background -In WPF DataGrid (SfDatagrid), you can change the search text highlighting color by setting [SearchHelper.SearchBrush](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html#Syncfusion_UI_Xaml_Grid_SearchHelper_SearchBrush) property.  +In WPF DataGrid you can change the search text highlighting color by setting [SearchHelper.SearchBrush](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html#Syncfusion_UI_Xaml_Grid_SearchHelper_SearchBrush) property.  {% tabs %} {% highlight c# %} @@ -61,11 +61,11 @@ this.dataGrid.SearchHelper.Search(TextBox.Text); {% endhighlight %} {% endtabs %} -![Changing Search Text Highlighting Color in WPF DataGrid](Search_images/wpf-datagrid-highlight-search-color.png) +![Changing Search Text Highlighting Color](Search_images/wpf-Data Grid-highlight-search-color.png) ### Changing foreground for search highlight -In WPF DataGrid (SfDatagrid), you can change the foreground color for search text by setting the [SearchHelper.SearchForegroundBrush](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html#Syncfusion_UI_Xaml_Grid_SearchHelper_SearchForegroundBrush) property. +In WPF DataGrid you can change the foreground color for search text by setting the [SearchHelper.SearchForegroundBrush](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html#Syncfusion_UI_Xaml_Grid_SearchHelper_SearchForegroundBrush) property. {% tabs %} {% highlight c# %} @@ -75,7 +75,7 @@ this.dataGrid.SearchHelper.SearchForegroundBrush = Brushes.Red; {% endhighlight %} {% endtabs %} -![Changing Fore Color of Search Text in WPF DataGrid](Search_images/wpf-datagrid-search-text-fore-color.png) +![Changing Fore Color of Search Text](Search_images/wpf-datagrid-search-text-fore-color.png) ## Navigating cells based on search text @@ -101,7 +101,7 @@ this.dataGrid.SearchHelper.FindNext("TextBox.Text "); {% endhighlight %} {% endtabs %} -![Highlighting Navigated Search Text in WPF DataGrid](Search_images/wpf-datagrid-highlight-navigate-search-text.png) +![Highlighting Navigated Search Text](Search_images/wpf-datagrid-highlight-navigate-search-text.png) You can highlight the foreground color of current navigated search text by using the [SearchHelper.SearchForegroundHighlightBrush](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html#Syncfusion_UI_Xaml_Grid_SearchHelper_SearchForegroundHighlightBrush) property. @@ -113,7 +113,7 @@ this.dataGrid.SearchHelper.SearchForegroundHighlightBrush = Brushes.Red; {% endhighlight %} {% endtabs %} -![Highlighting Current Navigated Search Text Color in WPF DataGrid](Search_images/wpf-datagrid-navigated-search-text-color.png) +![Highlighting Current Navigated Search Text Color](Search_images/wpf-datagrid-navigated-search-text-color.png) ## Move CurrentCell when FindNext and FindPrevious @@ -154,7 +154,7 @@ Master-details view allows you to search the data by using [SearchHelper.Search] {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Searched Data](Search_images/wpf-datagrid-search-data.png) +![Displays Searched Data](Search_images/wpf-Data Grid-search-data.png) ### Navigating cells based on search text in DetailsViewDataGrid @@ -171,11 +171,11 @@ You can navigate to the cells contains the SearchText using [SearchHelper.FindNe {% endtabs %} You can get the sample from [here](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MasterDetailsViewSearch-140489943.zip). -N> It is not possible to Navigate with the two DataGrid at a time. +N> It is not possible to Navigate with the two Data Grid at a time. ## Search customization -WPF DataGrid (SfDataGrid) process the search operations in [SearchHelper](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html) class. You can change the default search behaviors by overriding `SearchHelper` class and set to `SfDataGrid.SearchHelper`. +WPF DataGrid process the search operations in [SearchHelper](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SearchHelper.html) class. You can change the default search behaviors by overriding `SearchHelper` class and set to `Data Grid.SearchHelper`. {% tabs %} {% highlight c# %} @@ -225,7 +225,7 @@ public class SearchHelperExt : SearchHelper {% endhighlight %} {% endtabs %} -![WPF DataGrid displays Search Text only in Selected Column](Search_images/wpf-datagrid-search-text-in-column.png) +![Displays Search Text only in Selected Column](Search_images/wpf-datagrid-search-text-in-column.png) ### Select the record based on the SearchText @@ -244,12 +244,12 @@ this.dataGrid.SelectedIndex = recordIndex; {% endhighlight %} {% endtabs %} -![Select Record based on SearchText in WPF DataGrid](Search_images/wpf-datagrid-select-record-based-on-search.png) +![Select Record based on SearchText](Search_images/wpf-datagrid-select-record-based-on-search.png) ### Search with the GridComboBoxColumn -You can search the data in SfDataGrid with all the GridColumns which loads TextBlock as display element. To perform the search operation in the [GridComboBoxColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridComboBoxColumn.html) you need to customize the `GridComboBoxColumn`. As it loads the ContentControl in display mode. +You can search the data in Data Grid with all the GridColumns which loads TextBlock as display element. To perform the search operation in the [GridComboBoxColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridComboBoxColumn.html) you need to customize the `GridComboBoxColumn`. As it loads the ContentControl in display mode. {% tabs %} {% highlight c# %} @@ -377,8 +377,8 @@ public class ComboBoxRendererExt : GridVirtualizingCellRenderer @@ -65,7 +65,7 @@ Allows selection of more than one row or cell. Selection is not cleared when sel Extended -Allows selecting multiple rows or cells. You can select multiple rows or cells in the SfDataGrid by dragging the mouse or by using the key modifiers Ctrl and Shift. +Allows selecting multiple rows or cells. You can select multiple rows or cells in the Data Grid by dragging the mouse or by using the key modifiers Ctrl and Shift. @@ -86,11 +86,11 @@ Allows selecting multiple rows or cells. You can select multiple rows or cells i You can disable selection and navigation on particular column by setting [GridColumn.AllowFocus](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_AllowFocus) property. You can disable selection on particular row or cell or column by handling [CurrentCellActivating](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellActivating) event. -N> It is not possible to select header rows, table summary rows, unbound rows which are above the table summary row when it’s placed in top and the unbound rows which are below table summary rows when it’s placed in bottom of SfDataGrid. +N> It is not possible to select header rows, table summary rows, unbound rows which are above the table summary row when it’s placed in top and the unbound rows which are below table summary rows when it’s placed in bottom of Data Grid. ## Multiple Row or Cell Selection -The WPF DataGrid (SfDataGrid) allows you to select multiple rows or cells by setting [SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode) property as [Extended](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionMode.html) or [Multiple](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionMode.html), where you can select multiple rows or cells by dragging the mouse on SfDataGrid and also using the key modifiers. +The WPF DataGrid allows you to select multiple rows or cells by setting [SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode) property as [Extended](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionMode.html) or [Multiple](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionMode.html), where you can select multiple rows or cells by dragging the mouse on Data Grid and also using the key modifiers. While using `Extended`, you can select multiple rows or cells by pressing the key modifiers Ctrl and Shift. @@ -123,10 +123,10 @@ N> When the [SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xam ## CheckBox column selection -`SfDataGrid` allows you to select or deselect rows by interacting with the check box in a column. All the rows in a datagrid can be selected by interacting with an intuitive check box in the column header. Refer to [GridCheckBoxSelectorColumn](https://help.syncfusion.com/wpf/datagrid/column-types#gridcheckboxselectorcolumn) documentation for more information. +`Data Grid` allows you to select or deselect rows by interacting with the check box in a column. All the rows in a datagrid can be selected by interacting with an intuitive check box in the column header. Refer to [GridCheckBoxSelectorColumn](https://help.syncfusion.com/wpf/datagrid/column-types#gridcheckboxselectorcolumn) documentation for more information. ## Excel Like Selection -The `SfDataGrid` provides built‑in support for **Excel‑Like Selection**, which can be enabled by setting the [EnableExcelLikeSelection](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_EnableExcelLikeSelection) property to true. +The `Data Grid` provides built‑in support for **Excel‑Like Selection**, which can be enabled by setting the [EnableExcelLikeSelection](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.Data Grid.html#Syncfusion_UI_Xaml_Grid_Data Grid_EnableExcelLikeSelection) property to true. When Excel‑Like Selection is enabled, the following settings are required for proper functionality: * [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionUnit) must be set to `Any`. @@ -230,7 +230,7 @@ N> The `SelectionFrame` is displayed only when [ShowSelectionFrame](https://help ## Get Selected Rows and Cells -The [SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) property returns the data object of the selected row and the [SelectedIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedIndex) property returns the index of the `SelectedItem` in SfDataGrid. `SelectedItem` denotes the first selected row in multiple selection. +The [SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) property returns the data object of the selected row and the [SelectedIndex](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedIndex) property returns the index of the `SelectedItem` in Data Grid. `SelectedItem` denotes the first selected row in multiple selection. The [CurrentItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentItem) returns the data object that currently has the focus and the [CurrentColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentColumn) denotes the [GridColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html) that currently has the focus. The [CurrentCellInfo](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentCellInfo) returns an instance [GridCellInfo](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCellInfo.html) which contains the information about the cell that currently has the focus. @@ -254,7 +254,7 @@ List selectedCells = this.dataGrid.GetSelectedCells(); ### CurrentItem vs SelectedItem -Both [SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) and [CurrentItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentItem) returns the same data object when there is single cell or row is selected in SfDataGrid. When you have selected more than one rows or cells, the record that had been selected initially is maintained in `SelectedItem` and the record that currently have focus is maintained in `CurrentItem`. +Both [SelectedItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectedItem) and [CurrentItem](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CurrentItem) returns the same data object when there is single cell or row is selected in Data Grid. When you have selected more than one rows or cells, the record that had been selected initially is maintained in `SelectedItem` and the record that currently have focus is maintained in `CurrentItem`. ## Programmatic selection @@ -850,7 +850,7 @@ public class GridSelectionControllerExt : GridSelectionController ### Automatic scrolling on Drag Selection -SfDataGrid will scrolls rows and columns automatically when you try to perform the drag selection like in excel. You can enable or disable AutoScrolling by setting the [AutoScroller.AutoScrolling](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AutoScroller.html#Syncfusion_UI_Xaml_Grid_AutoScroller_AutoScrolling) property. +Data Grid will scrolls rows and columns automatically when you try to perform the drag selection like in excel. You can enable or disable AutoScrolling by setting the [AutoScroller.AutoScrolling](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AutoScroller.html#Syncfusion_UI_Xaml_Grid_AutoScroller_AutoScrolling) property. {% tabs %} {% highlight c# %} @@ -955,7 +955,7 @@ Moves the current cell to the last cell of the current row. PageDown -The SfDataGrid will be scrolled to next set of rows that are not displayed in view, including the row that are partially displayed and the current cell is set to last row. +The Data Grid will be scrolled to next set of rows that are not displayed in view, including the row that are partially displayed and the current cell is set to last row. @@ -1622,7 +1622,7 @@ You can get the sample from [here](https://www.syncfusion.com/downloads/support/ ## Customizing Selection Behaviors -The SfDataGrid process the selection operations in selection controller. Below are the built-in selection controllers, +The Data Grid process the selection operations in selection controller. Below are the built-in selection controllers, * [GridSelectionController](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionController.html) – Process selection operations when selection unit as row. @@ -1767,7 +1767,7 @@ public class GridSelectionControllerExt:GridSelectionController ### Selecting the column when clicking header -You can select entire column on clicking column header by handling [MouseLeftButtonUp](https://learn.microsoft.com/en-us/dotnet/api/system.windows.uielement.mouseleftbuttonup?view=windowsdesktop-7.0&viewFallbackFrom=net-5.0) event of SfDataGrid. You have to set [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) as [Cell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionUnit.html) or [Any](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionUnit.html) and [SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode) as [Extended](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionMode.html) or [Multiple](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionMode.html) to achieve this behavior. +You can select entire column on clicking column header by handling [MouseLeftButtonUp](https://learn.microsoft.com/en-us/dotnet/api/system.windows.uielement.mouseleftbuttonup?view=windowsdesktop-7.0&viewFallbackFrom=net-5.0) event of Data Grid. You have to set [SelectionUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SelectionUnit) as [Cell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionUnit.html) or [Any](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionUnit.html) and [SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode) as [Extended](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionMode.html) or [Multiple](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSelectionMode.html) to achieve this behavior. By default the sorting operation will be performed while clicking on column header where you can disable this action by setting [AllowSorting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowSorting) as false or [SortClickAction](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SortClickAction) as [DoubleClick](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SortClickAction.html). @@ -1881,7 +1881,7 @@ public class GridSelectionControllerExt : GridSelectionController [How to clear selection while grouping/ungrouping?](https://support.syncfusion.com/kb/article/6161/how-to-clear-the-selection-while-grouping-or-ungrouping-in-wpf-datagrid-sfdatagrid) -[How to search and select record in SfDataGrid?](https://support.syncfusion.com/kb/article/6187/how-to-search-and-select-record-in-wpf-datagrid-sfdatagrid) +[How to search and select record in Data Grid?](https://support.syncfusion.com/kb/article/6187/how-to-search-and-select-record-in-wpf-datagrid-sfdatagrid) [How to read cell values from SelectedItems?](https://support.syncfusion.com/kb/article/6001/how-to-read-cell-values-from-selecteditems-in-wpf-datagrid) @@ -1889,38 +1889,38 @@ public class GridSelectionControllerExt : GridSelectionController [How to move selection to newly added record using AddNewRow?](https://support.syncfusion.com/kb/article/5596/how-to-move-newly-added-records-in-wpf-datagrid) -[How to paste the data by custom column order instead of the first column in the SfDataGrid when SelectionUnit is a Row?](https://support.syncfusion.com/kb/article/5159/how-to-paste-the-data-by-custom-column-order-instead-of-the-first-column-in-the-sfdatagrid) +[How to paste the data by custom column order instead of the first column in the Data Grid when SelectionUnit is a Row?](https://support.syncfusion.com/kb/article/5159/how-to-paste-the-data-by-custom-column-order-instead-of-the-first-column-in-the-sfdatagrid) [How to remove the top-right corner error mark from the GridCell by pressing Esc key when validated by handling the CurrentCellValidating event?](https://support.syncfusion.com/kb/article/5019/how-to-remove-the-top-right-corner-error-mark-from-the-gridcell-in-wpf-datagrid) [How to programmatically select the records of the Master-DetailsView at run time?](https://support.syncfusion.com/kb/article/5079/how-to-programmatically-select-the-records-of-the-master-detailsview-at-run-time-in-wpf-) -[How to accomplish RecordNavigationBar in the SfDataGrid like Syncfusion® Windows Forms DataBoundGrid?](https://support.syncfusion.com/kb/article/5122/how-to-accomplish-recordnavigationbar-in-the-wpf-sfdatagrid-like-syncfusion-windowsforms-databoundgrid) +[How to accomplish RecordNavigationBar in the Data Grid like Syncfusion® Windows Forms DataBoundGrid?](https://support.syncfusion.com/kb/article/5122/how-to-accomplish-recordnavigationbar-in-the-wpf-sfdatagrid-like-syncfusion-windowsforms-databoundgrid) -[How to select the entire column in SfDataGrid ?](https://support.syncfusion.com/kb/article/4862/how-to-select-the-entire-column-in-sfdatagrid) +[How to select the entire column](https://support.syncfusion.com/kb/article/4862/how-to-select-the-entire-column-in-sfdatagrid) -[How to move the CurrentCell to the first column of the AddNewRow when the Tab key is pressed from the last column and its position is at the Bottom of the SfDataGrid?](https://support.syncfusion.com/kb/article/4551/how-to-move-the-currentcell-to-the-first-column-in-wpf-datagrid) +[How to move the CurrentCell to the first column of the AddNewRow when the Tab key is pressed from the last column and its position is at the Bottom of the Data Grid?](https://support.syncfusion.com/kb/article/4551/how-to-move-the-currentcell-to-the-first-column-in-wpf-datagrid) -[How to navigate the current cell within the selected ranges as in Excel, while pressing Enter or Tab key in SfDataGrid?](https://support.syncfusion.com/kb/article/4491/how-to-navigate-the-current-cell-within-the-selected-ranges-as-in-excel-while-pressing) +[How to navigate the current cell within the selected ranges as in Excel, while pressing Enter or Tab key in Data Grid?](https://support.syncfusion.com/kb/article/4491/how-to-navigate-the-current-cell-within-the-selected-ranges-as-in-excel-while-pressing) [How to add selection to data rows of each group on expanding its CaptionSummaryRow?](https://support.syncfusion.com/kb/article/4115/how-to-add-selection-to-data-rows-of-each-group-on-expanding-its-captionsummaryrow-in-wpf-grid-) -[How to change the Enter key behavior in SfDataGrid?](https://support.syncfusion.com/kb/article/3830/how-to-change-the-enter-key-behavior-in-sfdatagrid) +[How to change the Enter key behavior in Data Grid?](https://support.syncfusion.com/kb/article/3830/how-to-change-the-enter-key-behavior-in-sfdatagrid) [How to change the Enter key behavior to insert line break when the CurrentCell is in the edit mode?](https://support.syncfusion.com/kb/article/3874/how-to-change-the-enter-key-behavior-to-insert-line-break-when-the-currentcell-is-in-the-edit-mode-for-wpf-grid) -[How to show the selection of row/cell when setting the background for SfDataGrid GridCell?](https://support.syncfusion.com/kb/article/3268/how-to-show-the-selection-of-rowcell-when-setting-the-background-for-sfdatagrid-gridcell-in-wpf-) +[How to show the selection of row/cell when setting the background for Data Grid GridCell?](https://support.syncfusion.com/kb/article/3268/how-to-show-the-selection-of-rowcell-when-setting-the-background-for-sfdatagrid-gridcell-in-wpf-) [How to set Border for the Selected Rows?](https://support.syncfusion.com/kb/article/3505/how-to-set-border-for-the-selected-rows-in-wpf-datagrid-) -[How to bind the SelectedItems property of SfDataGrid to ViewModel property?](https://support.syncfusion.com/kb/article/3392/how-to-bind-the-selecteditems-property-to-viewmodel-property-in-wpf-datagrid) +[How to bind the SelectedItems property of Data Grid to ViewModel property?](https://support.syncfusion.com/kb/article/3392/how-to-bind-the-selecteditems-property-to-viewmodel-property-in-wpf-datagrid) [How to get information from the selected cells when using cell selection?](https://support.syncfusion.com/kb/article/3053/how-to-get-information-from-the-selected-cells-when-using-cell-selection) -[How to avoid selection while grouping and ungrouping in SfDataGrid?](https://support.syncfusion.com/kb/article/2809/how-to-avoid-selection-while-grouping-and-ungrouping-in-sfdatagrid) +[How to avoid selection while grouping and ungrouping](https://support.syncfusion.com/kb/article/2809/how-to-avoid-selection-while-grouping-and-ungrouping-in-sfdatagrid) [How to change the background and foreground for the selected row or cell?](https://support.syncfusion.com/kb/article/2902/how-to-change-the-background-and-foreground-for-the-selected-row-or-cell-in-wpf-datagrid) [How to set current cell on particular row when DataGrid loaded?](https://support.syncfusion.com/kb/article/2796/how-to-set-current-cell-on-particular-row-when-datagrid-loaded) -[How to select the multiple rows on the SfDataGrid?](https://support.syncfusion.com/kb/article/2884/how-to-select-the-multiple-rows-on-the-wpf-sfdatagrid-) +[How to select the multiple rows](https://support.syncfusion.com/kb/article/2884/how-to-select-the-multiple-rows-on-the-wpf-sfdatagrid-) diff --git a/wpf/DataGrid/Serialization-and-Deserialization.md b/wpf/DataGrid/Serialization-and-Deserialization.md index 370ae2818..30a037902 100644 --- a/wpf/DataGrid/Serialization-and-Deserialization.md +++ b/wpf/DataGrid/Serialization-and-Deserialization.md @@ -9,10 +9,10 @@ documentation: ug # Serialization and Deserialization in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to serialize and deserialize the SfDataGrid settings using [DataContractSerializer](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.datacontractserializer?view=net-8.0). +[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to serialize and deserialize the Data Grid settings using [DataContractSerializer](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.datacontractserializer?view=net-8.0). ## Serialization -You can serialize the SfDataGrid by using [SfDataGrid.Serialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Serialize_System_IO_Stream_) method which exports the current DataGrid control properties to an XML file. +You can serialize the Data Grid by using [SfDataGrid.Serialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Serialize_System_IO_Stream_) method which exports the current DataGrid control properties to an XML file. {% tabs %} {% highlight c# %} @@ -26,7 +26,7 @@ using (var file = File.Create("DataGrid.xml")) ### Serialize as Stream -You can store the SfDataGrid settings as [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-8.0) using [Serialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Serialize_System_IO_Stream_) method by passing the stream. +You can store the Data Grid settings as [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-8.0) using [Serialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Serialize_System_IO_Stream_) method by passing the stream. {% tabs %} {% highlight c# %} @@ -38,12 +38,12 @@ this.dataGrid.Serialize(stream); ## Serialization options -SfDataGrid serialization operation can be customized by passing [SerializationOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html) instance as an argument to [Serialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Serialize_System_IO_Stream_Syncfusion_UI_Xaml_Grid_SerializationOptions_) method. +Data Grid serialization operation can be customized by passing [SerializationOptions](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html) instance as an argument to [Serialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Serialize_System_IO_Stream_Syncfusion_UI_Xaml_Grid_SerializationOptions_) method. ### Serialize sorting -By default, SfDataGrid allows you to serialize the sorting operation. You can disable the sorting serialization by setting the [SerializationOptions.SerializeSorting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeSorting) to `false`. +By default, Data Grid allows you to serialize the sorting operation. You can disable the sorting serialization by setting the [SerializationOptions.SerializeSorting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeSorting) to `false`. {% tabs %} {% highlight c# %} @@ -58,7 +58,7 @@ using (var file = File.Create("DataGrid.xml")) ### Serialize grouping -By default, SfDataGrid allows you to serialize the grouping operation. You can disable the grouping serialization by setting the [SerializationOptions.SerializeGrouping](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeGrouping) to `false`. +By default, Data Grid allows you to serialize the grouping operation. You can disable the grouping serialization by setting the [SerializationOptions.SerializeGrouping](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeGrouping) to `false`. {% tabs %} {% highlight c# %} @@ -73,7 +73,7 @@ using (var file = File.Create("DataGrid.xml")) ### Serialize filtering -By default, SfDataGrid allows you to serialize the filtering operation. You can disable the filtering serialization by setting the [SerializationOptions.SerializeFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeFiltering) to `false`. +By default, Data Grid allows you to serialize the filtering operation. You can disable the filtering serialization by setting the [SerializationOptions.SerializeFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeFiltering) to `false`. {% tabs %} {% highlight c# %} @@ -88,7 +88,7 @@ using (var file = File.Create("DataGrid.xml")) ### Serialize columns -By default, SfDataGrid allows you to serialize the columns manipulation operation. You can disable the columns serialization by setting the [SerializationOptions.SerializeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeColumns) to `false`. +By default, Data Grid allows you to serialize the columns manipulation operation. You can disable the columns serialization by setting the [SerializationOptions.SerializeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeColumns) to `false`. {% tabs %} {% highlight c# %} @@ -103,7 +103,7 @@ using (var file = File.Create("DataGrid.xml")) ### Serialize summaries -By default, SfDataGrid allows you to serialize the caption summary, group summary and table summary settings in SfDataGrid. +By default, Data Grid allows you to serialize the caption summary, group summary and table summary settings in the control. You can disable the summaries serialization by setting [SerializationOptions.SerializeCaptionSummary](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeCaptionSummary) , [SerializationOptions.SerializeGroupSummaries](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeGroupSummaries) , [SerializationOptions.SerializeTableSummaries](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeTableSummaries) properties to `false` @@ -122,7 +122,7 @@ using (var file = File.Create("DataGrid.xml")) ### Serialize stacked headers -By default, SfDataGrid allows you to serialize the stack headers operation. You can disable the stack headers serialization by setting the [SerializationOptions.SerializeStackedHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeStackedHeaders) to `false`. +By default, Data Grid allows you to serialize the stack headers operation. You can disable the stack headers serialization by setting the [SerializationOptions.SerializeStackedHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeStackedHeaders) to `false`. {% tabs %} {% highlight c# %} @@ -138,7 +138,7 @@ using (var file = File.Create("DataGrid.xml")) ### Serialize Details View -By default, SfDataGrid allows you to serialize the DetailsViewDefinition. You can disable the DetailsViewDefinition serialization by setting the [SerializationOptions.SerializeDetailsViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeDetailsViewDefinition) to `false`. +By default, Data Grid allows you to serialize the DetailsViewDefinition. You can disable the DetailsViewDefinition serialization by setting the [SerializationOptions.SerializeDetailsViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeDetailsViewDefinition) to `false`. {% tabs %} {% highlight c# %} @@ -153,7 +153,7 @@ using (var file = File.Create("DataGrid.xml")) ### Serialize unbound rows -By default, SfDataGrid allows you to serialize the unbound rows settings. You can disable the unbound rows serialization by setting the [SerializationOptions.SerializeUnBoundRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeUnBoundRows) to `false`. +By default, Data Grid allows you to serialize the unbound rows settings. You can disable the unbound rows serialization by setting the [SerializationOptions.SerializeUnBoundRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationOptions.html#Syncfusion_UI_Xaml_Grid_SerializationOptions_SerializeUnBoundRows) to `false`. {% tabs %} {% highlight c# %} @@ -168,7 +168,7 @@ using (var file = File.Create("DataGrid.xml")) ## Deserialization -You can deserialize the SfDataGrid setting by using [SfDataGrid.Deserialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Deserialize_System_IO_Stream_) method which reconstructs the SfDataGrid based on the setting in the stored XML file. +You can deserialize the Data Grid setting by using [SfDataGrid.Deserialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Deserialize_System_IO_Stream_) method which reconstructs the control based on the setting in the stored XML file. {% tabs %} {% highlight c# %} @@ -181,7 +181,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ### Deserialize from Stream -You can deserialize the SfDataGrid settings from [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-8.0) using [Deserialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Deserialize_System_IO_Stream_) method. +You can deserialize the Data Grid settings from [Stream](https://learn.microsoft.com/en-us/dotnet/api/system.io.stream?view=net-8.0) using [Deserialize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_Deserialize_System_IO_Stream_) method. {% tabs %} {% highlight c# %} @@ -196,7 +196,7 @@ Deserialization operation can be customized by passing [DeserializationOptions]( ### Deserialize sorting -By default, SfDataGrid allows you to deserialize the sorting operation. You can disable the sorting deserialization by setting the [DeserializationOptions.DeserializeSorting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeSorting) to `false`. +By default, Data Grid allows you to deserialize the sorting operation. You can disable the sorting deserialization by setting the [DeserializationOptions.DeserializeSorting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeSorting) to `false`. {% tabs %} {% highlight c# %} @@ -211,7 +211,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ### Deserialize grouping -By default, SfDataGrid allows you to deserialize the grouping operation. You can disable the grouping deserialization by setting the [DeserializationOptions.DeserializeGrouping](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeGrouping) to `false`. +By default, Data Grid allows you to deserialize the grouping operation. You can disable the grouping deserialization by setting the [DeserializationOptions.DeserializeGrouping](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeGrouping) to `false`. {% tabs %} {% highlight c# %} @@ -226,7 +226,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ### Deserialize filtering -By default, SfDataGrid allows you to deserialize the filtering. you can disable the filtering deserialization by setting [DeserializationOptions.DeserializeFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeFiltering) to `false`. +By default, Data Grid allows you to deserialize the filtering. you can disable the filtering deserialization by setting [DeserializationOptions.DeserializeFiltering](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeFiltering) to `false`. {% tabs %} {% highlight c# %} @@ -241,7 +241,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ### Deserialize columns -By default, SfDataGrid allows you to deserialize the columns manipulation operations. You can disable the columns deserialization by setting the [DeserializationOptions.DeserializeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeColumns) to `false`. +By default, Data Grid allows you to deserialize the columns manipulation operations. You can disable the columns deserialization by setting the [DeserializationOptions.DeserializeColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeColumns) to `false`. {% tabs %} {% highlight c# %} @@ -256,7 +256,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ### Deserialize summaries -By default, SfDataGrid allows you to deserialize the group summary, caption summary and table summary settings. +By default, Data Grid allows you to deserialize the group summary, caption summary and table summary settings. You can disable the summaries deserialization by setting [DeserializationOptions.DeserializeCaptionSummary](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeCaptionSummary) , [DeserializationOptions.DeserializeGroupSummaries](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeGroupSummaries) , [DeserializationOptions.DeserializeTableSummaries](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeTableSummaries) properties to `false`. @@ -275,7 +275,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ### Deserialize stacked headers -By default, SfDataGrid allows you to deserialize the stack headers. You can disable the stacked headers deserialization by setting the [DeserializationOptions.DeserializeStackedHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeStackedHeaders) to `false`. +By default, Data Grid allows you to deserialize the stack headers. You can disable the stacked headers deserialization by setting the [DeserializationOptions.DeserializeStackedHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeStackedHeaders) to `false`. {% tabs %} {% highlight c# %} @@ -290,7 +290,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ### Deserialize Details View -By default, SfDataGrid allows you to deserialize the DetailsViewDefinition. You can disable the DetailsViewDefinition deserialization by setting the [DeserializationOptions.DeserializeDetailsViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeDetailsViewDefinition) to `false`. +By default, Data Grid allows you to deserialize the DetailsViewDefinition. You can disable the DetailsViewDefinition deserialization by setting the [DeserializationOptions.DeserializeDetailsViewDefinition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeDetailsViewDefinition) to `false`. {% tabs %} {% highlight c# %} @@ -305,7 +305,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ### Deserialize unbound rows -By default, SfDataGrid allows you to deserialize the unbound rows settings. You can disable the unbound rows deserialization by setting the [DeserializationOptions.DeserializeUnBoundRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeUnBoundRows) to `false`. +By default, Data Grid allows you to deserialize the unbound rows settings. You can disable the unbound rows deserialization by setting the [DeserializationOptions.DeserializeUnBoundRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DeserializationOptions.html#Syncfusion_UI_Xaml_Grid_DeserializationOptions_DeserializeUnBoundRows) to `false`. {% tabs %} {% highlight c# %} @@ -320,7 +320,7 @@ using (var file = File.Open("DataGrid.xml", FileMode.Open)) ## Customizing Serialization and Deserialization Operations -SfDataGrid allows you to customize the serialization and deserialization operations by deriving [SerializationController](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationController.html) class and override the necessary virtual methods. +Data Grid allows you to customize the serialization and deserialization operations by deriving [SerializationController](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SerializationController.html) class and override the necessary virtual methods. ### Serialize custom column @@ -359,7 +359,7 @@ typeof(string), typeof(DatePickerColumn)); {% endhighlight %} {% endtabs %} -In the below code snippet, the DatePickerColumn is defined in SfDataGrid. +In the below code snippet, the DatePickerColumn is defined in the control. {% tabs %} {% highlight xaml %} @@ -552,7 +552,7 @@ You can download the sample demo [here](https://www.syncfusion.com/downloads/sup ### Serializing template column content -By default, you cannot serialize the template content in SfDataGrid. This is the default behavior during Serialization and Deserialization operation. +By default, you cannot serialize the template content in Data Grid. This is the default behavior during Serialization and Deserialization operation. {% tabs %} {% highlight xaml %} diff --git a/wpf/DataGrid/Sorting.md b/wpf/DataGrid/Sorting.md index 1d40b6707..661e71754 100644 --- a/wpf/DataGrid/Sorting.md +++ b/wpf/DataGrid/Sorting.md @@ -9,7 +9,7 @@ documentation: ug # Sorting in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) allows you to sort the data against one or more columns either in ascending or descending order. When sorting is applied, the rows are rearranged based on sort criteria. You can allow users to sort the data by touching or clicking the column header using [SfDataGrid.AllowSorting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowSorting) property to `true`. +[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to sort the data against one or more columns either in ascending or descending order. When sorting is applied, the rows are rearranged based on sort criteria. You can allow users to sort the data by touching or clicking the column header using [SfDataGrid.AllowSorting](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_AllowSorting) property to `true`. {% tabs %} {% highlight xaml %} @@ -85,7 +85,7 @@ Following are the sequence of sorting orders when clicking column header, ## Multi column sorting -WPF DataGrid (SfDataGrid) control allows you sort more than one column, where sorting is applied one column against other columns. To apply sorting on multiple columns, user have to click the column header by pressing the Ctrl key. +WPF Data Grid control allows you sort more than one column, where sorting is applied one column against other columns. To apply sorting on multiple columns, user have to click the column header by pressing the Ctrl key. In the below screen shot, the OrderID column sorted. Then the CustomerName column is sorted against the OrderID data by clicking column header by pressing Ctrl key. The sorting state of OrderID column is preserved and CustomerName column sorted against OrderID column. @@ -172,7 +172,7 @@ this.dataGrid.SortColumnDescriptions.Clear(); ## Custom sorting -SfDataGrid allows you to sort the columns based on the custom logic. The custom sorting can be applied by adding the [SortComparer](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.SortComparer.html) instance to [SfDataGrid.SortComparers](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SortComparers). +Data Grid allows you to sort the columns based on the custom logic. The custom sorting can be applied by adding the [SortComparer](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.SortComparer.html) instance to [SfDataGrid.SortComparers](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SortComparers). The [SortComparer](https://help.syncfusion.com/cr/wpf/Syncfusion.Data.SortComparer.html) have the following properties, @@ -253,7 +253,7 @@ public class CustomComparer : IComparer, ISortDirection {% endtabs %} -### Adding custom comparer to SfDataGrid +### Adding custom comparer to Data Grid Custom comparer can be added to [SfDataGrid.SortComparers](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SortComparers) property. `SortComparers` maintains custom comparers and the custom comparer gets called when corresponding column gets sorted by clicking column header or programmatically. @@ -282,7 +282,7 @@ Sorting CustomerName column sorts the data using custom comparer available in `S ## Sorting the underlying collection -SfDataGrid sorts the records in UI and maintains in its internal CollectionView and it will not change the order of data in underlying collection. +Data Grid sorts the records in UI and maintains in its internal CollectionView and it will not change the order of data in underlying collection. You can get sorted data from `SfDataGrid.View.Records` when groups is not in place and `SfDataGrid.View.TopLevelGroup.DisplayElements` when grouping in place. @@ -367,10 +367,10 @@ void dataGrid_SortColumnsChanging(object sender, Syncfusion.UI.Xaml.Grid.GridSor ## See Also [How to sort a column in WPF DataGrid?](https://support.syncfusion.com/kb/article/9555/how-to-sort-a-column-in-wpf-datagrid-sfdatagrid) -[How to customize the Filtering and Sorting icons in the SfDataGrid ?](https://support.syncfusion.com/kb/article/7261/how-to-customize-the-filtering-and-sorting-icons-in-wpf-datagrid-sfdatagrid) +[How to customize the Filtering and Sorting icons?](https://support.syncfusion.com/kb/article/7261/how-to-customize-the-filtering-and-sorting-icons-in-wpf-datagrid-sfdatagrid) -[How to sort multiple column without pressing Ctrl key in SfDataGrid?](https://support.syncfusion.com/kb/article/6625/how-to-sort-multiple-column-without-pressing-ctrl-key-in-wpf-datagrid-sfdatagrid) +[How to sort multiple column without pressing Ctrl key?](https://support.syncfusion.com/kb/article/6625/how-to-sort-multiple-column-without-pressing-ctrl-key-in-wpf-datagrid-sfdatagrid) -[How to change the position of FilterToggleButton and SortIcon in header cell of SfDataGrid?](https://support.syncfusion.com/kb/article/4194/how-to-change-the-position-of-header-cell-in-wpf-datagrid) +[How to change the position of FilterToggleButton and SortIcon in header cell?](https://support.syncfusion.com/kb/article/4194/how-to-change-the-position-of-header-cell-in-wpf-datagrid) [How to sort your binded collection of ViewModel?](https://support.syncfusion.com/kb/article/2850/how-to-sort-your-binded-collection-of-viewmodel-in-wpf-datagrid) diff --git a/wpf/DataGrid/Styles-and-Templates.md b/wpf/DataGrid/Styles-and-Templates.md index 8ec0a6b0f..31f869300 100644 --- a/wpf/DataGrid/Styles-and-Templates.md +++ b/wpf/DataGrid/Styles-and-Templates.md @@ -9,18 +9,18 @@ documentation: ug # Styles and Templates in WPF Data Grid -The appearance of [WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) and its inner elements (example: Cell, Row, Header, Summary etc.) can be customized using various properties exposed and by editing the elements’ Style. +The appearance of [WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) and its inner elements (example: Cell, Row, Header, Summary etc.) can be customized using various properties exposed and by editing the elements’ Style. -## Control Structure of SfDataGrid +## Control Structure of Data Grid -![Control structure of WPF DataGrid](styles-and-templates_images/wpf-datagrid-structure.png) +![Control structure of WPF Data Grid](styles-and-templates_images/wpf-datagrid-structure.png) ## Customizing Default Containers -WPF DataGrid (SfDataGrid) arranges the cell and row content using cell and row containers. Below screenshot shows the `VisualTree` of SfDataGrid where `HeaderCell` is loaded into the `HeaderCellControl` and data cells are loaded into the [VirtualizingCellsControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.VirtualizingCellsControl.html) container. `VirtualizingCellsControl` container uses [GridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCell.html) to load the cell content. +WPF Data Grid arranges the cell and row content using cell and row containers. Below screenshot shows the `VisualTree` of Data Grid where `HeaderCell` is loaded into the `HeaderCellControl` and data cells are loaded into the [VirtualizingCellsControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.VirtualizingCellsControl.html) container. `VirtualizingCellsControl` container uses [GridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCell.html) to load the cell content. ![Tree Structure of WPF DataGrid](styles-and-templates_images/wpf-datagrid-tree-structure.png) -[RowGenerator](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowGenerator.html) class processes the creation and re-using of containers for SfDataGrid. You create your own containers by overriding `RowGenerator` class and setting it to [SfDataGrid.RowGenerator](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RowGenerator). Using this method to customize the row and cell containers allows for customizations that aren’t possible through styling and conditional styling. +[RowGenerator](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.RowGenerator.html) class processes the creation and re-using of containers for Data Grid. You create your own containers by overriding `RowGenerator` class and setting it to [SfDataGrid.RowGenerator](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RowGenerator). Using this method to customize the row and cell containers allows for customizations that aren’t possible through styling and conditional styling. ### Row containers Below table shows the different types of grid rows and its container. @@ -347,19 +347,19 @@ You can download a working demo for the above customization from [here](https:// ## Editing Style in Visual Studio Designer -You can edit the SfDataGrid style in Visual Studio Designer by right clicking it in design View and click **Edit Template**. +You can edit the Data Grid style in Visual Studio Designer by right clicking it in design View and click **Edit Template**. ![WPF DataGrid displays Editing Style in Visual Studio Designer](styles-and-templates_images/wpf-datagrid-editing-style.png) -By clicking **Edit a Copy**, it will generate default template of SfDataGrid in **XAML view** and you can edit the default style. +By clicking **Edit a Copy**, it will generate default template of Data Grid in **XAML view** and you can edit the default style. ## Editing DataGrid Elements Style in Visual Studio Designer -You can edit the SfDataGrid elements style in Visual Studio Designer by right clicking it in designer view and click **Edit Additional Templates**. +You can edit the Data Grid elements style in Visual Studio Designer by right clicking it in designer view and click **Edit Additional Templates**. ![WPF DataGrid displays Editing Elements in Visual Studio Designer](styles-and-templates_images/wpf-datagrid-edit-templates.png) -You can edit or create new style for the following SfDataGrid elements through **Edit Additional Templates** option, +You can edit or create new style for the following Data Grid elements through **Edit Additional Templates** option, 1. HeaderStyle 2. HeaderTemplate @@ -386,7 +386,7 @@ The appearance of WPF DataGrid (SfDataGrid) and its inner elements can be custom ## Styling Record cell -The record cells can be customized by writing style of TargetType [GridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCell.html). You can set to particular SfDataGrid by setting [SfDataGrid.CellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CellStyle) property and the particular column can be styled by setting [GridColumn.CellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_CellStyle) property. Underlying record will be the DataContext for `GridCell`. +The record cells can be customized by writing style of TargetType [GridCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCell.html). You can set to particular Data Grid by setting [SfDataGrid.CellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CellStyle) property and the particular column can be styled by setting [GridColumn.CellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_CellStyle) property. Underlying record will be the DataContext for `GridCell`. {% tabs %} {% highlight xaml %} @@ -472,7 +472,7 @@ You can also change the gridline color by setting [GridCell.BorderBrush](https:/ ## Styling Record row -The record rows can be customized by writing style of TargetType [VirtualizingCellsControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.VirtualizingCellsControl.html). You can set to particular SfDataGrid by setting [SfDataGrid.RowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RowStyle) property. +The record rows can be customized by writing style of TargetType [VirtualizingCellsControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.VirtualizingCellsControl.html). You can set to particular Data Grid by setting [SfDataGrid.RowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RowStyle) property. {% tabs %} {% highlight xaml %} @@ -534,7 +534,7 @@ The foreground and background for the selected row, cell can be customized by se ### Styling Header cell -The header cell can be customized by writing style of TargetType [GridHeaderCellControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridHeaderCellControl.html). You can set to particular SfDataGrid by setting [SfDataGrid.HeaderStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_HeaderStyle) property and the particular column can be styled by setting [GridColumn.HeaderStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_HeaderStyle) property. +The header cell can be customized by writing style of TargetType [GridHeaderCellControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridHeaderCellControl.html). You can set to particular Data Grid by setting [SfDataGrid.HeaderStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_HeaderStyle) property and the particular column can be styled by setting [GridColumn.HeaderStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_HeaderStyle) property. N> `GridColumn.HeaderStyle` takes higher priority than `SfDataGrid.HeaderStyle` property. @@ -704,7 +704,7 @@ this.dataGrid.Columns["OrderID"].CellStyle = null; ### Styling CaptionSummary cells -The caption summary cells can be customized by writing style of TargetType [GridCaptionSummaryCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCaptionSummaryCell.html). You can set to particular SfDataGrid by setting [SfDataGrid.CaptionSummaryCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CaptionSummaryCellStyle) property. +The caption summary cells can be customized by writing style of TargetType [GridCaptionSummaryCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridCaptionSummaryCell.html). You can set to particular Data Grid by setting [SfDataGrid.CaptionSummaryCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CaptionSummaryCellStyle) property. {% tabs %} {% highlight xaml %} @@ -728,7 +728,7 @@ The caption summary cells can be customized by writing style of TargetType [Grid ### Styling CaptionSummary rows -The caption summary rows can be customized by writing style of TargetType [GridCaptionSummaryRowControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CaptionSummaryRowControl.html). You can set to particular SfDataGrid by setting [SfDataGrid.CaptionSummaryRowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CaptionSummaryRowStyle) property. +The caption summary rows can be customized by writing style of TargetType [GridCaptionSummaryRowControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.CaptionSummaryRowControl.html). You can set to particular Data Grid by setting [SfDataGrid.CaptionSummaryRowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_CaptionSummaryRowStyle) property. {% tabs %} {% highlight xaml %} @@ -754,7 +754,7 @@ The caption summary rows can be customized by writing style of TargetType [GridC ### Styling GroupSummary cells -The group summary cells can be customized by writing style of TargetType [GridGroupSummaryCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridGroupSummaryCell.html). You can set to particular SfDataGrid by setting [SfDataGrid.GroupSummaryCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupSummaryCellStyle) property. +The group summary cells can be customized by writing style of TargetType [GridGroupSummaryCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridGroupSummaryCell.html). You can set to particular Data Grid by setting [SfDataGrid.GroupSummaryCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupSummaryCellStyle) property. {% tabs %} {% highlight xaml %} @@ -778,7 +778,7 @@ The group summary cells can be customized by writing style of TargetType [GridGr ### Styling GroupSummary rows -The group summary rows can be customized by writing style of TargetType [GridGroupSummaryRowControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GroupSummaryRowControl.html). You can set to particular SfDataGrid by setting [SfDataGrid.GroupSummaryRowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupSummaryRowStyle) property. +The group summary rows can be customized by writing style of TargetType [GridGroupSummaryRowControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GroupSummaryRowControl.html). You can set to particular Data Grid by setting [SfDataGrid.GroupSummaryRowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupSummaryRowStyle) property. {% tabs %} {% highlight xaml %} @@ -801,7 +801,7 @@ The group summary rows can be customized by writing style of TargetType [GridGro ### Styling TableSummary cells -The table summary cells can be customized by writing style of TargetType [GridTableSummaryCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridTableSummaryCell.html). You can set to particular SfDataGrid by setting [SfDataGrid.TableSummaryCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_TableSummaryCellStyle) property. +The table summary cells can be customized by writing style of TargetType [GridTableSummaryCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridTableSummaryCell.html). You can set to particular Data Grid by setting [SfDataGrid.TableSummaryCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_TableSummaryCellStyle) property. {% tabs %} {% highlight xaml %} @@ -823,7 +823,7 @@ The table summary cells can be customized by writing style of TargetType [GridTa ### Styling TableSummary rows -The table summary rows can be customized by writing style of TargetType [GridTableSummaryRowControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TableSummaryRowControl.html). You can set to particular SfDataGrid by setting [SfDataGrid.TableSummaryRowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_TableSummaryRowStyle) property. +The table summary rows can be customized by writing style of TargetType [GridTableSummaryRowControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.TableSummaryRowControl.html). You can set to particular Data Grid by setting [SfDataGrid.TableSummaryRowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_TableSummaryRowStyle) property. {% tabs %} {% highlight xaml %} @@ -845,7 +845,7 @@ The table summary rows can be customized by writing style of TargetType [GridTab ### Styling unbound row cells -The unbound row cells can be customized by writing style of TargetType [GridUnBoundRowCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRowCell.html). You can set to particular SfDataGrid by setting [SfDataGrid.UnBoundRowCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_UnBoundRowCellStyle) property. +The unbound row cells can be customized by writing style of TargetType [GridUnBoundRowCell](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRowCell.html). You can set to particular Data Grid by setting [SfDataGrid.UnBoundRowCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_UnBoundRowCellStyle) property. {% tabs %} {% highlight xaml %} @@ -863,7 +863,7 @@ The unbound row cells can be customized by writing style of TargetType [GridUnBo ### Styling unbound row -The unbound rows can be customized by writing style of TargetType [UnBoundRowControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.UnBoundRowControl.html). You can set to particular SfDataGrid by setting [SfDataGrid.UnBoundRowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_UnBoundRowStyle) property. +The unbound rows can be customized by writing style of TargetType [UnBoundRowControl](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.UnBoundRowControl.html). You can set to particular Data Grid by setting [SfDataGrid.UnBoundRowStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_UnBoundRowStyle) property. {% tabs %} {% highlight xaml %} @@ -955,7 +955,7 @@ You can also display the row index value in the row header cell by customizing i ## Template Selectors -The [DataTemplateSelectors](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.datatemplateselector?view=windowsdesktop-7.0) can be used to set the custom templates to the cell or rows based on the data. You can set to particular SfDataGrid by setting [SfDataGrid.CellTemplateSelector](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_CellTemplateSelector) and the template can be set to particular column by setting [GridColumn.CellTemplateSelector](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_CellTemplateSelector). +The [DataTemplateSelectors](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.datatemplateselector?view=windowsdesktop-7.0) can be used to set the custom templates to the cell or rows based on the data. You can set to particular Data Grid by setting [SfDataGrid.CellTemplateSelector](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_CellTemplateSelector) and the template can be set to particular column by setting [GridColumn.CellTemplateSelector](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_CellTemplateSelector). Here, custom template applied to `TotalPrice` and `CustomerID` columns. @@ -1008,7 +1008,7 @@ public class GridCellTemplateSelector : DataTemplateSelector ### Changing HeaderTemplates -You can customize the appearance of particular SfDataGrid column header by setting [SfDataGrid.HeaderTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_HeaderTemplate) and the particular column header can be customized by setting [GridColumn.HeaderTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_HeaderTemplate). +You can customize the appearance of particular Data Grid column header by setting [SfDataGrid.HeaderTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_HeaderTemplate) and the particular column header can be customized by setting [GridColumn.HeaderTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnBase.html#Syncfusion_UI_Xaml_Grid_GridColumnBase_HeaderTemplate). {% tabs %} {% highlight xaml %} @@ -1086,7 +1086,7 @@ public class GridCellEditTemplateSelector : DataTemplateSelector ## Styling DetailsViewDataGrid -The appearance of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) can be customized by writing style of TargetType `DetailsViewDataGrid`. You can set to particular SfDataGrid by setting [SfDataGrid.DetailsViewDataGridStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_DetailsViewDataGridStyle) property. +The appearance of [DetailsViewDataGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.DetailsViewDataGrid.html) can be customized by writing style of TargetType `DetailsViewDataGrid`. You can set to particular Data Grid by setting [SfDataGrid.DetailsViewDataGridStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_DetailsViewDataGridStyle) property. {% tabs %} {% highlight xaml %} diff --git a/wpf/DataGrid/Summaries.md b/wpf/DataGrid/Summaries.md index 87a681e91..e151f1836 100644 --- a/wpf/DataGrid/Summaries.md +++ b/wpf/DataGrid/Summaries.md @@ -10,9 +10,9 @@ documentation: ug # Summaries in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to display the concise information about the data objects using summaries. SfDataGrid provides below three different types of summary rows. +[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) provides support to display the concise information about the data objects using summaries. Data Grid provides below three different types of summary rows. -* **Table Summary** – Used to display summary information of table either at top or bottom of SfDataGrid. +* **Table Summary** – Used to display summary information of table either at top or bottom of Data Grid. * **Group Summary** – used to display summary information of data objects in each group. @@ -24,9 +24,9 @@ Summary rows are represented by using [GridSummaryRow](https://help.syncfusion.c ## Table Summary -The table summary calculates the summary value over all the records. SfDataGrid allows you to add any number of table summary rows in top and bottom of SfDataGrid. +The table summary calculates the summary value over all the records. Data Grid allows you to add any number of table summary rows in top and bottom of the control. -You can add table summary row in SfDataGrid by adding [GridTableSummaryRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridTableSummaryRow.html) to [SfDataGrid.TableSummaryRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_TableSummaryRows) collection. +You can add table summary row in Data Grid by adding [GridTableSummaryRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridTableSummaryRow.html) to [SfDataGrid.TableSummaryRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_TableSummaryRows) collection. ### Defining summary for column @@ -34,7 +34,7 @@ You can display summary information in the column by setting [GridSummaryRow.Sho 1. [GridSummaryColumn.MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_MappingName) – MappingName of the column (Property name of data object) that you want calculate summary. -2. [GridSummaryColumn.SummaryType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_SummaryType) – SfDataGrid provides different built-in summary calculation functions for various types. +2. [GridSummaryColumn.SummaryType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_SummaryType) – Data Grid provides different built-in summary calculation functions for various types. 3. [GridSummaryColumn.Format](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_Format) – Used to define format string for summary based on support function name’s in specified SummaryType. @@ -411,7 +411,7 @@ public class TemplateSelector : DataTemplateSelector ### Displaying column summary with title -SfDataGrid supports to show column summary and title summary at the same time. You can show column summary along with title by defining the [GridSummaryRow.Title](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_Title) and [GridSummaryRow.TitleColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_TitleColumnCount) property along with defining summary columns. Showing column summary along with title can be only supported if [GridSummaryRow.ShowSummaryInRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_ShowSummaryInRow) is disabled. +The Data Grid supports to show column summary and title summary at the same time. You can show column summary along with title by defining the [GridSummaryRow.Title](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_Title) and [GridSummaryRow.TitleColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_TitleColumnCount) property along with defining summary columns. Showing column summary along with title can be only supported if [GridSummaryRow.ShowSummaryInRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_ShowSummaryInRow) is disabled. Refer [Defining summary for column](#defining-summary-for-column) section to know more about how to define summary columns. @@ -636,7 +636,7 @@ The template for column summary can also be displayed with title template based ### Positioning TableSummaryRow -You can position the table summary either at top or bottom of SfDataGrid by setting [GridTableSummaryRow.Position](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridTableSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridTableSummaryRow_Position) property. +You can position the table summary either at top or bottom of Data Grid by setting [GridTableSummaryRow.Position](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridTableSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridTableSummaryRow_Position) property. {% tabs %} {% highlight xaml %} @@ -716,9 +716,9 @@ this.dataGrid.TableSummaryRows.Add(tablesummaryrow2); ## Group Summary -Group summary values calculated based on the records in the group and the summary information will be displayed at the bottom of each group. You can view the group summary row by expanding the corresponding group header. SfDataGrid allows you to add any number of group summary rows. +Group summary values calculated based on the records in the group and the summary information will be displayed at the bottom of each group. You can view the group summary row by expanding the corresponding group header. Data Grid allows you to add any number of group summary rows. -You can add the group summary rows in SfDataGrid by adding the [GridSummaryRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html) to [SfDataGrid.GroupSummaryRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupSummaryRowsProperty) collection. +You can add the group summary rows in Data Grid by adding the [GridSummaryRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html) to [SfDataGrid.GroupSummaryRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_GroupSummaryRowsProperty) collection. ### Defining summary for column @@ -726,7 +726,7 @@ You can display summary information in the column by setting [GridSummaryRow.Sho 1. [GridSummaryColumn.MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_MappingName) – MappingName of the column (Property name of data object) that you want calculate summary. -2. [GridSummaryColumn.SummaryType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_SummaryType) – SfDataGrid provides different built-in summary calculation functions for various types. +2. [GridSummaryColumn.SummaryType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_SummaryType) – Data Grid provides different built-in summary calculation functions for various types. 3. [GridSummaryColumn.Format](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_Format) – Used to define format string for summary based on support function name’s in specified SummaryType. @@ -1107,7 +1107,7 @@ public class TemplateSelector : DataTemplateSelector ### Displaying column summary with title -SfDataGrid supports to show column summary and title summary at the same time. You can show column summary along with title by defining the [GridSummaryRow.Title](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_Title) and [GridSummaryRow.TitleColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_TitleColumnCount) property along with defining summary columns. Showing column summary along with title can be only supported if [GridSummaryRow.ShowSummaryInRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_ShowSummaryInRow) is disabled. +Data Grid supports to show column summary and title summary at the same time. You can show column summary along with title by defining the [GridSummaryRow.Title](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_Title) and [GridSummaryRow.TitleColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_TitleColumnCount) property along with defining summary columns. Showing column summary along with title can be only supported if [GridSummaryRow.ShowSummaryInRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_ShowSummaryInRow) is disabled. Refer [Defining summary for column](#defining-summary-for-column-1) section to know more about how to define summary columns. @@ -1280,7 +1280,7 @@ The template for column summary can also be displayed with title template based ## Caption Summaries -SfDataGrid provides built-in support for caption summaries. The caption summary value calculated based on the records in a group and the summary information will be displayed in the caption of group. +The Data Grid provides built-in support for caption summaries. The caption summary value calculated based on the records in a group and the summary information will be displayed in the caption of group. Below screen shot shows the built-in caption summary of Group. @@ -1322,7 +1322,7 @@ You can display summary information in the column by setting [GridSummaryRow.Sho 1. [GridSummaryColumn.MappingName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_MappingName) – MappingName of the column (Property name of data object) that you want calculate summary. -2. [GridSummaryColumn.SummaryType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_SummaryType) – SfDataGrid provides different built-in summary calculation functions for various types. +2. [GridSummaryColumn.SummaryType](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_SummaryType) – Data Grid provides different built-in summary calculation functions for various types. 3. [GridSummaryColumn.Format](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_Format) – Used to define format string for summary based on support function name’s in specified SummaryType. @@ -1699,7 +1699,7 @@ public class TemplateSelector : DataTemplateSelector ### Displaying column summary with title -SfDataGrid supports to show column summary and title summary at the same time. You can show column summary along with title by defining the [GridSummaryRow.Title](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_Title) and [GridSummaryRow.TitleColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_TitleColumnCount) property along with defining summary columns. Showing column summary along with title can be only supported if [GridSummaryRow.ShowSummaryInRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_ShowSummaryInRow) is disabled. +The Data Grid supports to show column summary and title summary at the same time. You can show column summary along with title by defining the [GridSummaryRow.Title](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_Title) and [GridSummaryRow.TitleColumnCount](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_TitleColumnCount) property along with defining summary columns. Showing column summary along with title can be only supported if [GridSummaryRow.ShowSummaryInRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_ShowSummaryInRow) is disabled. Refer [Defining summary for column](#defining-summary-for-column-2) section to know more about how to define summary columns. @@ -2041,7 +2041,7 @@ Used for custom summaries ## Calculate summary for selected rows -SfDataGrid calculates the summaries for all records by default. You can calculate the summaries for selected records by using the [SfDataGrid.SummaryCalculationUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SummaryCalculationUnit) or [GridSummaryRow.CalculationUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_CalculationUnit) property. +The Data Grid calculates the summaries for all records by default. You can calculate the summaries for selected records by using the [SfDataGrid.SummaryCalculationUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_SummaryCalculationUnit) or [GridSummaryRow.CalculationUnit](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryRow.html#Syncfusion_UI_Xaml_Grid_GridSummaryRow_CalculationUnit) property. This is applicable for all type of summary rows such as table, caption and group summary. In the below code snippet, the summaries for selected records are calculated for the top positioned `TableSummaryRow` and the summaries for all records are calculated for the bottom positioned `TableSummaryRow`. @@ -2127,7 +2127,7 @@ N> The `GridSummaryRow.CalculationUnit` takes higher priority than the `SfDataGr ## Custom summaries -SfDataGrid allows you to implement your own aggregate functions, when the built-in aggregate functions don’t meet your requirement. +The Data Grid allows you to implement your own aggregate functions, when the built-in aggregate functions don’t meet your requirement. You can calculate the summary values based on custom logic using [GridSummaryColumn.CustomAggregate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridSummaryColumn.html#Syncfusion_UI_Xaml_Grid_GridSummaryColumn_CustomAggregate) property. @@ -2477,6 +2477,6 @@ You can download the sample demo [here](https://www.syncfusion.com/downloads/sup [How to Change the GroupCaptionText based on Display member of the GridComboboxColumn?](https://support.syncfusion.com/kb/article/3569/how-to-change-the-groupcaptiontext-based-on-display-member-of-the-gridcomboboxcolumn) -[How to customize the CaptionSummaryCell text in the SfDataGrid?](https://support.syncfusion.com/kb/article/3433/how-to-customize-the-captionsummarycell-text-in-wpf-datagrid) +[How to customize the CaptionSummaryCell text in the Data Grid?](https://support.syncfusion.com/kb/article/3433/how-to-customize-the-captionsummarycell-text-in-wpf-datagrid) [How to Set the horizontal alignment on summary columns?](https://support.syncfusion.com/kb/article/2923/how-to-set-the-horizontal-alignment-on-summary-columns-in-wpf-datagrid) diff --git a/wpf/DataGrid/Themes.md b/wpf/DataGrid/Themes.md index 28747cdec..d9b96ecfc 100644 --- a/wpf/DataGrid/Themes.md +++ b/wpf/DataGrid/Themes.md @@ -9,7 +9,7 @@ documentation: ug # Themes in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) supports various built-in themes. Refer to the below links to apply themes for the SfDataGrid, +[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) supports various built-in themes. Refer to the below links to apply themes for the Data Grid, * [Apply theme using SfSkinManager](https://help.syncfusion.com/wpf/themes/skin-manager) diff --git a/wpf/DataGrid/UI-Automation.md b/wpf/DataGrid/UI-Automation.md index 91fb33673..9b8a8aea6 100644 --- a/wpf/DataGrid/UI-Automation.md +++ b/wpf/DataGrid/UI-Automation.md @@ -11,7 +11,7 @@ documentation: ug Microsoft UI Automation is the new accessibility Framework for Microsoft Windows, available on all operating systems that support Windows Presentation Foundation (WPF). UI Automation provides accessibility to most UI elements and it provides the information about UI element to the end user. You can interact with the UI by using automated test scripts. To know more about UI Automation, refer the MSDN page [here](https://learn.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview). -SfDataGrid supports the following types of UI Automation, +Data Grid supports the following types of UI Automation, 1. Coded UI 2. Quick Test Professional @@ -19,7 +19,7 @@ SfDataGrid supports the following types of UI Automation, ## Coded UI Test -Automated tests that drive your application through its user interface (UI) are known as Coded UI Tests (CUITs). These tests include functional testing of the UI controls. SfDataGrid supports CUITs Coded UI automation that helps you create automated tests for inner elements and records the sequence of actions. While dragging the crosshair that is shown in CodedUITestBuilder, on UI elements, it shows the properties of the respective UI elements and you can also add assertion for each of the properties. +Automated tests that drive your application through its user interface (UI) are known as Coded UI Tests (CUITs). These tests include functional testing of the UI controls. Data Grid supports CUITs Coded UI automation that helps you create automated tests for inner elements and records the sequence of actions. While dragging the crosshair that is shown in CodedUITestBuilder, on UI elements, it shows the properties of the respective UI elements and you can also add assertion for each of the properties. [SfDataPager](https://help.syncfusion.com/wpf/datapager/overview) and [SfMultiColumnDropDownControl](https://help.syncfusion.com/wpf/multi-column-dropdown/getting-started) support `Coded UI` Test automation. @@ -50,7 +50,7 @@ Coded UI Test Builder generates code from recorded session and custom class is i Coded UI provides support only in Visual Studio Ultimate and Visual Studio Premium. For more information about the platforms and configurations that are supported by Coded UI tests, refer this [link](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/test/supported-configurations-and-platforms-for-coded-ui-tests-and-action-recordings?view=vs-2015&redirectedfrom=MSDN). -To test SfDataGrid with CUITs, build the Extension Project and place it in the mentioned location. You can get the Extension Project of SfDataGrid from [this](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Src-229533545.zip) location. +To test Data Grid with CUITs, build the Extension Project and place it in the mentioned location. You can get the Extension Project of the control from [this](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Src-229533545.zip) location. 1. Open the Extension Project and build it. 2. You can get the `Syncfusion.VisualStudio.TestTools.UITest.SfGridExtension.dll` from bin folder. @@ -64,9 +64,9 @@ N> `Syncfusion.VisualStudio.TestTools.UITest.SfGridExtension.dll` need to be ins ### Getting Started -This topic shows you how to create a CodedUITest project and test the SfDataGrid application. +This topic shows you how to create a CodedUITest project and test the Data Grid application. -1. Create a new WPF application or open an existing WPF application with SfDataGrid and enable Coded UI Test in SfDataGrid. To enable CUITs, you need to set [AutomationPeerHelper.EnableCodedUI](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AutomationPeerHelper.html#Syncfusion_UI_Xaml_Grid_AutomationPeerHelper_EnableCodedUI) as `True` and access the [AutomationPeerHelper](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AutomationPeerHelper.html) class from [Syncfusion.UI.Xaml.Grid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.html) namespace as shown in the following code example, +1. Create a new WPF application or open an existing WPF application with Data Grid and enable Coded UI Test in the control. To enable CUITs, you need to set [AutomationPeerHelper.EnableCodedUI](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AutomationPeerHelper.html#Syncfusion_UI_Xaml_Grid_AutomationPeerHelper_EnableCodedUI) as `True` and access the [AutomationPeerHelper](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.AutomationPeerHelper.html) class from [Syncfusion.UI.Xaml.Grid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.html) namespace as shown in the following code example, {% capture codesnippet1 %} {% tabs %} @@ -116,14 +116,14 @@ public MainWindow() {:.caption} 6. You can also open the CodedUITestBuilder from existing Coded UI project by right clicking on the CodedUITestMethod1 in CUIT file and clicking the Generate Code For Coded UI Test as shown in the following screenshot. You can see the same CodedUITestBuilder in the bottom right corner of the window. - ![UI Automation in SfDataGrid WPF](Features_images/Features_img226.png) + ![UI Automation](Features_images/Features_img226.png) CodedUITestMethod {:.caption} -7. Now you can drag the Crosshairs on to the UI elements of your WPF SfDataGrid application and it shows the available properties of the inner UI elements in SfDataGrid. -8. You can record the actions made on UI elements by clicking Record button on the CodedUITest builder. For example you can record the action of changing the cell value in SfDataGrid. Click the Pause button to finish the record. +7. Now you can drag the Crosshairs on to the UI elements of your WPF Data Grid application and it shows the available properties of the inner UI elements in the control. +8. You can record the actions made on UI elements by clicking Record button on the CodedUITest builder. For example you can record the action of changing the cell value in Data Grid. Click the Pause button to finish the record. @@ -157,7 +157,7 @@ public void RecordedMethod1() 10. You can also create an assertion to check the modified cell value. Drag the crosshair to the modified cell, and the Assertion window appears. The properties for control (Cell) is now listed in the Assertion dialog box. You can add assertion by clicking the Generate Code button in CodedUITestBuilder. - ![SfDataGrid UI Automation with adding the assertion](Features_images/Features_img228.png) + ![UI Automation with adding the assertion](Features_images/Features_img228.png) @@ -165,7 +165,7 @@ public void RecordedMethod1() {:.caption} 11. After all tests and assertion are created, right-click on the Test method and click Run Tests to run the test as follows. - ![Run the SfDataGrid coded ui test](Features_images/Features_img229.png) + ![Run the Data Grid coded ui test](Features_images/Features_img229.png) @@ -174,7 +174,7 @@ public void RecordedMethod1() ### Tables for Properties -The following properties are for each of the UI elements in SfDataGrid. +The following properties are for each of the UI elements in Data Grid. @@ -265,13 +265,13 @@ AccentBackground AccentForeground AutoEllipsisMode AutoEllipsisText DisplayMode ### Limitations -* SfDataGrid UI Automation will not work when you automate the datagrid with editing in Visual Studio 2015. It is a known issue in Visual Studio 2015. +* Data Grid UI Automation will not work when you automate the datagrid with editing in Visual Studio 2015. It is a known issue in Visual Studio 2015. ### How To -### How to Enable Coded UI Test in SfDataGrid +### How to Enable Coded UI Test in Data Grid -To enable Coded UI Test in SfDataGrid, set `AutomationPeerHelper.EnableCodedUI` as `True`. You can use the `AutomationPeerHelper` class from `Syncfusion.UI.Xaml.Grid` namespace. +To enable Coded UI Test in Data Grid, set `AutomationPeerHelper.EnableCodedUI` as `True`. You can use the `AutomationPeerHelper` class from `Syncfusion.UI.Xaml.Grid` namespace. {% tabs %} {% highlight C# %} diff --git a/wpf/DataGrid/Unbound-Column.md b/wpf/DataGrid/Unbound-Column.md index 7ba257756..93571988b 100644 --- a/wpf/DataGrid/Unbound-Column.md +++ b/wpf/DataGrid/Unbound-Column.md @@ -247,7 +247,7 @@ void dataGrid_QueryUnboundColumnValue(object sender, GridUnboundColumnEventsArgs {% endhighlight %} {% endtabs %} -![Populating data with Unbound Column in WPF SfDataGrid](Unbound-Column_images/wpf-datagrid-populating-data.png) +![Populating data with Unbound Column](Unbound-Column_images/wpf-datagrid-populating-data.png) ## Refreshing the unbound column at runtime @@ -372,7 +372,7 @@ You can refer the [Styling](https://help.syncfusion.com/wpf/datagrid/column-type ## Customize the Unbound column behavior -SfDataGrid allows you to customize the operations like key navigation and UI related interactions by overriding the corresponding renderer associated with the unbound column. +The Data Grid allows you to customize the operations like key navigation and UI related interactions by overriding the corresponding renderer associated with the unbound column. Below table lists the available cell types for unbound column.
@@ -441,7 +441,7 @@ public class GridUnBoundCellTextBoxRendererExt : GridUnBoundCellTextBoxRenderer {% endhighlight %} {% endtabs %} -![Customizing Unbound Column behavior in WPF SfDataGrid](Unbound-Column_images/wpf-datagrid-unbound-column-behavior.png) +![Customizing Unbound Column behavior](Unbound-Column_images/wpf-datagrid-unbound-column-behavior.png) ### Custom Renderer diff --git a/wpf/DataGrid/Unbound-Rows.md b/wpf/DataGrid/Unbound-Rows.md index d2e099c01..2d66bce71 100644 --- a/wpf/DataGrid/Unbound-Rows.md +++ b/wpf/DataGrid/Unbound-Rows.md @@ -10,7 +10,7 @@ documentation: ug # Unbound Rows in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to add **additional rows** at top and also bottom of the SfDataGrid which are **not bound with data object** from underlying data source. You can add unbound rows using [SfDataGrid.UnBoundRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_UnBoundRows) collection property. You can add any no of unbound rows to SfDataGrid. Unbound rows can be exported and printed. +[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to add **additional rows** at top and also bottom of the Data Grid which are **not bound with data object** from underlying data source. You can add unbound rows using [SfDataGrid.UnBoundRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_UnBoundRows) collection property. You can add any no of unbound rows to the control. Unbound rows can be exported and printed. {% tabs %} {% highlight xaml %} @@ -32,7 +32,7 @@ N> [AllowFrozenGroupHeaders](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xa ## Positioning unbound rows -Unbound row can be placed in top or bottom of the SfDataGrid. Unbound row positioned based on [GridUnBoundRow.Position](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRow.html#Syncfusion_UI_Xaml_Grid_GridUnBoundRow_Position) and [GridUnBoundRow.ShowBelowSummary](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRow.html#Syncfusion_UI_Xaml_Grid_GridUnBoundRow_ShowBelowSummary) properties. +Unbound row can be placed in top or bottom of the Data Grid. Unbound row positioned based on [GridUnBoundRow.Position](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRow.html#Syncfusion_UI_Xaml_Grid_GridUnBoundRow_Position) and [GridUnBoundRow.ShowBelowSummary](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRow.html#Syncfusion_UI_Xaml_Grid_GridUnBoundRow_ShowBelowSummary) properties. Below table shows the unbound row positioning based on property settings of `Position` and `ShowBelowSummary`. @@ -78,7 +78,7 @@ Bottom True @@ -100,7 +100,7 @@ Below screen shot shows different unbound rows placed in all possible positions. ## Populating data for unbound rows -You can populate data for the unbound row by handling [QueryUnBoundRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_QueryUnBoundRow) event of SfDataGrid. This event occurs for each cell in unbound row whenever the row gets refreshed. +You can populate data for the unbound row by handling [QueryUnBoundRow](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_QueryUnBoundRow) event of Data Grid. This event occurs for each cell in unbound row whenever the row gets refreshed. [GridUnBoundRowEventsArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRowEventsArgs.html) of the `QueryUnBoundRow` event provides information about the cell triggered this event. [GridUnBoundRowEventsArgs.OriginalSender](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridEventArgs.html#Syncfusion_UI_Xaml_Grid_GridEventArgs_OriginalSender) returns the DataGrid fired this event for DetailsView. You can get or set the [GridUnBoundRowEventsArgs.Value](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRowEventsArgs.html#Syncfusion_UI_Xaml_Grid_GridUnBoundRowEventsArgs_Value) property based on the [UnBoundAction](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridUnBoundRowEventsArgs.html#Syncfusion_UI_Xaml_Grid_GridUnBoundRowEventsArgs_UnBoundAction). If `UnBoundAction` is `QueryData` then you can set the value for display. If the `UnBoundAction` is `CommitData` then you can get the edited value. @@ -117,7 +117,7 @@ You can get or set the [GridUnBoundRowEventsArgs.Value](https://help.syncfusion. {% endhighlight %} {% endtabs %} -For example, now unbound row populated based on selected items in SfDataGrid. +For example, now unbound row populated based on selected items in Data Grid. {% tabs %} @@ -286,7 +286,7 @@ public class UnboundCellStyleConverter : IValueConverter ## Customize the Unbound Row’s behavior -SfDataGrid allows you to customize the operations like key navigation and UI related interactions by overriding the corresponding renderer associated with the unbound row cell. Each renderer have set of virtual methods for handling the behaviors. Creating new renderers also supported. +Data Grid allows you to customize the operations like key navigation and UI related interactions by overriding the corresponding renderer associated with the unbound row cell. Each renderer have set of virtual methods for handling the behaviors. Creating new renderers also supported. Below table lists the available cell types for unbound row and its renderers. diff --git a/wpf/DataGrid/autosize-columns.md b/wpf/DataGrid/autosize-columns.md index 947d165fa..7d3ea2e3d 100644 --- a/wpf/DataGrid/autosize-columns.md +++ b/wpf/DataGrid/autosize-columns.md @@ -9,7 +9,7 @@ documentation: ug # AutoSize Columns in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to set the column widths based on certain logic using [SfDataGrid.ColumnSizer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ColumnSizer) or [GridColumn.ColumnSizer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_ColumnSizer) property. Below is the list of predefined column sizing options available. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) allows you to set the column widths based on certain logic using [SfDataGrid.ColumnSizer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_ColumnSizer) or [GridColumn.ColumnSizer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumn.html#Syncfusion_UI_Xaml_Grid_GridColumn_ColumnSizer) property. Below is the list of predefined column sizing options available.
-Unbound row placed at bottom of SfDataGrid. In this position, unbound row is not selectable, not editable and frozen when scrolling. +Unbound row placed at bottom of Data Grid. In this position, unbound row is not selectable, not editable and frozen when scrolling.
@@ -91,7 +91,7 @@ Below code, applies `GridLengthUnitType.Star` to equally set width for `SfDataGr {% endhighlight %} {% endtabs %} -![Autosize Columns in WPF DataGrid](Columns_images/wpf-datagrid-autosize-columns.png) +![Autosize Columns](Columns_images/wpf-datagrid-autosize-columns.png) N> The `GridColumn.ColumnSizer` takes higher priority than the `SfDataGrid.ColumnSizer`. @@ -119,12 +119,12 @@ this.datagrid.Columns["OrderID"].ColumnSizer = GridLengthUnitType.AutoWithLastCo {% endhighlight %} {% endtabs %} -![Specific Column in WPF DataGrid Fills Remaining Width](Columns_images/wpf-datagrid-specific-column.png) +![Specific Column Fills Remaining Width](Columns_images/wpf-datagrid-specific-column.png) ## Refreshing autosize calculation at runtime You can refresh the autosize calculation at runtime by calling [SfDataGrid.GridColumnSizer.Refresh](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnSizer.html#Syncfusion_UI_Xaml_Grid_GridColumnSizer_Refresh().html) method. -DataGrid support to recalculates the column auto width by calling reset methods of `GridColumnSizer`. [GridColumnSizer.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. [GridColumnSizer.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. +Data Grid supports recalculating the column auto width by calling the reset methods of `GridColumnSizer`. The [GridColumnSizer.ResetAutoCalculationforAllColumns](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ColumnSizerBase-1.html#Syncfusion_UI_Xaml_Grid_ColumnSizerBase_1_ResetAutoCalculationforAllColumns) method resets widths for all columns. The [GridColumnSizer.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 resets the width for a particular column. N> The `GridColumnSizer.ResetAutoCalculationforAllColumns` or `GridColumnSizer.ResetAutoCalculation` methods applicable for Auto, AutoWithLastColumnFill, AutoLastColumnFill, SizeToCells types. @@ -158,7 +158,7 @@ this.dataGrid.GridColumnSizer.Refresh(); ## Customizing built-in column auto-sizing logic -SfDataGrid process column sizing operations in [GridColumnSizer](https://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 `SfDataGrid.GridColumnSizer`. +Data Grid processes column sizing operations in the [GridColumnSizer](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridColumnSizer.html) class. You can customize the column sizing operations by overriding `GridColumnSizer` and setting it to `SfDataGrid.GridColumnSizer`. {% tabs %} {% highlight c# %} @@ -205,7 +205,7 @@ dataGrid.GridColumnSizer.FilterIconWidth = 20; {% endhighlight %} {% endtabs %} -### Changing Font settings for DataGrid +### Changing Font settings for Data Grid You can change the `font settings` for column width calculation by setting [GridColumnSizer.FontSize](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ColumnSizerBase-1.html#Syncfusion_UI_Xaml_Grid_ColumnSizerBase_1_FontSize), [GridColumnSizer.FontFamily](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ColumnSizerBase-1.html#Syncfusion_UI_Xaml_Grid_ColumnSizerBase_1_FontFamily) and [GridColumnSizer.Margin](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.ColumnSizerBase-1.html#Syncfusion_UI_Xaml_Grid_ColumnSizerBase_1_Margin) properties. This settings will be considered for all columns. @@ -379,7 +379,7 @@ Below code uses the `ColumnRatio` to apply the defined star width for each colum {% endhighlight %} {% endtabs %} -![WPF DataGrid displays ColumnRatio Column Width](Columns_images/wpf-datagrid-column-ratio.png) +![ColumnRatio Column Width](Columns_images/wpf-datagrid-column-ratio.png) ## Change the width of DataGrid ComboBoxColumn based on it’s ItemsSource diff --git a/wpf/DataGrid/context-menu.md b/wpf/DataGrid/context-menu.md index 7d7edc1ca..e28e40ca6 100644 --- a/wpf/DataGrid/context-menu.md +++ b/wpf/DataGrid/context-menu.md @@ -9,7 +9,7 @@ documentation: ug # Context Menu in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) (SfDataGrid) provides an entirely customizable context menu to expose the functionality on user interface. You can create context menu for different rows in an efficient manner. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) provides an entirely customizable context menu to expose the functionality on user interface. You can create context menu for different rows in an efficient manner. The below code example shows the context menu with command bindings. @@ -148,7 +148,7 @@ this.dataGrid.RecordContextMenu.Items.Add(new MenuItem() { Header = "Delete" }); {% endhighlight %} {% endtabs %} -![Context Menu for Data Rows in WPF DataGrid](Interactive-Features_images/wpf-datagrid-row-context-menu.png) +![Context Menu for Data Rows](Interactive-Features_images/wpf-datagrid-row-context-menu.png) While binding the menu item using CommandBinding you can get the command parameter as `GridRecordContextMenuInfo` which contains the record of the corresponding row. @@ -215,7 +215,7 @@ this.dataGrid.HeaderContextMenu.Items.Add(new MenuItem() { Header = "BestFit" }) {% endhighlight %} {% endtabs %} -![Context Menu for Header Row in WPF DataGrid](Interactive-Features_images/wpf-datagrid-header-context-menu.png) +![Context Menu for Header Row](Interactive-Features_images/wpf-datagrid-header-context-menu.png) While binding the menu item using CommandBinding you can get the parameter as `GridColumnContextMenuInfo` which contains the particular GridColumn. @@ -276,7 +276,7 @@ this.dataGrid.GroupDropAreaContextMenu.Items.Add(new MenuItem() { Header = "Clea {% endhighlight %} {% endtabs %} -![Context Menu for GroupDropArea in WPF DataGrid](Interactive-Features_images/wpf-datagrid-group-drop-area-context-menu.png) +![Context Menu for GroupDropArea](Interactive-Features_images/wpf-datagrid-group-drop-area-context-menu.png) While binding the menu item using CommandBinding you can get the parameter as `GroupDropAreaContextMenuInfo`. @@ -341,7 +341,7 @@ this.dataGrid.GroupDropItemContextMenu.Items.Add(new MenuItem() { Header = "Clea {% endhighlight %} {% endtabs %} -![Context Menu for GroupDropItem in WPF DataGrid](Interactive-Features_images/wpf-datagrid-group-drop-item-context-menu.png) +![Context Menu for GroupDropItem](Interactive-Features_images/wpf-datagrid-group-drop-item-context-menu.png) While binding the menu item using CommandBinding you can get the parameter as `GridColumnContextMenuInfo` which contains the particular GridColumn. @@ -398,7 +398,7 @@ this.dataGrid.GroupCaptionContextMenu.Items.Add(new MenuItem() { Header = "Colla {% endhighlight %} {% endtabs %} -![Context Menu for GroupCaptionRows in WPF DataGrid](Interactive-Features_images/wpf-datagrid-caption-row-context-menu.png) +![Context Menu for GroupCaptionRows](Interactive-Features_images/wpf-datagrid-caption-row-context-menu.png) While binding the menu item using CommandBinding you can get the command parameter as `GridRecordContextMenuInfo` which contains the record of the corresponding row. @@ -453,7 +453,7 @@ this.dataGrid.GroupSummaryContextMenu.Items.Add(new MenuItem() { Header = "Clear {% endhighlight %} {% endtabs %} -![Context Menu for GroupSummaryRows in WPF DataGrid](Interactive-Features_images/wpf-datagrid-summary-row-context-menu.png) +![Context Menu for GroupSummaryRows](Interactive-Features_images/wpf-datagrid-summary-row-context-menu.png) While binding the menu item using CommandBinding you can get the command parameter as `GridRecordContextMenuInfo` which contains the record of the corresponding row. @@ -518,7 +518,7 @@ this.dataGrid.TableSummaryContextMenu.Items.Add(new MenuItem() { Header = "Sum" {% endhighlight %} {% endtabs %} -![Context Menu for TableSummaryRows in WPF DataGrid](Interactive-Features_images/wpf-datagrid-table-summary-context-menu.png) +![Context Menu for TableSummaryRows](Interactive-Features_images/wpf-datagrid-table-summary-context-menu.png) While binding the menu item using CommandBinding you can get the command parameter as `GridRecordContextMenuInfo` which contains the record of the corresponding row. @@ -562,7 +562,7 @@ private static void OnTotalSummaryCountClicked(object obj) ### GridContextMenuOpening -[GridContextMenuOpening](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event occurs while opening the context menu in SfDataGrid. +[GridContextMenuOpening](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html) event occurs while opening the context menu in Data Grid. [GridContextMenuEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridContextMenuEventArgs.html) has the following members which provides the information about `GridContextMenuOpening` event. @@ -622,7 +622,7 @@ void dataGrid_GridContextMenuOpening(object sender, GridContextMenuEventArgs e) {% endhighlight %} {% endtabs %} -![Changing Context Menu for Record Cell while Opening in WPF DataGrid](Interactive-Features_images/wpf-datagrid-context-menu.png) +![Changing Context Menu for Record Cell while Opening](Interactive-Features_images/wpf-datagrid-context-menu.png) ### Changing background of Context menu @@ -647,4 +647,4 @@ You can change the appearance of the context menu by customizing the style with {% endhighlight %} {% endtabs %} -![Changing Context Menu Background in WPF DataGrid](Interactive-Features_images/wpf-datagrid-context-menu-background.png) +![Changing Context Menu Background](Interactive-Features_images/wpf-datagrid-context-menu-background.png) diff --git a/wpf/DataGrid/drag-and-drop.md b/wpf/DataGrid/drag-and-drop.md index 07167e50c..dfeab1197 100644 --- a/wpf/DataGrid/drag-and-drop.md +++ b/wpf/DataGrid/drag-and-drop.md @@ -9,7 +9,7 @@ documentation: ug # Row Drag and Drop in WPF Data Grid -[WPF DataGrid](https://www.syncfusion.com/wpf-controls/datagrid) allows drag and drop the rows within and between controls by setting the [AllowDraggingRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowDraggingRows) and [AllowDrop](https://docs.microsoft.com/en-us/dotnet/api/system.windows.uielement.allowdrop) property as `true`. It is also possible to drag and drop the rows between datagrid and other controls such as `ListView` and `SfTreeGrid`. SfDataGrid allows dropping rows when `AllowDrop` is `true` and allows dragging when `AllowDraggingRows` is `true`. +[WPF Data Grid](https://www.syncfusion.com/wpf-controls/datagrid) allows dragging and dropping the rows within and between controls by setting the [AllowDraggingRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowDraggingRows) and [AllowDrop](https://docs.microsoft.com/en-us/dotnet/api/system.windows.uielement.allowdrop) properties as `true`. It is also possible to drag and drop the rows between the Data Grid and other controls, such as `ListView` and `SfTreeGrid`. Dropping is allowed when `AllowDrop` is `true` and dragging when `AllowDraggingRows` is `true`. {% tabs %} {% highlight xaml %} @@ -29,27 +29,27 @@ While dropping, the dragged records can be added above or below to the target re For example, if you dropped record at the bottom of the targeted record, it will be added below the targeted record. -![Drag and Drop Rows in WPF DataGrid](Interactive-Features_images/wpf-datgrid-drag-and-drop-rows.png) +![Drag and drop rows](Interactive-Features_images/wpf-datgrid-drag-and-drop-rows.png) If you drop above the targeted record, it will be added above the targeted record -![Drag and Drop Rows in WPF DataGrid](Interactive-Features_images/wpf-datagrid-drag-and-drop-row.png) +![Drag and drop rows](Interactive-Features_images/wpf-datagrid-drag-and-drop-row.png) ## Dragging multiple rows -WPF DataGrid (SfDataGrid) allows to drag multiple selected rows. To enable multiple selection, set the [SfDataGrid.SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode) as `Multiple` or `Extended`. +Data Grid allows dragging multiple selected rows. To enable multiple selection, set the [SfDataGrid.SelectionMode](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfGridBase.html#Syncfusion_UI_Xaml_Grid_SfGridBase_SelectionMode) as `Multiple` or `Extended`. -N> The drag selection cannot be performed while the [AllowDraggingRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowDraggingRows) enabled as `true` in the SfDataGrid. +N> The drag selection cannot be performed while the [AllowDraggingRows](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_AllowDraggingRows) enabled as `true` in the Data Grid. -![Dragging Multiple Rows in WPF DataGrid](Interactive-Features_images/wpf-datagrid-drag-multiple-rows.png) +![Dragging multiple rows](Interactive-Features_images/wpf-datagrid-drag-multiple-rows.png) ## Drag and drop events -SfDataGrid triggers the following events when drag and drop: +Data Grid triggers the following events when drag and drop: ### Drag start event -[DragStart](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs when you start to drag the records in datagrid. The [GridRowDragStartEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragStartEventArgs.html) has the following member, which provides information for the `DragStart` event. +[DragStart](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs when you start to drag the records in the Data Grid. The [GridRowDragStartEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragStartEventArgs.html) has the following member, which provides information for the `DragStart` event. * [DraggingRecords](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragStartEventArgs.html#Syncfusion_UI_Xaml_Grid_GridRowDragStartEventArgs_DraggingRecords) : Gets the Records which contains the data associated while dragging the rows. {% tabs %} @@ -66,10 +66,10 @@ private void RowDragDropController_DragStart(object sender, GridRowDragStartEven ### Drag over event -[DragOver](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs continuously while record is dragged within the target SfDataGrid. The [GridRowDragOverEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragOverEventArgs.html) has the following members, which provide information for the `DragOver` event. +[DragOver](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs continuously while a record is dragged within the target Data Grid. The [GridRowDragOverEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragOverEventArgs.html) has the following members, which provide information for the `DragOver` event. * [Data](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_Data) : Gets a data object that contains the data associated while dragging the rows. * [DropPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_DropPosition) : Gets a value indicating the drop position which is based on dropped location -* [IsFromOutSideSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_IsFromOutSideSource) **:** Gets a value indicating whether the dragging item is from same DataGrid or not. +* [IsFromOutSideSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_IsFromOutSideSource) **:** Gets a value indicating whether the dragging item is from the same Data Grid or not. *[ShowDragUI](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragOverEventArgs.html#Syncfusion_UI_Xaml_Grid_GridRowDragOverEventArgs_ShowDragUI) : Gets or sets a value indicating the default Dragging UI. * [TargetRecord](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_TargetRecord) : Gets a value indicating the target record which is going to drop. @@ -90,7 +90,7 @@ private void RowDragDropController_DragOver(object sender, GridRowDragOverEventA [DragLeave](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs when leave a drag-and-drop operation.The [GridRowDragLeaveEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragLeaveEventArgs.html) has the following members, which provide information for the `DragLeave` event. * [Data](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_Data) : Gets a data object that contains the data associated while dragging the rows. * [DropPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_DropPosition) : Gets a value indicating the drop position which is based on dropped location -* [IsFromOutSideSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_IsFromOutSideSource) : Gets a value indicating whether the dragging item is from same DataGrid or not. +* [IsFromOutSideSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_IsFromOutSideSource) : Gets a value indicating whether the dragging item is from the same Data Grid or not. * [TargetRecord](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_TargetRecord) : Gets a value indicating the target record which is going to drop. {% tabs %} @@ -107,11 +107,11 @@ private void RowDragDropController_DragLeave(object sender, GridRowDragLeaveEven ### Drop event -[Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs when a record is dropping within the target SfDataGrid.The [GridRowDropEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDropEventArgs.html) has the following members, which provide information for the `Drop` event. +[Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs when a record is dropped within the target Data Grid.The [GridRowDropEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDropEventArgs.html) has the following members, which provide information for the `Drop` event. * [Data](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_Data) : Gets a data object that contains the data associated while dragging the rows. * [DraggingRecords](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragStartEventArgs.html#Syncfusion_UI_Xaml_Grid_GridRowDragStartEventArgs_DraggingRecords) : Gets the Records which contains the data associated while dragging the rows. * [DropPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_DropPosition) : Gets a value indicating the drop position which is based on dropped location -* [IsFromOutSideSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_IsFromOutSideSource) : Gets a value indicating whether the dragging item is from same DataGrid or not. +* [IsFromOutSideSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_IsFromOutSideSource) : Gets a value indicating whether the dragging item is from the same Data Grid or not. * [TargetRecord](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_TargetRecord) : Gets a value indicating the target record which is going to drop. {% tabs %} @@ -128,10 +128,10 @@ private void RowDragDropController_Drop(object sender, GridRowDropEventArgs e) ### Dropped event -[Dropped](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs when a record is dropping within the target SfDataGrid.The [GridRowDroppedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDroppedEventArgs.html) has the following members, which provide information for the `Drop` event. +[Dropped](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event occurs when a record is dropped within the target Data Grid.The [GridRowDroppedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDroppedEventArgs.html) has the following members, which provide information for the `Drop` event. * [Data](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_Data) : Gets a data object that contains the data associated while dragging the rows. * [DropPosition](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_DropPosition) : Gets a value indicating the drop position which is based on dropped location -* [IsFromOutSideSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_IsFromOutSideSource) : Gets a value indicating whether the dragging item is from same DataGrid or not. +* [IsFromOutSideSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_IsFromOutSideSource) : Gets a value indicating whether the dragging item is from the same Data Grid or not. * [TargetRecord](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropEventArgsBase.html#Syncfusion_UI_Xaml_Grid_GridRowDragDropEventArgsBase_TargetRecord) : Gets a value indicating the target record which is going to drop. {% tabs %} @@ -165,13 +165,13 @@ this.dataGrid.RowDropIndicatorMode = Syncfusion.UI.Xaml.Grid.DropIndicatorMode.L {% endhighlight %} {% endtabs %} -![Changing Row Drop Indicator in WPF DataGrid](Interactive-Features_images/wpf-datagrid-row-drop-indicator.png) +![Changing row drop indicator](Interactive-Features_images/wpf-datagrid-row-drop-indicator.png) ## Customizing row drag and drop operation -### Disable dragging of certain rows in WPF DataGrid +### Disable dragging of certain rows in WPF Data Grid -You can restrict the dragging of certain rows in SfDataGrid by using the [GridRowDragDropController.DragStart](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event. +You can restrict the dragging of certain rows by using the [GridRowDragDropController.DragStart](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event. {% tabs %} {% highlight c# %} @@ -191,9 +191,9 @@ private void RowDragDropController_DragStart(object sender, Syncfusion.UI.Xaml.G {% endhighlight %} {% endtabs %} -### Disable dropping over certain rows in WPF DataGrid +### Disable dropping over certain rows in WPF Data Grid -You can restrict the dropping the records in certain rows in SfDataGrid by using the [GridRowDragDropController.Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event. +You can restrict the dropping of the records in certain rows by using the [GridRowDragDropController.Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) event. {% tabs %} {% highlight c# %} @@ -228,7 +228,7 @@ private void RowDragDropController_DragOver(object sender, GridRowDragOverEventA ### Customizing draggable Popup -To customize draggable popup, use the [RowDragDropTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RowDragDropTemplate) property in the SfDataGrid. +To customize draggable popup, use the [RowDragDropTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.SfDataGrid.html#Syncfusion_UI_Xaml_Grid_SfDataGrid_RowDragDropTemplate) property in the Data Grid. {% tabs %} {% highlight xaml %} @@ -292,7 +292,7 @@ To customize draggable popup, use the [RowDragDropTemplate](https://help.syncfus {% endhighlight %} {% endtabs %} -![Customizing Draggable Popup in WPF DataGrid](Interactive-Features_images/wpf-datagrid-draggable-popup.png) +![Customizing draggable popup](Interactive-Features_images/wpf-datagrid-draggable-popup.png) ### Customizing draggable popup to show corresponding dragging row data @@ -331,7 +331,7 @@ You can customize the dragging popup to show the corresponding drag row data by {% endhighlight %} {% endtabs %} -![Customizing Draggable Popup for Corresponding Dragging Row in WPF DataGrid](Interactive-Features_images/wpf-datagrid-draggable-popup-customization.png) +![Customizing draggable popup for corresponding dragging row](Interactive-Features_images/wpf-datagrid-draggable-popup-customization.png) ### Reorder the source collection while drag and drop the rows @@ -378,9 +378,9 @@ private void OnRowDropped(object sender, GridRowDroppedEventArgs e) {% endhighlight %} {% endtabs %} -## Row drag and drop between DataGrid and ListView +## Row drag and drop between Data Grid and ListView -To perform dragging between the `ListView` and `SfDataGrid`, by using the [GridRowDragDropController.DragStart](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) and [GridRowDragDropController.Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) events. And you must set the `AllowDrop` property as `true` in the `ListView` while doing the drag and drop operation from `SfDataGrid` with `ListView` control. +To perform dragging between the `ListView` and the Data Grid, by using the [GridRowDragDropController.DragStart](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) and [GridRowDragDropController.Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) events. And you must set the `AllowDrop` property as `true` in the `ListView` while doing the drag and drop operation from the Data Grid with `ListView` control. {% tabs %} {% highlight c# %} @@ -554,13 +554,13 @@ private void ListView_Drop(object sender, DragEventArgs e) {% endhighlight %} {% endtabs %} -![Row Drag and Drop between WPF DataGrid and ListView](Interactive-Features_images/wpf-datagrid-drag-between-grid-and-listview.png) +![Row drag and drop between grid and ListView](Interactive-Features_images/wpf-datagrid-drag-between-grid-and-listview.png) You can download the [sample](https://github.com/SyncfusionExamples/how-to-drag-and-drop-rows-between-datagrid-and-listview-in-wpf-and-uwp/tree/master/WPF). -## Row drag and drop between two DataGrid's +## Row drag and drop between two Data Grids -To perform the dragging operation between two datagrid by using the [GridRowDragDropController.DragStart](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) , [GridRowDragDropController.Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) , [GridRowDragDropController.DragOver](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) and [GridRowDragDropController.Dropped](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) events. +To perform the dragging operation between two Data Grids by using the [GridRowDragDropController.DragStart](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) , [GridRowDragDropController.Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) , [GridRowDragDropController.DragOver](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) and [GridRowDragDropController.Dropped](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) events. {% tabs %} {% highlight c# %} @@ -654,11 +654,11 @@ private void sfGrid_Dropped(object sender, GridRowDroppedEventArgs e) {% endhighlight %} {% endtabs %} -![Row Drag and Drop between WPF DataGrid Controls](Interactive-Features_images/wpf-datagrid-drag-grid-controls.png) +![Row drag and drop between grid controls](Interactive-Features_images/wpf-datagrid-drag-grid-controls.png) You can download the [sample](https://github.com/SyncfusionExamples/how-to-drag-and-drop-rows-between-two-datagrids-in-wpf-and-uwp/tree/master/WPF); -## Row drag and drop between DataGrid and TreeGrid +## Row drag and drop between Data Grid and TreeGrid To perform the dragging operation between `SfDataGrid` and `SfTreeGrid` by using the [GridRowDragDropController.Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Grid.GridRowDragDropController.html) and [TreeGridRowDragDropController.Drop](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.TreeGrid.TreeGridRowDragDropController.html) events. @@ -851,6 +851,6 @@ private void sfDataGrid_Drop(object sender, GridRowDropEventArgs e) {% endhighlight %} {% endtabs %} -![Row Drag and Drop between WPF DataGrid and TreeGrid](Interactive-Features_images/wpf-datagrid-drag-between-different-controls.png) +![Row drag and drop between grid and TreeGrid](Interactive-Features_images/wpf-datagrid-drag-between-different-controls.png) You can download the sample [here](https://github.com/SyncfusionExamples/how-to-drag-and-drop-rows-between-datagrid-and-treegrid-in-wpf).