protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.SelectionModes); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = GetString(Resource.String.SelectionModesTitle); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); var grid = FindViewById <FlexGrid>(Resource.Id.Grid); var modes = FindViewById <Spinner>(Resource.Id.Spinner); SelectionTextView = FindViewById <TextView>(Resource.Id.SelectionTextView); SelectionTextView.Text = ""; var items = new GridSelectionMode[] { GridSelectionMode.None, GridSelectionMode.Cell, GridSelectionMode.CellRange, GridSelectionMode.Row, GridSelectionMode.RowRange }; var adapteritems = Resources.GetStringArray(Resource.Array.SelectionModeTable); modes.Adapter = new ArrayAdapter(BaseContext, global::Android.Resource.Layout.SimpleSpinnerItem, adapteritems); modes.SetSelection(2); modes.ItemSelected += (s, e) => { grid.SelectionMode = items[modes.SelectedItemPosition]; }; grid.ItemsSource = Customer.GetCustomerList(100); grid.SelectionChanged += OnSelectionChanged; }
/// <summary> /// Specifies whether multiple or single selection is allowed. /// </summary> /// <example> /// <code lang="CS"> /// <%= Html.Kendo().Grid(Model) /// .Name("Grid") /// .Selectable(selection => selection.Mode((bool)ViewData["selectionMode"])) /// %> /// </code> /// </example> /// <remarks> /// The Mode method is useful to switch between different selection modes. /// </remarks> public GridSelectionSettingsBuilder Mode(GridSelectionMode mode) { settings.Mode = mode; return this; }
///<summary></summary> public ODGrid() { //InitializeComponent();// Required for Windows.Forms Class Composition Designer support //Add any constructor code after InitializeComponent call columns=new ODGridColumnCollection(); rows=new ODGridRowCollection(); vScroll=new VScrollBar(); vScroll.Scroll+=new ScrollEventHandler(vScroll_Scroll); vScroll.MouseEnter+=new EventHandler(vScroll_MouseEnter); vScroll.MouseLeave+=new EventHandler(vScroll_MouseLeave); vScroll.MouseMove+=new MouseEventHandler(vScroll_MouseMove); hScroll=new HScrollBar(); hScroll.Scroll+=new ScrollEventHandler(hScroll_Scroll); hScroll.MouseEnter+=new EventHandler(hScroll_MouseEnter); hScroll.MouseLeave+=new EventHandler(hScroll_MouseLeave); hScroll.MouseMove+=new MouseEventHandler(hScroll_MouseMove); this.Controls.Add(vScroll); this.Controls.Add(hScroll); selectedIndices=new ArrayList(); selectedCell=new Point(-1,-1); selectionMode=GridSelectionMode.One; selectedRowColor=Color.Silver; allowSelection=true; wrapText=true; noteSpanStart=0; noteSpanStop=0; sortedByColumnIdx=-1; float[] arrayTabStops={50.0f}; _format=new StringFormat(); _format.SetTabStops(0.0f,arrayTabStops); }
/// <summary> /// Specifies whether multiple or single selection is allowed. /// </summary> /// <example> /// <code lang="CS"> /// <%= Html.Kendo().Grid(Model) /// .Name("Grid") /// .Selectable(selection => selection.Mode((bool)ViewData["selectionMode"])) /// %> /// </code> /// </example> /// <remarks> /// The Mode method is useful to switch between different selection modes. /// </remarks> public GridSelectionSettingsBuilder Mode(GridSelectionMode mode) { settings.Mode = mode; return(this); }
/// <summary>listGridRows must have tags set.</summary> public FormGridSelection(List <GridColumn> listGridColumns, List <GridRow> listGridRows, string formTitle, string gridTitle, GridSelectionMode selectMode = GridSelectionMode.One) { InitializeComponent(); Lan.F(this); _listGridColumns = listGridColumns; _listGridRows = listGridRows; this.Text = formTitle; gridMain.Title = gridTitle; gridMain.SelectionMode = selectMode; }