How to duplicate selected column?
I am gonna duplicate selected row and column.
I know the way to duplicate the selected row and cell.
Let me know the way to duplicate the selected column.
Regards.
Let me know the way to duplicate the selected column.
Regards.
Michal
SIGN IN To post a reply.
5 Replies
PS
Pavithra Subramaniyam
Syncfusion Team
February 21, 2019 08:36 AM UTC
Hi Michal,
We have analyzed your requirement and If you define same field name for two columns then it will be displayed as duplicate columns in Grid at initial loading.
We are not certain about your exact requirement. We need more details to look into this and provide you a solution. Could you please share the following details for better assistance.
- What is your need to duplicate the columns? At which case?
- Share a video demonstration explaining your exact requirement.
- Share your complete requirement.
- Share a brief description of your complete requirement.
The provided information will help us analyze your requirement, and provide you a solution as early as possible.
Regards,
Pavithra S.
ST
Stefan Tmusic
February 22, 2019 07:43 AM UTC
Thanks.
I have done myself.
I have done myself.
PS
Pavithra Subramaniyam
Syncfusion Team
February 22, 2019 08:57 AM UTC
Hi Michal,
Thanks for your update.
We are happy to hear that you have achieved your requirement.
Please contact us if you need any further assistance. As always, we will be happy to assist you.
Regards,
Pavithra S.
ST
Stefan Tmusic
February 22, 2019 08:59 AM UTC
Let me know other answers.
Thanks
Thanks
PS
Pavithra Subramaniyam
Syncfusion Team
February 22, 2019 12:46 PM UTC
Hi Michal,
We suggest you to push the “column object” of column you wish to duplicate in the “columns” property of Grid. In the below code, in a button click event we have took the instance for the Grid and pushed the column object to be duplicated in the “columns” property and finally we have called the “refresh()” method to reflect the changes in Grid. Please refer the code example below,
|
<button id="duplicate">Duplicate column</button>
<ejs-grid id="Grid" :dataSource="data" height='315px'>
...
</ejs-grid>
document.getElementById("duplicate").addEventListener("click", (e) => {
var obj = document.getElementById('Grid').ej2_instances[0] //Get the instance for Grid
var duplicate = obj.columns[0]; //Get the column to duplicate(Here we have took the first column)
obj.columns.push(duplicate); //Push the column object of the column to be duplicated
obj.refresh(); //refresh the Grid to show the changes
});
|
We are also attaching the sample for your convenience, please download the sample from the link below,
Documentations :
Please get back to us if you need further assistance.
Regards,
Pavithra S.
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
ST Stefan Tmusic
- Feb 20, 2019 04:18 PM UTC
- Feb 22, 2019 12:46 PM UTC