void cbTable_SelectedIndexChanged(object sender, EventArgs e) { // Clear the mappings Mappings = new List <ColumnPropertyMapping>(); FromTableChanged.RaiseEventEx(this); MappingsChanged.RaiseEventEx(this); }
private void control_SelectedIndexChanged(object sender, EventArgs e) { ComboBoxEx box = sender as ComboBoxEx; if (box == null) { return; } // Get the other CB on this row, then re-sort its items. int row = gridControl.IndexOf(box); var boxes = gridControl.GetControlFrom <ComboBox>(row); // If this is the last row and it now has both columns set, // add a new blank row if (row == gridControl.ItemCount - 1 && boxes.Left.SelectedIndex > -1 && boxes.Right.SelectedIndex > -1) { // By default the remove button in the empty row is disabled. // Now that the row has data, enable it. gridControl.GetButtonFrom(row).Enabled = true; AddEmptyRow(); } // Only trigger the event if both sides are set to something. // Otherwise, only half the mapping is set, and nothing will // have actually changed yet. if (boxes.Left.SelectedIndex > -1 && boxes.Right.SelectedIndex > -1) { MappingsChanged.RaiseEventEx(this); } }
private void removeButton_Click(object sender, EventArgs e) { Button button = sender as Button; if (button == null) { return; } int row = gridControl.IndexOf(button); gridControl.RemoveRow(row); MappingsChanged.RaiseEventEx(this); }
void cbEntity_SelectedIndexChanged(object sender, EventArgs e) { Mappings = new List <ColumnPropertyMapping>(); ToEntityChanged.RaiseEventEx(this); MappingsChanged.RaiseEventEx(this); }