Hi Swetaketu Majumder,
Thank you for your interest in Syncfusion products.
Query 1: want to manually reorder a selected
row/record in a grid. |
Currently, we have to handle the Control.DragOver and
Control.DragDrop events to do implement the Drag & Drop functionality in
a GridGroupingControl. In a future release, the GridGroupingControl will be
extended to directly support OLE Drag & Drop. TableControlMouseDown event is handled to begin the dragdrop operation which
occurs only if the mousedown is over a RecordRowHeaderCell. In the
Control.DragDrop event, the selected records are added to the target grid.
With the cursor coordinates, the row and column of the target grid can be
found. Using the row and column, the celltype can be found. If it is a
RecordFieldCell , then the records in the DataObject can be pasted. See the
below sample for code details. Code Snippet[C#]: private void grid_TableControlMouseDown(object sender,
Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlMouseEventArgs e) { GridGroupingControl grid = sender as GridGroupingControl; if(grid!= null) { GridTableControl tableControl = grid.TableControl; Point pt = new Point(e.Inner.X, e.Inner.Y); int row, col; if(tableControl.PointToRowCol(pt, out row, out col)) { GridTableCellStyleInfo style = tableControl.Model[row,
col]; //checking if the cell in which the MouseDown event is a
RecordRowHeaderCell. //If yes, then begins the DragDrop operation. if((style.TableCellIdentity.TableCellType ==
GridTableCellType.RecordRowHeaderCell || style.TableCellIdentity.TableCellType ==
GridTableCellType.AlternateRecordRowHeaderCell) &&
style.TableCellIdentity.DisplayElement.ParentRecord != null &&
style.TableCellIdentity.DisplayElement.ParentRecord.IsSelected()) { DragDropEffects ef = tableControl.DoDragDrop(new
DataObject(grid.Table.SelectedRecords), DragDropEffects.All); if(ef == DragDropEffects.Move) { //need to delete selection if you want to support this } } } } } Moreover, we’ve added a UG link for your better
convenience, Link: http://help.syncfusion.com/ug/windows%20forms/default.htm#!documents/oledraganddrop.htm |
Query 2: How can I allow
multiple selection in the child tables as well? |
Multiple selection can be done in child table by accessing
SelectedRecords collection of the desired child table. For your convenience, code
snippet is given below, Code Snippet[C#]: //For Parent Table. Record r1 = this.gridGroupingControl1.Table.Records[1]; Record r2 = this.gridGroupingControl1.Table.Records[2]; Table t = this.gridGroupingControl1.Table; t.SelectedRecords.Add(r1); t.SelectedRecords.Add(r2); t.SelectedRecords.Add(r3); //For Child Table. Record cr1 =
this.gridGroupingControl1.GetTable("Orders").Records[7]; Record cr2 =
this.gridGroupingControl1.GetTable("Orders").Records[12]; this.gridGroupingControl1.GetTable("Orders").SelectedRecords.Add(or1); this.gridGroupingControl1.GetTable("Orders").SelectedRecords.Add(or2); For your better convenience, we’ve added an UG link below, Link: http://help.syncfusion.com/ug/windows%20forms/default.htm#!documents/multiplerecordselect.htm |
Please let us know, if you have any concerns.
Regards,
ManiRatheenam S