public MainWindow() { InitializeComponent(); gridcontrol.Width = 820; gridcontrol.Height = 470; gridcontrol.Model.RowCount = 20; gridcontrol.Model.ColumnCount = 10; gridcontrol.QueryCellInfo += Gridcontrol_QueryCellInfo; //Enable the show tooltip GridTooltipService.SetShowTooltips(gridcontrol, true); //Set tooltip for specific cell gridcontrol.Model[1, 1].ToolTip = " Grid (" + gridcontrol.Model[1, 1].CellValue + ") "; gridcontrol.Model[1, 1].ShowTooltip = true; gridcontrol.Model[1, 1].Enabled = false; //Set tooltip for specific row gridcontrol.Model.RowStyles[1].ToolTip = " First row "; gridcontrol.Model.RowStyles[1].ShowTooltip = true; //Set tooltip for specific column gridcontrol.Model.ColStyles[1].ToolTip = " First column "; gridcontrol.Model.ColStyles[1].ShowTooltip = true; }
public MainWindow() { InitializeComponent(); Width = 1000; Height = 600; this.LoadData(); grid.Width = 700; grid.Height = 400; grid.Model.HeaderStyle.Borders.All = new System.Windows.Media.Pen(System.Windows.Media.Brushes.LightGray, 1); grid.Model.RowCount = dataTable.Rows.Count; grid.Model.ColumnCount = dataTable.Columns.Count; grid.Model.RowHeights.DefaultLineSize = 30; grid.Model.ColumnWidths.DefaultLineSize = 115; grid.Model.ColumnWidths[0] = 115; grid.QueryCellInfo += Grid_QueryCellInfo; grid.Model.Options.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell; //Add input message tip for specific row for (int i = 1; i <= 4; i++) { string comment = grid.Model[1, 0].CellValue + " :\nPopulation rate in " + grid.Model[1, i].ColumnIndex + " is " + grid.Model[1, i].CellValue; grid.Model[1, i].DataValidationTooltip = comment; grid.Model[1, i].ShowDataValidationTooltip = true; } //Add input message tip for specific column for (int i = 1; i <= 4; i++) { string comment = grid.Model[i, 0].CellValue + " :\nPopulation rate in " + grid.Model[i, 2].RowIndex + " is " + grid.Model[i, 2].CellValue; grid.Model[i, 2].DataValidationTooltip = comment; grid.Model[i, 2].ShowDataValidationTooltip = true; } GridTooltipService.SetShowTooltips(grid, true); }
/// <summary> /// Handles the ModelLoaded event of the AssociatedObject control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> void AssociatedObject_ModelLoaded(object sender, EventArgs e) { GridTooltipService.SetShowTooltips(this.AssociatedObject.InternalGrid, true); GridTooltipService.SetTooltipDelay(this.AssociatedObject.InternalGrid, 200); this.AssociatedObject.Model.Options.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell; this.AssociatedObject.Model.RowHeights.DefaultLineSize = 30; this.AssociatedObject.InternalGrid.QueryCellInfo += new GridQueryCellInfoEventHandler(InternalGrid_QueryCellInfo); this.AssociatedObject.Model.QueryCoveredRange += new GridQueryCoveredRangeEventHandler(Model_QueryCoveredRange); }
public MainWindow() { InitializeComponent(); gridcontrol.Width = 820; gridcontrol.Height = 470; gridcontrol.Model.RowCount = 20; gridcontrol.Model.ColumnCount = 10; gridcontrol.QueryCellInfo += Gridcontrol_QueryCellInfo; //Enable the show tooltip GridTooltipService.SetShowTooltips(gridcontrol, true); }
private void AssciatedObject_ModelLoaded(object sender, EventArgs e) { this.AssociatedObject.InternalGrid.QueryCoveredRange += new GridQueryCoveredRangeEventHandler(QueryCoveredRange); this.AssociatedObject.InternalGrid.QueryCellInfo += new GridQueryCellInfoEventHandler(QyeryCellInfo); //this.AssociatedObject.InternalGrid.CommitCellInfo += new GridCommitCellInfoEventHandler(CommitCell); this.AssociatedObject.InternalGrid.CurrentCellValidating += new CurrentCellValidatingEventHandler(CellValidating); this.AssociatedObject.InternalGrid.Model.Options.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell; this.AssociatedObject.InternalGrid.Model.Options.ShowErrorIconOnEditing = true; GridTooltipService.SetShowTooltips(this.AssociatedObject.InternalGrid, true); GridCommentService.SetShowComment(this.AssociatedObject.InternalGrid, true); //this.AssociatedObject.InternalGrid.Model.SaveCellText += new GridCellTextEventHandler(Savetext); }