Exemplo n.º 1
0
        private void stepsGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                var row = stepsGridView.Rows[e.RowIndex];
                ServiceStep serviceStep = row.Tag as ServiceStep;

                using (var f = new EditServiceStepForm(null, serviceStep.Id))
                {
                    f.Saved += (s, eventArgs) =>
                    {
                        RenderStepsGridViewRow(row, f.ServiceStep);
                        f.Close();
                    };

                    f.ShowDialog();
                }
            }
        }
Exemplo n.º 2
0
        private void addStepButton_Click(object sender, EventArgs e)
        {
            using (var f = new EditServiceStepForm(service.Id))
            {
                DataGridViewRow row = null;

                f.Saved += (s, eventArgs) =>
                {
                    if (row == null)
                    {
                        row = stepsGridView.Rows[stepsGridView.Rows.Add()];
                    }
                    RenderStepsGridViewRow(row, f.ServiceStep);
                    f.Close();
                };

                f.ShowDialog();
            }
        }