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 { } }
private void FieldGridDoubleClick(object sender, GridTableControlCellClickEventArgs e) { var f = fieldTypeGrid1.Adapter.SelectedItem; if (f != null) { var value = string.Format("[{0}]", f.Name); AddTextToExpression(value); } }
/// <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; } }
private void OnFieldGridDoubleClick(object sender, GridTableControlCellClickEventArgs e) { if (FieldIndex == -1) { return; } var fld = fieldTypeGrid1.Adapter.SelectedItem; if (fld != null) { richTextBox1.SelectedText = "[" + fld.Name + "] "; } }
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(); } }
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 + ""); } }
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); }
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; } } } }
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(); }
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(); } }
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; } }
/// <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); } }
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; } } }
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(); } } }
private void GGCVista_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e) { GridCurrentCell cc = e.TableControl.CurrentCell; }
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); } } }