コード例 #1
0
ファイル: ColumnFeature.cs プロジェクト: webgrid/WebGrid
        public void GridSaveMethodEditMode()
        {
            Grid grid = new Grid();

            SetupGrid(grid);

            grid.StayEdit = true;
            grid.MasterTable.Rows[0]["CategoryName"].Value = "Beverages..."; //Value that already exists in database.
            grid.RaisePostBackEvent("RecordUpdateClick!!False");
            grid.Save();
            Assert.AreEqual(grid.Mode, Mode.Edit);
        }
コード例 #2
0
ファイル: ColumnFeature.cs プロジェクト: webgrid/WebGrid
        public void GridSaveMethodGridMode()
        {
            Grid grid = new Grid();

            SetupGrid(grid);
            grid.RaisePostBackEvent("RecordCancelClick!");
            grid.Mode = Mode.Grid;
            grid["CategoryName"].AllowEditInGrid = true;
            grid["Description"].AllowEditInGrid = true;
            grid["CategoryId"].AllowEditInGrid = true;
            grid["CategoryId"].Visibility = Visibility.Both;
            grid.MasterTable.Rows[0]["CategoryName"].Value = "Beverages..."; //Value that already exists in database.
            grid.Save();

            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            HtmlTextWriter gridwriter = new HtmlTextWriter(sw);
            grid.RenderControl(gridwriter);

            Assert.AreEqual("Beverages...", grid.MasterTable.Rows[0]["CategoryName"].Value.ToString());

            Assert.AreEqual(grid.Mode, Mode.Grid);
        }
コード例 #3
0
ファイル: ColumnFeature.cs プロジェクト: webgrid/WebGrid
        public void GridSaveMethodEditMode()
        {
            Grid grid = new Grid();

            SetupGrid(grid);

            grid.StayInDetail = true;
            grid.MasterTable.Rows[0]["CategoryName"].Value = "Beverages...";
            grid.RaisePostBackEvent("RecordUpdateClick!!False");
            grid.Save();
            Assert.AreEqual(grid.DisplayView, DisplayView.Detail);
        }