Aspose.Cells.GridWeb.Examples.CSharp.Miscellaneous.Format.ApplyCustomFormats.Button2_Click C# (CSharp) Method

Button2_Click() protected method

protected Button2_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        protected void Button2_Click(object sender, EventArgs e)
        {
            GridWeb1.WorkSheets.Clear();
            GridWeb1.WorkSheets.Add();

            GridCells cells = GridWeb1.WorkSheets[0].Cells;

            cells["A1"].PutValue("Custom Format");
            cells["B1"].PutValue("Format Results");

            cells["A2"].PutValue(TextBox1.Text.Trim());
            cells["B2"].PutValue(TextBox2.Text.Trim(), true);


            cells["B2"].SetCustom(TextBox1.Text.Trim());

            cells.SetColumnWidthPixel(0, 120);
            cells.SetColumnWidthPixel(1, 220);
        }