Spread Windows Forms 11.0 Product Documentation
Using Touch Support when Moving Columns or Rows
Spread Windows Forms 11.0 Product Documentation > Developer's Guide > Using Touch Support with the Component > Using Touch Support > Using Touch Support when Moving Columns or Rows

You can use touch gestures to move columns or rows.

Press the column header or row header to select it, then slide to the target location. Release to move the column or row.

Select a column or row header range and then press and slide to move the range. Release to complete the action.

The AllowColumnMove property must be true to move columns. AllowColumnMove and AllowColumnMoveMultiple must be true to move multiple columns. The AllowRowMove property must be true to move rows. AllowRowMove and AllowRowMoveMultiple must be true to move multiple rows. The AllowRowMoveDataAllowAddNew property must be true to move a row below the add new row or asterisk row.

Refer to Using Touch Support with Selections for more information on how to select a column or row.

Using Code

This example sets the AllowColumnMove, AllowColumnMoveMultiple, AllowRowMove, and AllowRowMoveMultiple properties.

CS
Copy Code
fpSpread1.AllowColumnMove = true;
fpSpread1.AllowColumnMoveMultiple = true;
fpSpread1.AllowRowMove = true;
fpSpread1.AllowRowMoveMultiple = true;
VB
Copy Code
fpSpread1.AllowColumnMove = True
fpSpread1.AllowColumnMoveMultiple = True
fpSpread1.AllowRowMove = True
fpSpread1.AllowRowMoveMultiple = True

Using Code

This example sets the AllowRowMoveDataAllowAddNew property after binding the control. The DataAllowAddNew property must be true to allow the asterisk row.

CS
Copy Code
DataSet ds = new DataSet();
DataTable emp = new DataTable("Employees");
DataTable div = new DataTable("Division");
emp.Columns.Add("LastName");
emp.Columns.Add("FirstName");
emp.Rows.Add(new Object[] { "Jones", "Marianne" });
emp.Rows.Add(new Object[] { "Fieldes", "Anna" });
div.Columns.Add("Section");
div.Columns.Add("Specialty");
div.Rows.Add(new Object[] { "Finance", "Taxes" });
div.Rows.Add(new Object[] { "Mergers", "Legal" });
ds.Tables.AddRange(new DataTable[] { emp, div });
fpSpread1.DataSource = ds;
fpSpread1.DataMember = "Division";
fpSpread1.AllowRowMove = true;
fpSpread1.AllowRowMoveMultiple = true;
fpSpread1.ActiveSheet.DataAllowAddNew = true;
fpSpread1.AllowRowMoveDataAllowAddNew = true;
VB
Copy Code
Dim ds As New DataSet()
Dim emp As New DataTable("Employees")
Dim div As New DataTable("Division")
emp.Columns.Add("LastName")
emp.Columns.Add("FirstName")
emp.Rows.Add(New Object() {"Jones", "Marianne"})
emp.Rows.Add(New Object() {"Fieldes", "Anna"})
div.Columns.Add("Section")
div.Columns.Add("Specialty")
div.Rows.Add(New Object() {"Finance", "Taxes"})
div.Rows.Add(New Object() {"Mergers", "Legal"})
ds.Tables.AddRange(New DataTable() {emp, div})
fpSpread1.DataSource = ds
fpSpread1.DataMember = "Division"
fpSpread1.AllowRowMove = True
fpSpread1.AllowRowMoveMultiple = True
fpSpread1.ActiveSheet.DataAllowAddNew = True
fpSpread1.AllowRowMoveDataAllowAddNew = True
See Also