protected void btnUnfreeze_Click(object sender, EventArgs e)
        {
            // ExStart:UnfreezePanes
            // Accessing the reference of the worksheet that is currently active
            GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];

            // Unfreezing rows and columns
            sheet.UnFreezePanes();
            // ExEnd:UnfreezePanes
        }
Beispiel #2
0
        private void BindWithoutInSheetHeaders()
        {
            // Create dataset object
            this.dataSet11 = new DataSet1();

            // Create database object
            ExampleDatabase db = new ExampleDatabase();

            // Create path to database file
            string path = (this.Master as Site).GetDataDir();

            // Create connection string
            db.oleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + "\\Miscellaneous\\Database\\demos.mdb";
            try
            {
                // Connects to database and fetches data.
                db.oleDbDataAdapter1.Fill(dataSet11);

                // Create web worksheet object
                GridWorksheet sheet = GridWeb1.WorkSheets[0];

                // Clears the sheet.
                sheet.Cells.Clear();
                sheet.Cells.UnMerge(0, 0, 2, 11);

                // Disables creating in-sheet headers.
                sheet.EnableCreateBindColumnHeader = false;

                // Data cells begin from row 0.
                sheet.BindStartRow = 0;

                // Unfreezes the header rows.
                sheet.UnFreezePanes();

                // Bind the sheet to the dataset.
                sheet.DataBind();
            }
            finally
            {
                // Close database connection
                db.oleDbConnection1.Close();
            }
        }