示例#1
0
        private void AddGridTableStyle()
        {
            DataGridTableStyle ts = new DataGridTableStyle();

            ts.MappingName          = dsdm.Tables[0].TableName;
            ts.AlternatingBackColor = Color.Beige;
            ts.BackColor            = Color.GhostWhite;
            ts.ForeColor            = Color.MidnightBlue;
            ts.GridLineColor        = Color.RoyalBlue;
            ts.HeaderBackColor      = Color.MidnightBlue;
            ts.HeaderForeColor      = Color.Lavender;
            ts.SelectionBackColor   = Color.FromArgb(0, 255, 255);
            ts.SelectionForeColor   = Color.PaleGreen;
            ts.RowHeaderWidth       = 5;

            FormattableBooleanColumn discontinuedCol = new FormattableBooleanColumn();

            discontinuedCol.MappingName = "chon";
            discontinuedCol.HeaderText  = "Chọn";
            discontinuedCol.Width       = 30;
            discontinuedCol.AllowNull   = false;

            discontinuedCol.SetCellFormat    += new FormatCellEventHandler(SetCellFormat);
            discontinuedCol.BoolValueChanged += new BoolValueChangedEventHandler(BoolValueChanged);
            ts.GridColumnStyles.Add(discontinuedCol);
            dataGrid1.TableStyles.Add(ts);

            FormattableTextBoxColumn TextCol = new FormattableTextBoxColumn();

            TextCol.MappingName    = "ten";
            TextCol.HeaderText     = "Tên";
            TextCol.Width          = 365;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "dang";
            TextCol.HeaderText     = "ĐVT";
            TextCol.Width          = 50;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "tenhc";
            TextCol.HeaderText     = "Hoạt chất";
            TextCol.Width          = 305;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);
        }
示例#2
0
        private void AddGridTableStyle()
        {
            DataGridTableStyle ts = new DataGridTableStyle();

            ts.MappingName          = ds.Tables[0].TableName;
            ts.AlternatingBackColor = Color.Beige;
            ts.BackColor            = Color.GhostWhite;
            ts.ForeColor            = Color.MidnightBlue;
            ts.GridLineColor        = Color.RoyalBlue;
            ts.HeaderBackColor      = Color.MidnightBlue;
            ts.HeaderForeColor      = Color.Lavender;
            ts.SelectionBackColor   = Color.FromArgb(0, 255, 255);
            ts.SelectionForeColor   = Color.PaleGreen;
            ts.RowHeaderWidth       = 10;

            FormattableBooleanColumn discontinuedCol = new FormattableBooleanColumn();

            discontinuedCol.MappingName = "chon";
            discontinuedCol.HeaderText  = "Sao lưu";
            discontinuedCol.Width       = 50;
            discontinuedCol.AllowNull   = false;

            discontinuedCol.SetCellFormat    += new FormatCellEventHandler(SetCellFormat);
            discontinuedCol.BoolValueChanged += new BoolValueChangedEventHandler(BoolValueChanged);
            ts.GridColumnStyles.Add(discontinuedCol);
            dataGrid1.TableStyles.Add(ts);

            FormattableTextBoxColumn TextCol = new FormattableTextBoxColumn();

            TextCol.MappingName    = "noidung";
            TextCol.HeaderText     = "Cơ sở dữ liệu";
            TextCol.Width          = 180;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            FormattableBooleanColumn discontinuedCol1 = new FormattableBooleanColumn();

            discontinuedCol1.MappingName = "huy";
            discontinuedCol1.HeaderText  = "Không dùng";
            discontinuedCol1.Width       = 50;
            discontinuedCol1.AllowNull   = false;

            discontinuedCol1.SetCellFormat    += new FormatCellEventHandler(SetCellFormat);
            discontinuedCol1.BoolValueChanged += new BoolValueChangedEventHandler(BoolValueChanged);
            ts.GridColumnStyles.Add(discontinuedCol1);
            dataGrid1.TableStyles.Add(ts);
        }
示例#3
0
        private void AddGridTableStyle()
        {
            DataGridTableStyle ts = new DataGridTableStyle();

            ts.MappingName          = ds.Tables[0].TableName;
            ts.AlternatingBackColor = Color.Beige;
            ts.BackColor            = Color.GhostWhite;
            ts.ForeColor            = Color.MidnightBlue;
            ts.GridLineColor        = Color.RoyalBlue;
            ts.HeaderBackColor      = Color.MidnightBlue;
            ts.HeaderForeColor      = Color.Lavender;
            ts.SelectionBackColor   = Color.FromArgb(0, 255, 255);
            ts.SelectionForeColor   = Color.PaleGreen;
            ts.RowHeaderWidth       = 10;

            FormattableBooleanColumn discontinuedCol = new FormattableBooleanColumn();

            discontinuedCol.MappingName = "chon";
            discontinuedCol.HeaderText  = "Chọn";
            discontinuedCol.Width       = 35;
            discontinuedCol.AllowNull   = false;

            discontinuedCol.SetCellFormat    += new FormatCellEventHandler(SetCellFormat);
            discontinuedCol.BoolValueChanged += new BoolValueChangedEventHandler(BoolValueChanged);
            ts.GridColumnStyles.Add(discontinuedCol);
            dataGrid1.TableStyles.Add(ts);

            FormattableTextBoxColumn TextCol = new FormattableTextBoxColumn();

            TextCol.MappingName    = "mabn";
            TextCol.HeaderText     = "Mã BN";
            TextCol.Width          = 60;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "hoten";
            TextCol.HeaderText     = "Họ tên";
            TextCol.Width          = 200;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "namsinh";
            TextCol.HeaderText     = "NS";
            TextCol.Width          = 40;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "ngayvao";
            TextCol.HeaderText     = "Ngày vào";
            TextCol.Width          = 100;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "ngayra";
            TextCol.HeaderText     = "Ngày ra";
            TextCol.Width          = 100;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "doituong";
            TextCol.HeaderText     = "Đối tượng";
            TextCol.Width          = 100;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "sothe";
            TextCol.HeaderText     = "Số thẻ";
            TextCol.Width          = 100;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);
        }
示例#4
0
        private void AddGridTableStyle()
        {
            DataGridTableStyle ts = new DataGridTableStyle();

            ts.MappingName          = ds.Tables[0].TableName;
            ts.AlternatingBackColor = Color.Beige;
            ts.BackColor            = Color.GhostWhite;
            ts.ForeColor            = Color.MidnightBlue;
            ts.GridLineColor        = Color.RoyalBlue;
            ts.HeaderBackColor      = Color.MidnightBlue;
            ts.HeaderForeColor      = Color.Lavender;
            ts.SelectionBackColor   = Color.FromArgb(0, 255, 255);
            ts.SelectionForeColor   = Color.PaleGreen;
            ts.RowHeaderWidth       = 3;
            ts.AllowSorting         = false;

            FormattableBooleanColumn discontinuedCol = new FormattableBooleanColumn();

            discontinuedCol.MappingName = "chon";
            discontinuedCol.HeaderText  = "Duyệt";
            discontinuedCol.Width       = 35;
            discontinuedCol.ReadOnly    = false;
            discontinuedCol.AllowNull   = false;

            discontinuedCol.SetCellFormat    += new FormatCellEventHandler(SetCellFormat);
            discontinuedCol.BoolValueChanged += new BoolValueChangedEventHandler(BoolValueChanged);
            ts.GridColumnStyles.Add(discontinuedCol);
            dataGrid1.TableStyles.Add(ts);


            FormattableTextBoxColumn TextCol = new FormattableTextBoxColumn();

            TextCol.MappingName    = "ngay";
            TextCol.HeaderText     = "Ngày";
            TextCol.Width          = 55;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "ten";
            TextCol.HeaderText     = "Tên thuốc - hàm lượng";
            TextCol.Width          = 150;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "dang";
            TextCol.HeaderText     = "ĐVT";
            TextCol.Width          = 30;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "slylenh";
            TextCol.HeaderText     = "SL";
            TextCol.Width          = 45;
            TextCol.Format         = "### ##0.00";
            TextCol.Alignment      = HorizontalAlignment.Right;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "tenkp";
            TextCol.HeaderText     = "Khoa";
            TextCol.Width          = 80;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "tenbs";
            TextCol.HeaderText     = "Bác sĩ";
            TextCol.Width          = 150;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "mabn";
            TextCol.HeaderText     = "Mã BN";
            TextCol.Width          = 60;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "hoten";
            TextCol.HeaderText     = "Họ tên bệnh nhân";
            TextCol.Width          = 160;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);
        }
示例#5
0
        private void AddGridTableStyle()
        {
            DataGridTableStyle ts = new DataGridTableStyle();

            ts.MappingName          = dt.TableName;
            ts.AlternatingBackColor = Color.Beige;
            ts.BackColor            = Color.GhostWhite;
            ts.ForeColor            = Color.MidnightBlue;
            ts.GridLineColor        = Color.RoyalBlue;
            ts.HeaderBackColor      = Color.MidnightBlue;
            ts.HeaderForeColor      = Color.Lavender;
            ts.SelectionBackColor   = Color.FromArgb(0, 255, 255);
            ts.SelectionForeColor   = Color.PaleGreen;
            ts.RowHeaderWidth       = 5;

            FormattableBooleanColumn discontinuedCol = new FormattableBooleanColumn();

            discontinuedCol.MappingName = "chon";
            discontinuedCol.HeaderText  = "Chọn";
            discontinuedCol.Width       = 30;
            discontinuedCol.AllowNull   = false;

            discontinuedCol.SetCellFormat    += new FormatCellEventHandler(SetCellFormat);
            discontinuedCol.BoolValueChanged += new BoolValueChangedEventHandler(BoolValueChanged);
            ts.GridColumnStyles.Add(discontinuedCol);
            dataGrid1.TableStyles.Add(ts);

            FormattableTextBoxColumn TextCol = new FormattableTextBoxColumn();

            TextCol.MappingName    = "mabn";
            TextCol.HeaderText     = "Mã BN";
            TextCol.Width          = 60;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "idcls";
            TextCol.HeaderText     = "ID CLS";
            TextCol.Width          = 70;
            TextCol.ReadOnly       = true;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "hoten";
            TextCol.HeaderText     = "Họ tên";
            TextCol.Width          = 150;
            TextCol.ReadOnly       = false;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "tuoi";
            TextCol.HeaderText     = "Tuổi";
            TextCol.Width          = 30;
            TextCol.ReadOnly       = false;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "loai";
            TextCol.HeaderText     = "Loại";
            TextCol.Width          = 80;
            TextCol.ReadOnly       = false;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);

            TextCol                = new FormattableTextBoxColumn();
            TextCol.MappingName    = "vung";
            TextCol.HeaderText     = "Vùng";
            TextCol.Width          = 150;
            TextCol.ReadOnly       = false;
            TextCol.SetCellFormat += new FormatCellEventHandler(SetCellFormat);
            ts.GridColumnStyles.Add(TextCol);
            dataGrid1.TableStyles.Add(ts);
        }