Ejemplo n.º 1
0
        private void DG2_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            try
            {
                int row = e.Inner.RowIndex - 2;

                AutomaticOrderingModel aom = new AutomaticOrderingModel()
                {
                    Vendor        = DG2.Table.Records[row].GetValue("Vendor").ToString(),
                    VendorID      = DG2.Table.Records[row].GetValue("VendorID").ToString(),
                    Auto_Ordering = bool.Parse(DG2.Table.Records[row].GetValue("Auto_Ordering").ToString()),
                    Method        = DG2.Table.Records[row].GetValue("Method").ToString(),
                    Phone         = DG2.Table.Records[row].GetValue("Phone").ToString(),
                    MON           = bool.Parse(DG2.Table.Records[row].GetValue("MON").ToString()),
                    TUE           = bool.Parse(DG2.Table.Records[row].GetValue("TUE").ToString()),
                    WED           = bool.Parse(DG2.Table.Records[row].GetValue("WED").ToString()),
                    THU           = bool.Parse(DG2.Table.Records[row].GetValue("THU").ToString()),
                    FRI           = bool.Parse(DG2.Table.Records[row].GetValue("FRI").ToString()),
                    SAT           = bool.Parse(DG2.Table.Records[row].GetValue("SAT").ToString()),
                    SUN           = bool.Parse(DG2.Table.Records[row].GetValue("SUN").ToString()),

                    Email      = DG2.Table.Records[row].GetValue("Email").ToString(),
                    OrderTime  = DateTime.Parse(DG2.Table.Records[row].GetValue("OrderTime").ToString()),
                    DayOfMonth = int.Parse(DG2.Table.Records[row].GetValue("DayOfMonth").ToString()),
                };

                using (Edit_Schedule_Info esi = new Edit_Schedule_Info(user, aom))
                {
                    esi.ShowDialog();
                    Refresh();
                }
            } catch { }
        }
Ejemplo n.º 2
0
        private void FieldGridDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            var f = fieldTypeGrid1.Adapter.SelectedItem;

            if (f != null)
            {
                var value = string.Format("[{0}]", f.Name);
                AddTextToExpression(value);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Disable sorting for dependet columns based on other records
        /// </summary>
        void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
        {
            GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex] as GridTableCellStyleInfo;

            if (style != null &&
                style.TableCellIdentity.DisplayElement is GridColumnHeaderRow &&
                style.TableCellIdentity.Column != null &&
                style.TableCellIdentity.Column.Name.IndexOf("Count") != -1)
            {
                MessageBox.Show("Can't sort by this column. Its contents are dependant on the order of records and will change if you sort by another column.");
                e.Inner.Cancel = true;
            }
        }
Ejemplo n.º 4
0
        private void OnFieldGridDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            if (FieldIndex == -1)
            {
                return;
            }

            var fld = fieldTypeGrid1.Adapter.SelectedItem;

            if (fld != null)
            {
                richTextBox1.SelectedText = "[" + fld.Name + "] ";
            }
        }
Ejemplo n.º 5
0
        private void GGC_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            //Notify the double click performed in a cell
            Record rec = GGC.Table.DisplayElements[e.TableControl.CurrentCell.RowIndex].ParentRecord;

            //If(rec) IsNot Nothing Then
            if (rec != null)
            {
                frmStudentDetail       = new frmStudentDetail();
                frmStudentDetail.stdID = (int)rec.GetValue("std_ID");
                frmStudentDetail.viewMode();
                frmStudentDetail.ShowDialog();
            }
        }
Ejemplo n.º 6
0
        private void OnValueDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            if (FieldIndex == -1)
            {
                return;
            }

            var fld = valueCountGrid1.Adapter.SelectedItem;

            if (fld != null)
            {
                richTextBox1.SelectedText = fld.Value + " ";
            }
        }
        private void GGC_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            //Notify the double click performed in a cell
            Record rec = GGC.Table.DisplayElements[e.TableControl.CurrentCell.RowIndex].ParentRecord;

            //If(rec) IsNot Nothing Then
            if (rec != null)
            {
                frmBehaviorDetail    = new frmBehaviorDetail();
                frmBehaviorDetail.PK = (int)(rec.GetValue("PK"));
                frmBehaviorDetail.editMode();
                frmBehaviorDetail.ShowDialog();
                //MessageBox(frmBehaviorDetail.PK + "");
            }
        }
Ejemplo n.º 8
0
        private void GGCMain_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
        {
            Element el  = GGCMain.TableControl.Table.CurrentElement;
            string  DNI = "";

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    DNI = drv[3].ToString(); //show column 2
                }
            }
            CargaGrid(DNI);
        }
Ejemplo n.º 9
0
 private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
 {
     if (e.Inner.MouseEventArgs.Button == MouseButtons.Left)
     {
         if (e.Inner.RowIndex > 1)
         {
             GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
             if (style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionPlusMinusCell)
             {
                 GridCaptionRow curGrp = e.TableControl.Table.NestedDisplayElements[e.Inner.RowIndex] as GridCaptionRow;
                 curGrp.ParentGroup.IsExpanded = !curGrp.ParentGroup.IsExpanded;
             }
         }
     }
 }
Ejemplo n.º 10
0
        private void GGC_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            //Notify the double click performed in a cell
            Record rec = GGC.Table.DisplayElements[e.TableControl.CurrentCell.RowIndex].ParentRecord;

            //If(rec) IsNot Nothing Then
            if (rec != null)
            {
                frmUserDetail           = new frmUserDetail();
                frmUserDetail.TeacherID = rec.GetValue("TeacherID").ToString();
                frmUserDetail.ShowDialog();
                RetrieveData();
            }
            RetrieveData();
        }
Ejemplo n.º 11
0
        private void JoinsGrid_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            int recIndex = Adapter.RowIndexToRecordIndex(e.Inner.RowIndex);

            if (recIndex == -1)
            {
                return;
            }

            var join = Adapter[recIndex];

            if (join != null && JoinDoubleClicked != null)
            {
                JoinDoubleClicked();
            }
        }
Ejemplo n.º 12
0
        void grid_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
        {
            GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);

            if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell &&
                style.TableCellIdentity.Column != null)
            {
                if (style.TableCellIdentity.Column.Name == sortColumn)
                {
                    Sort(sortColumn);
                }
                else
                {
                    sortDirection = ListSortDirection.Ascending;
                    Sort(style.TableCellIdentity.Column.Name);
                }
                e.Inner.Cancel = true;
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Toggling checkbox checked state by clicking on cell outside it.
        /// </summary>
        private void OnTableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
        {
            var model = Table.TableModel[e.Inner.RowIndex, e.Inner.ColIndex];

            if (model == null)
            {
                return;
            }

            if (model.ReadOnly)
            {
                e.Inner.Cancel = true;
                return;
            }

            var cellType = model.CellType;

            if (!string.IsNullOrWhiteSpace(cellType) && cellType.EqualsIgnoreCase("CheckBox"))
            {
                model.CellValue = !(bool)(model.CellValue);
            }
        }
Ejemplo n.º 14
0
        private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
        {
            GridTableCellStyleInfo         style = (GridTableCellStyleInfo)e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex];
            GridTableCellStyleInfoIdentity id    = style.TableCellIdentity;

            if (id.TableCellType == GridTableCellType.ColumnHeaderCell
                )
            {
                // Workaround - gridGroupingControl1_TableControlCellButtonClicked does not get hit so
                // we'll check for the area where the button is and set e.Inner.Cancel = true
                GridCellRendererBase r = e.TableControl.CellRenderers[style.CellType];
                r.PerformLayout(e.Inner.RowIndex, e.Inner.ColIndex, style, e.TableControl.RangeInfoToRectangle(GridRangeInfo.Cell(e.Inner.RowIndex, e.Inner.ColIndex)));
                if (r.RaiseHitTest(e.Inner.RowIndex, e.Inner.ColIndex, e.Inner.MouseEventArgs, null) == GridHitTestContext.CellButtonElement)
                {
                    string column = (id.Column != null) ? id.Column.ToString() : "";
                    string s      = "Clicked on " + id.TableCellType.ToString() + "(" + column + ", " + id.DisplayElement.GetType().Name + ")";

                    MessageBox.Show(s);
                    e.Inner.Cancel = true;
                }
            }
        }
Ejemplo n.º 15
0
        private void Grid_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)
        {
            if (Adapter.ReadOnly)
            {
                return;
            }

            int cmnIndex1 = Adapter.GetColumnIndex(item => item.LowColor);
            int cmnIndex2 = Adapter.GetColumnIndex(item => item.HighColor);

            if (e.Inner.ColIndex != cmnIndex1 && e.Inner.ColIndex != cmnIndex2)
            {
                return;
            }

            int recIndex = Adapter.RowIndexToRecordIndex(e.Inner.RowIndex);

            if (recIndex == -1)
            {
                return;
            }

            var interval = Adapter[recIndex];

            using (var dialog = new ColorDialog())
            {
                dialog.Color    = interval.LowColor;
                dialog.FullOpen = true;
                dialog.AnyColor = true;
                if (dialog.ShowDialog(AppViewFactory.Instance.MainForm) == DialogResult.OK)
                {
                    Adapter.SetProperty(item => item.LowColor, dialog.Color);
                    Refresh();
                }
            }
        }
Ejemplo n.º 16
0
 private void GGCVista_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e)
 {
     GridCurrentCell cc = e.TableControl.CurrentCell;
 }
Ejemplo n.º 17
0
		private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
		{
			if (e.Inner.ColIndex == 9)
			{
				try
				{
					Element el = gridGroupingControl1.Table.GetInnerMostCurrentElement();
					if (el != null)
					{
						GridRecord rec = el as GridRecord;
						if (rec == null && el is GridRecordRow)
						{
							rec = el.ParentRecord as GridRecord;
						}

						if (rec != null)
						{
							int pid = (int)rec.GetValue("ProcessId");
							bool chkd = rec.GetValue("Enabled").Equals (DBNull.Value) ? false :	(bool)rec.GetValue("Enabled");
							DashboardData.UpdateProcessAlert(pid, ConfigUtils.GlobalConfig.UserName, !chkd);
							//int pid = (int)(e.Table).CurrentRecord.GetValue("ProcessId");
							//bool chkd = (bool)(e.Table).CurrentRecord.GetValue("Enabled");
							//DashboardData.UpdateProcessAlert(pid, ConfigUtils.GlobalConfig.UserName, !chkd);
							InvokeRefresh(RefreshType.Full);
						}
					}
				}
				catch (Exception ex){
					log.Error(ex);
				}
			}
		}