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 _13
{
    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("Col1", typeof(string)).Expression = "'Col1' + [id]";
            ultraGrid1.DisplayLayout.Override.SelectedRowAppearance.BackColor =  Color.Green;

            for (int i = 0; i < 10; i++)
            {
                dt.Rows.Add();
            }

            ultraGrid1.DataSource = dt;
            ultraGrid1.DrawFilter = new MyDraw();
        }

        private void ultraGrid1_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
        {
            if ((int)e.Row.Cells[0].Value % 3 == 0)
            {
                e.Row.Appearance.BackColor = Color.Red;
            }
        }
    }
}
