protected void XGridView1_CommandChanged(object sender, GridCrudCommandEventArgs e)
 {
     SICIL s = e.CreateObject<SICIL>();
     switch(e.CommandType)
     {
         case AppX.UI.Web.GridCrudCommandType.Select:
             base.Response.Redirect("~/FormTest_FormCard.aspx?Id=" + s.SICIL2K);
             break;
         case GridCrudCommandType.Update:
             this.CmdAdapter.Update(s, "SICILKOD", "SICILNO", "ADI");
             break;
     }
 }
        protected void GridConnectionString_CommandChanged(object sender, GridCrudCommandEventArgs e)
        {
            Connection entity = e.CreateObject<Connection>();
            switch (e.CommandType)
            {
                case GridCrudCommandType.Insert:
                    this.Cmd.Insert(entity);
                    break;
                case GridCrudCommandType.Update:
                    entity.Id = e.Item.GetDataKeyValue("Id").ConvertTo<int>();
                    this.Cmd.Update(entity, "Name", "ConnectionString");
                    break;
            }

            this.gridConnectionString.RefreshDataSource();
        }
        protected void OnGridCommandChanged(object sender, GridCrudCommandEventArgs e)
        {
            Connection entity = e.CreateObject<Connection>();
            switch (e.CommandType)
            {
                case GridCrudCommandType.Insert:
                    this.Cmd.Insert(entity);
                    break;
                case GridCrudCommandType.Update:
                    entity.Id = e.Item.GetDataKeyValue("Id").ConvertTo<int>();
                    this.Cmd.Update(entity, "Name", "ConnectionString");
                    break;
                case GridCrudCommandType.Delete:
                    DataUtils.Delete<Connection>(base.DataAccess, DataUtils.DefaultEntityMetaDataProvider(typeof(Connection)), e.Item.GetDataKeyValue("Id").ConvertTo<int>());
                    break;
            }

            this.gridConnectionString.RefreshDataSource();
        }