'Declaration
Public Class DragRowColEventArgs Inherits System.EventArgs
public class DragRowColEventArgs : System.EventArgs
'Declaration
Public Class DragRowColEventArgs Inherits System.EventArgs
public class DragRowColEventArgs : System.EventArgs
private void Form1_Load(object sender, EventArgs e) { _flex = new C1FlexGrid(); _flex.Dock = DockStyle.Fill; this.Controls.Add(_flex); OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;Data Source=" + Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\ComponentOne Samples\\Common\\C1NWind.mdb"); _ordersTable = new DataTable(); new OleDbDataAdapter("Select * from Orders", con).Fill(_ordersTable); //Set AllowDragging property to Rows _flex.AllowDragging = AllowDraggingEnum.Rows; _flex.BeforeDragRow += _flex_BeforeDragRow; _flex.DataSource = _ordersTable; } private void _flex_BeforeDragRow(object sender, DragRowColEventArgs e) { //Implementation of dragging of rows in a bound flexgrid DataRow drDragged = _ordersTable.Rows[e.Row - 1]; object[] arr1 = drDragged.ItemArray; //Temporary Row to store data of row being dragged DataRow dr1 = _ordersTable.NewRow(); dr1.ItemArray = arr1; _ordersTable.Rows.Remove(drDragged); //Insert row at the new position _ordersTable.Rows.InsertAt(dr1, e.Position - 1); _flex.DataSource = _ordersTable; e.Cancel = true; }
System.Object
System.EventArgs
C1.Win.C1FlexGrid.DragRowColEventArgs