예제 #1
0
        private void tileView_ItemCustomize(object sender, TileViewItemCustomizeEventArgs e)
        {
            DataRowView obj = tileView.GetRow(e.RowHandle) as DataRowView;

            if (obj == null)
            {
                return;
            }
            DataSet.ViewTableRow row = obj.Row as DataSet.ViewTableRow;
            if (row == null)
            {
                return;
            }

            e.Item["Category"].Appearance.Normal.BackColor = GetCategoryColor(row.Category);
        }
예제 #2
0
        private void tileView_ItemDrop(object sender, ItemDropEventArgs e)
        {
            var newStatus  = e.GroupColumnValue;
            var prevStatus = e.PrevGroupColumnValue;

            if (!prevStatus.Equals(newStatus))
            {
                tileView.BeginDataUpdate();
                var rowtest = dataSet.ViewTable.FirstOrDefault(x => x.GroupTitle == prevStatus.ToString());
                if (rowtest == null)
                {
                    DataRowView objprev = tileView.GetRow(e.RowHandle) as DataRowView;
                    if (objprev == null)
                    {
                        return;
                    }
                    DataSet.ViewTableRow rowprev = objprev.Row as DataSet.ViewTableRow;
                    if (rowprev == null)
                    {
                        return;
                    }
                    string   prevtitle = prevStatus as string;
                    DateTime dateprev  = DateTime.ParseExact(prevtitle, "ddd(dd.MM)", new CultureInfo("de-DE"));
                    rowprev.GroupTitle = prevtitle;
                    dataSet.ViewTable.AddViewTableRow(rowprev.DayofWeek, rowprev.GroupTitle, "", "", rowprev.DueDate, rowprev.EndDate, "category", 0, "", "");
                }

                DataRowView obj = tileView.GetRow(e.RowHandle) as DataRowView;
                if (obj == null)
                {
                    return;
                }
                DataSet.ViewTableRow row = obj.Row as DataSet.ViewTableRow;
                if (row == null)
                {
                    return;
                }

                string   title = newStatus as string;
                DateTime date  = DateTime.ParseExact(title, "ddd(dd.MM)", new CultureInfo("de-DE"));
                row.DueDate    = date;
                row.DayofWeek  = (int)date.DayOfWeek;
                row.GroupTitle = title;

                tileView.EndDataUpdate();
            }
        }
예제 #3
0
        private void DataTableUpdate()
        {
            dataSet.ViewTable.Clear();
            DateTime startDay = datePicker.DateTime.AddDays(-(int)datePicker.DateTime.DayOfWeek);

            for (int i = 0; i < 7; i++)
            {
                DateTime current    = startDay.AddDays(i);
                String   stringDate = current.ToString("ddd(dd.MM)", CultureInfo.CreateSpecificCulture("de-DE"));
                dataSet.ViewTable.AddViewTableRow(i, stringDate, "", "", current, current, "category", 0, "", "");
            }
            DataSet.ViewTableRow row = dataSet.ViewTable.NewViewTableRow();

            row.DayofWeek  = 7;
            row.Category   = "";
            row.GroupTitle = "To Do";
            dataSet.ViewTable.AddViewTableRow(row);
        }