using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _139893
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("id", typeof(int)).AutoIncrement = true;
            dt.Columns.Add("Req", typeof(string));
            dt.Columns.Add("Req1", typeof(string));

            dt.Rows.Add(null, "text", "Text");

            ultraGrid1.DataSource = dt;

        }

        private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
           
        }

        private void ultraGrid1_BeforeRowDeactivate(object sender, CancelEventArgs e)
        {
            e.Cancel = System.DBNull.Value.Equals(ultraGrid1.ActiveRow.Cells[1].Value);
            if (e.Cancel)
            {
                MessageBox.Show("Column 'Req' must be filled !!!");
                ultraGrid1.ActiveRow.Cells[1].Activate();
                ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);
            }
        }
    }
}
