Inheritance: NSTableView, IViewHelper, ITableViewHelper
Exemplo n.º 1
0
		public virtual void SetupTable()
		{
	        tableView = new TableViewHelper();
			tableView.Host = this;
	        tableView.AllowsEmptySelection = true;
			tableView.AllowsMultipleSelection = true;
			tableView.AllowsColumnResizing = true;
			tableView.AllowsColumnSelection = false;
			tableView.HeaderView = null;
			tableView.Activated += delegate(object sender, EventArgs e) {
				List<int> newRow = new List<int>();
				
				if(tableView.SelectedRowCount == 1)
					newRow.Add((int)tableView.SelectedRow);
				else if(tableView.SelectedRowCount > 1)
					
				foreach( var row in tableView.SelectedRows.ToArray())
				{
					newRow.Add((int)row);	
				}
				
				selected_indices.Clear();
				foreach(var row in newRow)
				{
					selected_indices.Add(row);	
				}
			};
			tableView.DataSource = _dataSource;
			tableView.SizeToFit();
			
		}
Exemplo n.º 2
0
        public virtual void SetupTable()
        {
            tableView      = new TableViewHelper();
            tableView.Host = this;
            tableView.AllowsEmptySelection    = true;
            tableView.AllowsMultipleSelection = true;
            tableView.AllowsColumnResizing    = true;
            tableView.AllowsColumnSelection   = false;
            tableView.HeaderView = null;
            tableView.Activated += delegate(object sender, EventArgs e) {
                List <int> newRow = new List <int>();

                if (tableView.SelectedRowCount == 1)
                {
                    newRow.Add((int)tableView.SelectedRow);
                }
                else if (tableView.SelectedRowCount > 1)
                {
                    foreach (var row in tableView.SelectedRows.ToArray())
                    {
                        newRow.Add((int)row);
                    }
                }

                selected_indices.Clear();
                foreach (var row in newRow)
                {
                    selected_indices.Add(row);
                }
            };
            tableView.DataSource = _dataSource;
            tableView.SizeToFit();
        }