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

            sheet.Cells.Clear();

            // Creating an instance of WebBorderStyle
            WebBorderStyle bstyle = new WebBorderStyle();

            // Setting the border style, width and color
            bstyle.BorderStyle = BorderStyle.Double;
            bstyle.BorderWidth = new Unit(3, UnitType.Pixel);
            bstyle.BorderColor = Color.Blue;

            // Applying the instance of WebBorderStyle on a specified range of cells
            sheet.Cells.SetBorders(1, 1, 5, 4, SetBorderPosition.Cross, bstyle);
            // ExEnd:ApplyRangeBorderStyles
        }
Beispiel #2
0
        protected void btnApplyRangeBorderStyles_Click(object sender, EventArgs e)
        {
            // ExStart:ApplyRangeBorderStyles
            // Accessing the reference of the worksheet that is currently active
            GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];

            sheet.Cells.Clear();

            // Creating an instance of WebBorderStyle
            WebBorderStyle bstyle = new WebBorderStyle();

            // Setting the border style, width and color
            bstyle.BorderStyle = BorderStyle.Double;
            bstyle.BorderWidth = new Unit(3, UnitType.Pixel);
            bstyle.BorderColor = Color.Blue;

            // Applying the instance of WebBorderStyle on a specified range of cells
            sheet.Cells.SetBorders(1, 1, 5, 4, SetBorderPosition.Cross, bstyle);
            // ExEnd:ApplyRangeBorderStyles
        }