Datagrid, copy with headers (when visible is false)

Hi,

Query 1:
I'm encountering the following problem:
I'm using grids with a column not visible (usualy the primary key).
When I copy some lines with the headers, the headers are shifted.

I attached an example and a screenshot.
The Syncfusion NuGet is 19.1.0.65.

Can you confirm this bug ?


Query 2:
I use some columns to display buttons (see screenshot below, "Planifier" column). If possible, I would prefer not to copy these columns.
Is it possible to make a column not copyable ?


Thanks for your help.
Best regards.
François



Attachment: GridCopyWithHeaders_aedf054e.zip

1 Reply 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team May 27, 2021 01:23 PM UTC

Hi Francois, 

Greetings from Syncfusion support. 

Query 1 : When I copy some lines with the headers, the headers are shifted. 
We have confirmed it as a bug and logged the defect report When having a hidden column the Header and Content misalign when pasting the copied data” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and including the defect fix in our weekly release which is expected to be rolled out by the end of June, 2021.  
       
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.       
 
Query 2 : I would prefer not to copy these columns. Is it possible to make a column not copyable ? 
We suggest you to use HideColumns and ShowColumns method. You can hide the unwanted column, and execute copying and later show that hidden column in DataBound event of Grid. Please refer and use the codes below, 

<GridEvents DataBound="DataBound" ContextMenuItemClicked="OnContextMenuClick" TValue="Order"></GridEvents>public List<string> HideItems = new List<string>() { "Customer Name" };public bool flag = false;
 
public async Task OnContextMenuClick(ContextMenuClickEventArgs<Order> args) 
{ 
    if (args.Item.Id == "copywithheader") 
    { 
        flag = true; 
        await DefaultGrid.HideColumns(HideItems.ToArray()); 
        DefaultGrid.Refresh(); 
    } 
} 
public async Task DataBound(){    if (flag)    {        flag = false;        await this.DefaultGrid.Copy(true);         await DefaultGrid.ShowColumns(HideItems.ToArray());    }}

References :  

Please get back to us if you need further assistance. 

Regards, 
Renjith R 


Marked as answer
Loader.
Up arrow icon