Ejemplo n.º 1
0
        private void Worksheet_BeforeSelectionRangeChange(object sender, unvell.ReoGrid.Events.BeforeSelectionChangeEventArgs e)
        {
            var worksheet = this.reoGridControlMain.CurrentWorksheet;

            if (this.canChangeSelectionRange == false)
            {
                e.IsCancelled = true;
                return;
            }
            if (this.formAssociate != null && this.formAssociate.IsDisposed == false)
            {
                this.formAssociate.Hide();
            }
            //刷新默认值,刷新原选区的第一行和新选区所有行
            List <int> refreshRows = new List <int>();

            refreshRows.Add(worksheet.SelectionRange.Row);
            for (int i = e.StartRow; i <= e.EndRow; i++)
            {
                if (refreshRows.Contains(i))
                {
                    continue;
                }
                refreshRows.Add(i);
            }
            this.RefreshDefaultValue(refreshRows.ToArray());
            //设置联想框SQL
            if (this.formAssociate != null)
            {
                this.formAssociate.ClearAssociationSQL();
                if (this.columnAssociation.ContainsKey(e.StartCol))
                {
                    foreach (string sql in this.columnAssociation[e.StartCol])
                    {
                        this.formAssociate.AddAssociationSQL(sql);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void CurrentWorksheet_BeforeSelectionRangeChange(object sender, unvell.ReoGrid.Events.BeforeSelectionChangeEventArgs e)
 {
     Console.WriteLine("Before SelectionRange Change");
 }