diff --git a/blazor/datagrid/clipboard.md b/blazor/datagrid/clipboard.md index 52fe11dff9..ca2938fe0b 100644 --- a/blazor/datagrid/clipboard.md +++ b/blazor/datagrid/clipboard.md @@ -1,31 +1,32 @@ --- layout: post title: Clipboard in Blazor DataGrid Component | Syncfusion -description: Checkout and learn here all about Clipboard in the Syncfusion Blazor DataGrid component and much more. +description: Learn how to copy, paste, and autofill data in the Syncfusion Blazor DataGrid using keyboard shortcuts, buttons, and batch editing. platform: Blazor control: DataGrid documentation: ug --- -# Clipboard in Syncfusion® Blazor DataGrid +# Clipboard in Syncfusion Blazor DataGrid -The clipboard feature in the Syncfusion® Blazor DataGrid provides an easy way to copy selected rows or cells data into the clipboard. You can use keyboard shortcuts to perform the copy operation. The following list of keyboard shortcuts is supported in the Grid to copy selected rows or cells data into clipboard. +The **clipboard** feature in the Syncfusion® Blazor DataGrid allows copying selected rows or cells using keyboard shortcuts or programmatic methods. This helps transfer data to external applications such as spreadsheets or text editors. +To use keyboard shortcuts, selection must be enabled and the grid must be focused. -Interaction keys |Description ------|----- -Ctrl + C |Copy selected rows or cells data into clipboard. -Ctrl + Shift + H |Copy selected rows or cells data with header into clipboard. +| Windows | Mac | Actions | +|---------|-----|---------| +| Ctrl + C | Command + C | Copy selected rows or cells to the clipboard | +| Ctrl + Shift + H | Command + Shift + H | Copy selected rows or cells with headers to the clipboard | -By using these keyboard shortcuts, you can quickly copy data from the Grid to the clipboard, making it easy to paste the data into other applications or documents. +To enable clipboard functionality, configure the DataGrid with the required [GridSelectionSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridSelectionSettings.html). If the selection mode is `Row`, entire rows are copied. If it is `Cell`, only the highlighted cells are copied. -To enable the clipboard feature, you can use the Grid with your data source and selection property. +### Example: Enabling Clipboard Support {% tabs %} {% highlight razor tabtitle="Index.razor" %} @using Syncfusion.Blazor.Grids - + @@ -36,7 +37,7 @@ To enable the clipboard feature, you can use the Grid with your data source and @code { - public List Orders { get; set; } + private List Orders { get; set; } protected override void OnInitialized() { @@ -48,40 +49,40 @@ To enable the clipboard feature, you can use the Grid with your data source and {% highlight c# tabtitle="OrderData.cs" %} -public class OrderData +internal sealed class OrderData { - public static List Orders = new List(); + private static readonly List Data = new List(); - public OrderData(int orderID, string customerID, string shipCity, string shipName) + internal OrderData(int orderID, string customerID, string shipCity, string shipName) { - this.OrderID = orderID; - this.CustomerID = customerID; - this.ShipCity = shipCity; - this.ShipName = shipName; + OrderID = orderID; + CustomerID = customerID; + ShipCity = shipCity; + ShipName = shipName; } - public static List GetAllRecords() + internal static List GetAllRecords() { - if (Orders.Count == 0) + if (Data.Count == 0) { - Orders.Add(new OrderData(10248, "VINET", "Reims", "Vins et alcools Chevalier")); - Orders.Add(new OrderData(10249, "TOMSP", "Münster", "Toms Spezialitäten")); - Orders.Add(new OrderData(10250, "HANAR", "Rio de Janeiro", "Hanari Carnes")); - Orders.Add(new OrderData(10251, "VICTE", "Lyon", "Victuailles en stock")); - Orders.Add(new OrderData(10252, "SUPRD", "Charleroi", "Suprêmes délices")); - Orders.Add(new OrderData(10253, "HANAR", "Rio de Janeiro", "Hanari Carnes")); - Orders.Add(new OrderData(10254, "CHOPS", "Bern", "Chop-suey Chinese")); - Orders.Add(new OrderData(10255, "RICSU", "Genève", "Richter Supermarkt")); - Orders.Add(new OrderData(10256, "WELLI", "Resende", "Wellington Import Export")); - Orders.Add(new OrderData(10257, "HILAA", "San Cristóbal", "Hila Alimentos")); - Orders.Add(new OrderData(10258, "ERNSH", "Graz", "Ernst Handel")); - Orders.Add(new OrderData(10259, "CENTC", "México D.F.", "Centro comercial")); - Orders.Add(new OrderData(10260, "OTTIK", "Köln", "Ottilies Käseladen")); - Orders.Add(new OrderData(10261, "QUEDE", "Rio de Janeiro", "Que delícia")); - Orders.Add(new OrderData(10262, "RATTC", "Albuquerque", "Rattlesnake Canyon Grocery")); + Data.Add(new OrderData(10248, "VINET", "Reims", "Vins et alcools Chevalier")); + Data.Add(new OrderData(10249, "TOMSP", "Münster", "Toms Spezialitäten")); + Data.Add(new OrderData(10250, "HANAR", "Rio de Janeiro", "Hanari Carnes")); + Data.Add(new OrderData(10251, "VICTE", "Lyon", "Victuailles en stock")); + Data.Add(new OrderData(10252, "SUPRD", "Charleroi", "Suprêmes délices")); + Data.Add(new OrderData(10253, "HANAR", "Rio de Janeiro", "Hanari Carnes")); + Data.Add(new OrderData(10254, "CHOPS", "Bern", "Chop-suey Chinese")); + Data.Add(new OrderData(10255, "RICSU", "Genève", "Richter Supermarkt")); + Data.Add(new OrderData(10256, "WELLI", "Resende", "Wellington Import Export")); + Data.Add(new OrderData(10257, "HILAA", "San Cristóbal", "Hila Alimentos")); + Data.Add(new OrderData(10258, "ERNSH", "Graz", "Ernst Handel")); + Data.Add(new OrderData(10259, "CENTC", "México D.F.", "Centro comercial")); + Data.Add(new OrderData(10260, "OTTIK", "Köln", "Ottilies Käseladen")); + Data.Add(new OrderData(10261, "QUEDE", "Rio de Janeiro", "Que delícia")); + Data.Add(new OrderData(10262, "RATTC", "Albuquerque", "Rattlesnake Canyon Grocery")); } - return Orders; + return Data; } public int OrderID { get; set; } @@ -93,14 +94,18 @@ public class OrderData {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/VZLyNfMKeqJnkwxE?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/BXLosNWcpKkBYKnF?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} + +## Copy to Clipboard Using External Buttons +Clipboard actions can be triggered using external buttons when using UI controls is preferred over shortcut keys. -## Copy to clipboard by external buttons +The [CopyAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_CopyAsync_System_Nullable_System_Boolean__) method programmatically copies selected rows or cells: -Copying data to the clipboard by using external buttons in the Syncfusion® Blazor DataGrid allows you to programmatically trigger the copy operation, making it more friendly, especially for those who may not be familiar with keyboard shortcuts or manual copying. +- Pass `true` to include column headers in the copied content. +- Pass `false` or omit the parameter to copy without headers. -To copy selected rows or cells data into the clipboard with the help of external buttons, you can utilize the [CopyAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_CopyAsync_System_Nullable_System_Boolean__) method available in the Grid. This is demonstrated in the following example, +**Example: Copy to Clipboard with External Buttons** {% tabs %} {% highlight razor tabtitle="Index.razor" %} @@ -123,19 +128,19 @@ To copy selected rows or cells data into the clipboard with the help of external @code { private SfGrid Grid; - public List Orders { get; set; } + private List Orders { get; set; } protected override void OnInitialized() { Orders = OrderData.GetAllRecords(); } - public async Task Copy() + private async Task Copy() { await Grid.CopyAsync(); } - public async Task CopyHeader() + private async Task CopyHeader() { await Grid.CopyAsync(true); } @@ -145,40 +150,40 @@ To copy selected rows or cells data into the clipboard with the help of external {% highlight c# tabtitle="OrderData.cs" %} -public class OrderData +internal sealed class OrderData { - public static List Orders = new List(); + private static readonly List Data = new List(); - public OrderData(int orderID, string customerID, string shipCity, string shipName) + internal OrderData(int orderID, string customerID, string shipCity, string shipName) { - this.OrderID = orderID; - this.CustomerID = customerID; - this.ShipCity = shipCity; - this.ShipName = shipName; + OrderID = orderID; + CustomerID = customerID; + ShipCity = shipCity; + ShipName = shipName; } - public static List GetAllRecords() + internal static List GetAllRecords() { - if (Orders.Count == 0) + if (Data.Count == 0) { - Orders.Add(new OrderData(10248, "VINET", "Reims", "Vins et alcools Chevalier")); - Orders.Add(new OrderData(10249, "TOMSP", "Münster", "Toms Spezialitäten")); - Orders.Add(new OrderData(10250, "HANAR", "Rio de Janeiro", "Hanari Carnes")); - Orders.Add(new OrderData(10251, "VICTE", "Lyon", "Victuailles en stock")); - Orders.Add(new OrderData(10252, "SUPRD", "Charleroi", "Suprêmes délices")); - Orders.Add(new OrderData(10253, "HANAR", "Rio de Janeiro", "Hanari Carnes")); - Orders.Add(new OrderData(10254, "CHOPS", "Bern", "Chop-suey Chinese")); - Orders.Add(new OrderData(10255, "RICSU", "Genève", "Richter Supermarkt")); - Orders.Add(new OrderData(10256, "WELLI", "Resende", "Wellington Import Export")); - Orders.Add(new OrderData(10257, "HILAA", "San Cristóbal", "Hila Alimentos")); - Orders.Add(new OrderData(10258, "ERNSH", "Graz", "Ernst Handel")); - Orders.Add(new OrderData(10259, "CENTC", "México D.F.", "Centro comercial")); - Orders.Add(new OrderData(10260, "OTTIK", "Köln", "Ottilies Käseladen")); - Orders.Add(new OrderData(10261, "QUEDE", "Rio de Janeiro", "Que delícia")); - Orders.Add(new OrderData(10262, "RATTC", "Albuquerque", "Rattlesnake Canyon Grocery")); + Data.Add(new OrderData(10248, "VINET", "Reims", "Vins et alcools Chevalier")); + Data.Add(new OrderData(10249, "TOMSP", "Münster", "Toms Spezialitäten")); + Data.Add(new OrderData(10250, "HANAR", "Rio de Janeiro", "Hanari Carnes")); + Data.Add(new OrderData(10251, "VICTE", "Lyon", "Victuailles en stock")); + Data.Add(new OrderData(10252, "SUPRD", "Charleroi", "Suprêmes délices")); + Data.Add(new OrderData(10253, "HANAR", "Rio de Janeiro", "Hanari Carnes")); + Data.Add(new OrderData(10254, "CHOPS", "Bern", "Chop-suey Chinese")); + Data.Add(new OrderData(10255, "RICSU", "Genève", "Richter Supermarkt")); + Data.Add(new OrderData(10256, "WELLI", "Resende", "Wellington Import Export")); + Data.Add(new OrderData(10257, "HILAA", "San Cristóbal", "Hila Alimentos")); + Data.Add(new OrderData(10258, "ERNSH", "Graz", "Ernst Handel")); + Data.Add(new OrderData(10259, "CENTC", "México D.F.", "Centro comercial")); + Data.Add(new OrderData(10260, "OTTIK", "Köln", "Ottilies Käseladen")); + Data.Add(new OrderData(10261, "QUEDE", "Rio de Janeiro", "Que delícia")); + Data.Add(new OrderData(10262, "RATTC", "Albuquerque", "Rattlesnake Canyon Grocery")); } - return Orders; + return Data; } public int OrderID { get; set; } @@ -190,32 +195,29 @@ public class OrderData {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/hDBSDfMKeTVVoBtf?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} +{% previewsample "https://blazorplayground.syncfusion.com/embed/BthSsjCcfTtZWPnL?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} ## AutoFill -The AutoFill feature in the Syncfusion® Blazor DataGrid allows you to copy the data of selected cells and paste it into other cells by simply dragging the autofill icon of the selected cells to the desired cells. This feature provides a convenient way to quickly populate data in a grid. - -**how to use the autofill feature** +The AutoFill feature in the Syncfusion® Blazor DataGrid allows quick data entry by copying values from selected cells and filling them into adjacent cells using a drag handle. -1. Select the cells from which you want to copy data. +**Steps to Use AutoFill Feature** -2. Hover over the bottom-right corner of the selection to reveal the autofill icon. +1. Select the desired cells to copy. +2. Hover over the bottom-right corner of the selection to display the autofill handle. +3. Drag the handle to the target cells. +4. Release the mouse to populate the target cells with the copied data. -3. Click and hold the autofill icon, then drag it to the target cells where you want to paste the copied data. +To enable AutoFill, set the [EnableAutoFill](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableAutoFill) property to `true` and use [batch editing](https://blazor.syncfusion.com/documentation/datagrid/batch-editing) to allow copying values across multiple cells. -4. Release the mouse to complete the autofill action, and the data from the source cells will be copied and pasted into the target cells. - -This feature is enabled by defining [EnableAutoFill](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableAutoFill) property as **true**. - -The following example demonstrates how to enable the autofill feature in the Grid. +**Example: AutoFill with Batch Editing** {% tabs %} {% highlight razor tabtitle="Index.razor" %} @using Syncfusion.Blazor.Grids - + @@ -227,7 +229,7 @@ The following example demonstrates how to enable the autofill feature in the Gri @code { - public List Orders { get; set; } + private List Orders { get; set; } protected override void OnInitialized() { @@ -239,40 +241,40 @@ The following example demonstrates how to enable the autofill feature in the Gri {% highlight c# tabtitle="OrderData.cs" %} -public class OrderData +internal sealed class OrderData { - public static List Orders = new List(); + private static readonly List Data = new List(); public OrderData(int orderID, string customerID, string shipCity, string shipName) { - this.OrderID = orderID; - this.CustomerID = customerID; - this.ShipCity = shipCity; - this.ShipName = shipName; + OrderID = orderID; + CustomerID = customerID; + ShipCity = shipCity; + ShipName = shipName; } - public static List GetAllRecords() + internal static List GetAllRecords() { - if (Orders.Count == 0) + if (Data.Count == 0) { - Orders.Add(new OrderData(10248, "VINET", "Reims", "Vins et alcools Chevalier")); - Orders.Add(new OrderData(10249, "TOMSP", "Münster", "Toms Spezialitäten")); - Orders.Add(new OrderData(10250, "HANAR", "Rio de Janeiro", "Hanari Carnes")); - Orders.Add(new OrderData(10251, "VICTE", "Lyon", "Victuailles en stock")); - Orders.Add(new OrderData(10252, "SUPRD", "Charleroi", "Suprêmes délices")); - Orders.Add(new OrderData(10253, "HANAR", "Rio de Janeiro", "Hanari Carnes")); - Orders.Add(new OrderData(10254, "CHOPS", "Bern", "Chop-suey Chinese")); - Orders.Add(new OrderData(10255, "RICSU", "Genève", "Richter Supermarkt")); - Orders.Add(new OrderData(10256, "WELLI", "Resende", "Wellington Import Export")); - Orders.Add(new OrderData(10257, "HILAA", "San Cristóbal", "Hila Alimentos")); - Orders.Add(new OrderData(10258, "ERNSH", "Graz", "Ernst Handel")); - Orders.Add(new OrderData(10259, "CENTC", "México D.F.", "Centro comercial")); - Orders.Add(new OrderData(10260, "OTTIK", "Köln", "Ottilies Käseladen")); - Orders.Add(new OrderData(10261, "QUEDE", "Rio de Janeiro", "Que delícia")); - Orders.Add(new OrderData(10262, "RATTC", "Albuquerque", "Rattlesnake Canyon Grocery")); + Data.Add(new OrderData(10248, "VINET", "Reims", "Vins et alcools Chevalier")); + Data.Add(new OrderData(10249, "TOMSP", "Münster", "Toms Spezialitäten")); + Data.Add(new OrderData(10250, "HANAR", "Rio de Janeiro", "Hanari Carnes")); + Data.Add(new OrderData(10251, "VICTE", "Lyon", "Victuailles en stock")); + Data.Add(new OrderData(10252, "SUPRD", "Charleroi", "Suprêmes délices")); + Data.Add(new OrderData(10253, "HANAR", "Rio de Janeiro", "Hanari Carnes")); + Data.Add(new OrderData(10254, "CHOPS", "Bern", "Chop-suey Chinese")); + Data.Add(new OrderData(10255, "RICSU", "Genève", "Richter Supermarkt")); + Data.Add(new OrderData(10256, "WELLI", "Resende", "Wellington Import Export")); + Data.Add(new OrderData(10257, "HILAA", "San Cristóbal", "Hila Alimentos")); + Data.Add(new OrderData(10258, "ERNSH", "Graz", "Ernst Handel")); + Data.Add(new OrderData(10259, "CENTC", "México D.F.", "Centro comercial")); + Data.Add(new OrderData(10260, "OTTIK", "Köln", "Ottilies Käseladen")); + Data.Add(new OrderData(10261, "QUEDE", "Rio de Janeiro", "Que delícia")); + Data.Add(new OrderData(10262, "RATTC", "Albuquerque", "Rattlesnake Canyon Grocery")); } - return Orders; + return Data; } public int OrderID { get; set; } @@ -284,46 +286,41 @@ public class OrderData {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/hDLojTCUezbECphd?appbar=true&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - -> * If [EnableAutoFill](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableAutoFill) is set to **true**, then the autofill icon will be displayed on cell selection to copy cells. -> * It requires the selection [Mode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridSelectionSettings.html#Syncfusion_Blazor_Grids_GridSelectionSettings_Mode) to be **Cell**, [CellSelectionMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridSelectionSettings.html#Syncfusion_Blazor_Grids_GridSelectionSettings_CellSelectionMode) to be **Box** and also [EditMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.EditMode.html#fields) to be **Batch**. +{% previewsample "https://blazorplayground.syncfusion.com/embed/BXVIsNicJTjOUEma?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} +> * When [EnableAutoFill](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_EnableAutoFill) is set to `true`, the autofill handle appears on cell selection. +> * AutoFill requires selection [Mode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridSelectionSettings.html#Syncfusion_Blazor_Grids_GridSelectionSettings_Mode) set to `Cell`, [CellSelectionMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridSelectionSettings.html#Syncfusion_Blazor_Grids_GridSelectionSettings_CellSelectionMode) set to `Box`, and [EditMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.EditMode.html#fields) set to `Batch`. ### Limitations -* AutoFill does not automatically convert string values to number or date types. If the selected cells contain string data and are dragged to number-type cells, the target cells will display **NaN**. Similarly, when dragging string-type cells to date-type cells, the target cells will display as an **empty cell**. It is important to ensure data types are compatible before using autofill to avoid unexpected results. - -* The AutoFill feature does not support generating non-linear series or sequential data automatically. Cannot create complex series or patterns by simply dragging cells with non-sequential data. The autofill feature is designed for copying and pasting data from a selected range of cells. - -* The AutoFill feature does not support virtual scrolling or column virtualization in the Grid. - -* The Auto Fill feature can only be applied to the viewport cell when enabling the features of infinite scrolling in the Grid. +- **Data Type Conversion**: AutoFill does not convert string values to numeric or date types. Copying strings into numeric cells results in `NaN`, and copying strings into date cells results in an `empty cell`. +- **Value Copying**: AutoFill copies values directly from the source range without generating non-linear or sequential series. +- **Virtualization**: AutoFill is not supported with virtual scrolling or column virtualization. +- **Infinite Scrolling**: With infinite scrolling, AutoFill applies only to cells within the current viewport. ## Paste -The Syncfusion® Blazor DataGrid provides a paste feature that allows you to copy the content of a cell or a group of cells and paste it into another set of cells. This feature allows you to quickly copy and paste content within the grid, making it convenient for data entry and manipulation. +The Paste feature in the Syncfusion® Blazor DataGrid allows copying content from selected cells and pasting it into another range using Ctrl + C and Ctrl + V. -Follow the steps below to use the Paste feature in the grid: +**To paste data within the grid:** -1. Select the cells from which you want to copy the content. +1. Select the cells to copy. +2. Press Ctrl + C to copy the content. +3. Select the target cells. +4. Press Ctrl + V to paste the copied content. -2. Press the Ctrl + C shortcut key to copy the selected cells' content to the clipboard. - -3. Select the target cells where you want to paste the copied content. - -4. Press the Ctrl + V shortcut key to paste the copied content into the target cells. +**Example: Paste with Batch Editing** {% tabs %} {% highlight razor tabtitle="Index.razor" %} @using Syncfusion.Blazor.Grids - + - + @@ -331,7 +328,7 @@ Follow the steps below to use the Paste feature in the grid: @code { - public List Orders { get; set; } + private List Orders { get; set; } protected override void OnInitialized() { @@ -343,40 +340,40 @@ Follow the steps below to use the Paste feature in the grid: {% highlight c# tabtitle="OrderData.cs" %} -public class OrderData +internal sealed class OrderData { - public static List Orders = new List(); + private static readonly List Data = new List(); public OrderData(int orderID, string customerID, string shipCity, string shipName) { - this.OrderID = orderID; - this.CustomerID = customerID; - this.ShipCity = shipCity; - this.ShipName = shipName; + OrderID = orderID; + CustomerID = customerID; + ShipCity = shipCity; + ShipName = shipName; } - public static List GetAllRecords() + internal static List GetAllRecords() { - if (Orders.Count == 0) + if (Data.Count == 0) { - Orders.Add(new OrderData(10248, "VINET", "Reims", "Vins et alcools Chevalier")); - Orders.Add(new OrderData(10249, "TOMSP", "Münster", "Toms Spezialitäten")); - Orders.Add(new OrderData(10250, "HANAR", "Rio de Janeiro", "Hanari Carnes")); - Orders.Add(new OrderData(10251, "VICTE", "Lyon", "Victuailles en stock")); - Orders.Add(new OrderData(10252, "SUPRD", "Charleroi", "Suprêmes délices")); - Orders.Add(new OrderData(10253, "HANAR", "Rio de Janeiro", "Hanari Carnes")); - Orders.Add(new OrderData(10254, "CHOPS", "Bern", "Chop-suey Chinese")); - Orders.Add(new OrderData(10255, "RICSU", "Genève", "Richter Supermarkt")); - Orders.Add(new OrderData(10256, "WELLI", "Resende", "Wellington Import Export")); - Orders.Add(new OrderData(10257, "HILAA", "San Cristóbal", "Hila Alimentos")); - Orders.Add(new OrderData(10258, "ERNSH", "Graz", "Ernst Handel")); - Orders.Add(new OrderData(10259, "CENTC", "México D.F.", "Centro comercial")); - Orders.Add(new OrderData(10260, "OTTIK", "Köln", "Ottilies Käseladen")); - Orders.Add(new OrderData(10261, "QUEDE", "Rio de Janeiro", "Que delícia")); - Orders.Add(new OrderData(10262, "RATTC", "Albuquerque", "Rattlesnake Canyon Grocery")); + Data.Add(new OrderData(10248, "VINET", "Reims", "Vins et alcools Chevalier")); + Data.Add(new OrderData(10249, "TOMSP", "Münster", "Toms Spezialitäten")); + Data.Add(new OrderData(10250, "HANAR", "Rio de Janeiro", "Hanari Carnes")); + Data.Add(new OrderData(10251, "VICTE", "Lyon", "Victuailles en stock")); + Data.Add(new OrderData(10252, "SUPRD", "Charleroi", "Suprêmes délices")); + Data.Add(new OrderData(10253, "HANAR", "Rio de Janeiro", "Hanari Carnes")); + Data.Add(new OrderData(10254, "CHOPS", "Bern", "Chop-suey Chinese")); + Data.Add(new OrderData(10255, "RICSU", "Genève", "Richter Supermarkt")); + Data.Add(new OrderData(10256, "WELLI", "Resende", "Wellington Import Export")); + Data.Add(new OrderData(10257, "HILAA", "San Cristóbal", "Hila Alimentos")); + Data.Add(new OrderData(10258, "ERNSH", "Graz", "Ernst Handel")); + Data.Add(new OrderData(10259, "CENTC", "México D.F.", "Centro comercial")); + Data.Add(new OrderData(10260, "OTTIK", "Köln", "Ottilies Käseladen")); + Data.Add(new OrderData(10261, "QUEDE", "Rio de Janeiro", "Que delícia")); + Data.Add(new OrderData(10262, "RATTC", "Albuquerque", "Rattlesnake Canyon Grocery")); } - return Orders; + return Data; } public int OrderID { get; set; } @@ -388,11 +385,10 @@ public class OrderData {% endhighlight %} {% endtabs %} -{% previewsample "https://blazorplayground.syncfusion.com/embed/hthyNzsUeyrJRGbs?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} - +{% previewsample "https://blazorplayground.syncfusion.com/embed/LDBoWNsGJziFNQMu?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %} -> To perform paste functionality, it requires the selection **mode** to be **Cell**, **cellSelectionMode** to be **Box** and also Batch Editing should be enabled. +> To paste content, set selection [Mode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridSelectionSettings.html#Syncfusion_Blazor_Grids_GridSelectionSettings_Mode) to `Cell`, set [CellSelectionMode](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.GridSelectionSettings.html#Syncfusion_Blazor_Grids_GridSelectionSettings_CellSelectionMode) to `Box`, and enable [Batch editing](https://blazor.syncfusion.com/documentation/datagrid/batch-editing). ### Limitations -* The Paste feature does not automatically convert string values to number or date types. If the selected cells contain string data and are dragged to number-type cells, the target cells will display **NaN**. Similarly, when dragging string-type cells to date-type cells, the target cells will display as an **empty cell**. It is important to ensure data types are compatible before using AutoFill to avoid unexpected results. \ No newline at end of file +- **Data Type Conversion**: Pasting does not convert string values to numeric or date types. Pasting strings into numeric cells results in `NaN`; pasting strings into date cells results in an `empty cell`. Ensure that the pasted values are compatible with the target column's data type. \ No newline at end of file