Exemple #1
0
 private void cmbTestIP_DropDownClosed(object sender, EventArgs e)
 {
     CheckedCombo.ComboBoxSource cs = (CheckedCombo.ComboBoxSource)cmbTestIP.ItemsSource;
 }
Exemple #2
0
        public ReOderAndNumberRows()
        {
            InitializeComponent();
            LSTDATAVALUE     lstDaTa      = new LSTDATAVALUE();
            List <DATAVALUE> lstDataValue = new List <DATAVALUE>();

            for (int i = 0; i < 100; i++)
            {
                DATAVALUE objData = new DATAVALUE();
                objData.SID                = i + 1;
                objData.STen               = "Lớp cha thứ" + (i + 1);
                objData.ObjClasschild      = new DATAVALUE.CLASSCHILD();
                objData.ObjClasschild.SID  = i + 10;
                objData.ObjClasschild.STen = "20130302";
                objData.SNhom              = "Nhom" + i % 3;
                objData.INhom              = i % 3;
                objData.DSoTien1           = i / 4 * 20000;
                objData.DSoTien2           = i / 3 * 50000;
                objData.NgayThang          = "10";
                lstDataValue.Add(objData);
            }
            CheckedCombo.ComboBoxSource cs = new CheckedCombo.ComboBoxSource();
            cs.Add(new CheckedCombo.MyDataItem("All", "All", true, cs.IndexBool));
            //Add other Items you want
            for (int i = 0; i < 5; i++)
            {
                cs.Add(new CheckedCombo.MyDataItem(i.ToString(), "GiaTri" + i.ToString(), true, i + 1));
            }

            //DataBinding
            cmbTestIP.ItemsSource = cs;
            //dt = new DataTable();
            //dt.Columns.Add("STT", typeof(int));
            //dt.Columns.Add("GTRI_TTIN", typeof(string));
            //dt.Columns.Add("HTHI_DIEU_KHIEN", typeof(string));
            //dt.Columns.Add("HTHI_SQL", typeof(string));
            //dt.Columns.Add("Discontinued", typeof(string));
            //string sControl = "Combobox";

            //for (int i = 0; i < 10; i++)
            //{
            //    string sGiaTriTT = "";
            //    if (sControl.Equals("Combobox"))
            //        sGiaTriTT = "001";
            //    else
            //        sGiaTriTT = DateTime.Now.ToString("yyyyMMdd");
            //    dt.NewRow();
            //    dt.Rows.Add(new object[] { i, sGiaTriTT, sControl, "","" });
            //    if (sControl.Equals("Combobox"))
            //        sControl = "Datetime";
            //    else if (sControl.Equals("Datetime"))
            //        sControl = "Textbox";
            //    else
            //        sControl = "Combobox";
            //}
            lstDaTa.LstDataValue     = lstDataValue.ToArray();
            pager.PageSize           = (int)nudPageSize.Value;
            GridView.ItemsSource     = null;
            GridView.ItemsSource     = lstDaTa.LstDataValue;
            GridView.CellValidating += new EventHandler <GridViewCellValidatingEventArgs>(GridView_CellValidating);
            GridView.IsReadOnly      = false;
            ucclThang1.SelectedDatesGridViewChanged += new SelectedDatesChangedGridViewEventHandler(ucclThang1_SelectedDatesGridViewChanged);
            ucclThang1.DisplayDate = DateTime.Now.AddYears(1);
        }