Hi Syncfusion Support Team,
I'm using DragDrop feature in GridComponent.
By default, the width of Drag row is not equal with the grid's width.
My requirement is: set the width of Drag row is equal with the grid's width.
How can I config to reach the requirement?
Thanks.
Hi Ton,
We are currently investigating the reported scenario of "How to set full width for Drag row". Rest assured that we are doing our best to resolve this as soon as possible. We will provide you with a detailed update on or before March 9th, 2023. In the meantime, we appreciate your patience and understanding.
Regards,
Santhosh Iruthayaraj
Hi Ton,
Query: set the width of Drag row is equal with the grid's width.
We have reviewed your query and are pleased to inform you that we have found a solution that can help you set the width of the drag row equal to the Grid's width. To achieve this, we recommend setting the drag row style using the cloneElement property inside the rowDragStartHelper event. We have prepared a code snippet that demonstrates how this can be achieved. Please see below for the code snippet:
[index.js]
function rowDragStartHelper(args) { args.cloneElement.style.width = gridInstance.element.offsetWidth + 'px'; }
<GridComponent ref={(g) => { gridInstance = g }} dataSource={orderDetails} allowRowDragAndDrop={true} height="400" selectionSettings={{ type: 'Multiple' }} rowDragStartHelper={rowDragStartHelper} > |
[index.css]
.e-draganddrop > table > tbody > tr > td{ width: fit-content !important; }
.e-draganddrop > table { width: inherit !important; } |
We have also attached the sample for your reference.
Sample: https://stackblitz.com/edit/react-ypvgrr?file=index.css,index.js
If you have any further queries or concerns, please do not hesitate to reach out to us.
Regards,
Santhosh I
Thanks for your support.
Hi Ton,
Hope the provided solution helped to solve the issue. Please get back to us for further assistance.
We are marking this forum as solved.
Regards,
Suganya Gopinath.