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

Button2_Click() protected method

protected Button2_Click ( object sender, EventArgs e ) : void
sender object
e System.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("Number Type");
            cells["B1"].PutValue("Format Results");

            cells["A2"].PutValue(DropDownList1.SelectedItem.Text);
            cells["B2"].PutValue(TextBox1.Text, true);

            cells["B2"].SetNumberType((int)(NumberType)Convert.ToInt16(DropDownList1.SelectedItem.Value));


            cells.SetColumnWidth(0, 40);
            cells.SetColumnWidth(1, 40);
        }