protected bool IsEditionValid(GridItem item, GrilleColumn column, string oldValue, string newValue, GridCellValidationEventArgs args)
        {
            int? oid   = item.GetOid();
            bool isKey = column.position == 0;

            if (isKey)
            {
                if (string.IsNullOrWhiteSpace(newValue))
                {
                    args.ErrorContent = column.name + " can't be empty!";
                    args.IsValid      = false;
                    return(false);
                }
            }

            else if (!oid.HasValue)
            {
                LinkedAttributeGrid grid = (LinkedAttributeGrid)this.Grille;
                Object keyValue          = item.Datas[0];
                bool   emptyKeyValue     = keyValue == null || string.IsNullOrWhiteSpace(keyValue.ToString());
                if (emptyKeyValue && !grid.attribute.incremental)
                {
                    args.ErrorContent = "You have to set " + grid.attribute.name + " before set " + column.name;
                    args.IsValid      = false;
                    return(false);
                }
            }
            return(true);
        }
        protected override void OnValidateCell(object sender, GridCellValidationEventArgs args)
        {
            GridItem item = (GridItem)this.gridControl.SelectedItem;

            if (item == null)
            {
                item = (GridItem)this.gridControl.CurrentItem;
            }
            if (item != null)
            {
                ColumnBase   col      = args.Column;
                GrilleColumn column   = this.Grille.GetColumn(col.FieldName);
                string       oldValue = item.Datas[column.position] != null ? item.Datas[column.position].ToString() : "";
                string       newValue = args.Value != null?args.Value.ToString() : "";

                if (!IsEditionValid(item, column, oldValue, newValue, args))
                {
                    args.Handled = true;
                    args.IsValid = false;
                    return;
                }

                GrilleEditedElement element = new GrilleEditedElement();
                element.column     = column;
                element.oid        = item.GetOid();
                element.value      = new Kernel.Domain.Browser.BrowserData();
                element.value.name = newValue;
                if (this.EditEventHandler != null)
                {
                    GrilleEditedResult result = EditEventHandler(element);
                    if (result.isError)
                    {
                        args.Handled      = true;
                        args.IsValid      = false;
                        args.ErrorContent = result.error;
                        return;
                    }
                    else
                    {
                        if (result.datas == null)
                        {
                            args.Handled = true;
                        }
                        else
                        {
                            item.Datas = result.datas;
                        }
                        Refresh();
                    }
                }
            }
        }