Spread Windows Forms 9.0 Product Documentation
SetInputMapWhenChildHasFocus Method (SpreadView)
Example 


InputMap object
Sets the input map for the view for when a child object has focus.
Syntax
'Declaration
 
Public Overridable Sub SetInputMapWhenChildHasFocus( _
   ByVal value As InputMap _
) 
'Usage
 
Dim instance As SpreadView
Dim value As InputMap
 
instance.SetInputMapWhenChildHasFocus(value)
public virtual void SetInputMapWhenChildHasFocus( 
   InputMap value
)

Parameters

value
InputMap object
Example
This example uses the SetInputMapWhenChildHasFocus method.
DataSet ds = new DataSet();
DataTable fpParent = new DataTable();
DataTable fpChild1 = new DataTable();

fpParent = ds.Tables.Add("SAMPLE");
fpParent.Columns.AddRange(new DataColumn[] { new DataColumn("Column1", Type.GetType("System.String")), new DataColumn("Column2", Type.GetType("System.Int32")) });
fpParent.Rows.Add(new object[] { "Parent1", 0 });
fpParent.Rows.Add(new object[] { "Parent2", 1 });
fpChild1 = ds.Tables.Add("Child1");
fpChild1.Columns.AddRange(new DataColumn[] {new   DataColumn("Column1", Type.GetType("System.String")), new DataColumn("Column2", Type.GetType("System.Int32"))});
fpChild1.Rows.Add(new object[] { "Child1-1", 0 });
fpChild1.Rows.Add(new object[] { "Child1-2", 0 });
fpChild1.Rows.Add(new object[] { "Child1-3", 0 });
fpChild1.Rows.Add(new object[] { "Child2-1", 1 });
fpChild1.Rows.Add(new object[] { "Child2-2", 1 });
fpChild1.Rows.Add(new object[] { "Child2-3", 1 });
ds.Relations.Add("Relation1", fpParent.Columns["Column2"], fpChild1.Columns["Column2"]);
fpSpread1.ActiveSheet.DataSource = ds;
// Expand child hierarchies.
fpSpread1.ActiveSheet.ExpandRow(0, true);
fpSpread1.ActiveSheet.ExpandRow(1, true);

FarPoint.Win.Spread.InputMap im;
im = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
im.Put(new FarPoint.Win.Spread.Keystroke(Keys.P, Keys.None), FarPoint.Win.Spread.SpreadActions.ClearCell);
FarPoint.Win.Spread.SpreadView sv;
sv = fpSpread1.GetRootWorkbook();
sv.SetInputMapWhenChildHasFocus(im);
Dim ds As New DataSet
Dim fpParent As DataTable
Dim fpChild1 As DataTable
fpParent = ds.Tables.Add("SAMPLE")
fpParent.Columns.AddRange(New DataColumn() {New DataColumn("Column1", Type.GetType("System.String")), New DataColumn("Column2", Type.GetType("System.Int32"))})
fpParent.Rows.Add(New Object() {"Parent1", 0})
fpParent.Rows.Add(New Object() {"Parent2", 1})
fpChild1 = ds.Tables.Add("Child1")
fpChild1.Columns.AddRange(New DataColumn() {New DataColumn("Column1", Type.GetType("System.String")), New DataColumn("Column2", Type.GetType("System.Int32"))})
fpChild1.Rows.Add(New Object() {"Child1-1", 0})
fpChild1.Rows.Add(New Object() {"Child1-2", 0})
fpChild1.Rows.Add(New Object() {"Child1-3", 0})
fpChild1.Rows.Add(New Object() {"Child2-1", 1})
fpChild1.Rows.Add(New Object() {"Child2-2", 1})
fpChild1.Rows.Add(New Object() {"Child2-3", 1})
ds.Relations.Add("Relation1", fpParent.Columns("Column2"), fpChild1.Columns("Column2"))
FpSpread1.ActiveSheet.DataSource = ds
' Expand child hierarchies.
FpSpread1.ActiveSheet.ExpandRow(0, True)
FpSpread1.ActiveSheet.ExpandRow(1, True)

Dim im As FarPoint.Win.Spread.InputMap
im = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused)
im.Put(New FarPoint.Win.Spread.Keystroke(Keys.P, Keys.None), FarPoint.Win.Spread.SpreadActions.ClearCell)
Dim sv As FarPoint.Win.Spread.SpreadView
sv = FpSpread1.GetRootWorkbook()
sv.SetInputMapWhenChildHasFocus(im)
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

SpreadView Class
SpreadView Members

 

 


Copyright © GrapeCity, inc. All rights reserved.