private void DoInit(bool CallSetDefault)
        {
            _Filter = string.Empty;

            _Entity.OnEntityAction += new EntityAction(_Entity_OnEntityAction);
            IsError = true;

            td = MetaData.GetTableDef(_Entity.GetType());
            Dp.ValidateTableDef(td);
            _Entity.FormMode = FormMode.FormAddNew;
            if (CallSetDefault)
            {
                td.SetDefault(_Entity);
            }
            foreach (FieldDef fld in td.KeyFields.Values)
            {
                _OrderFld = fld;
                break;
            }
        }