Exemple #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Occcurs when user clicks on CheckBox.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataCellGotFocus(object sender, RoutedEventArgs e)
        {
            ReportDataWrapper selectedItem = xceedGridReports.CurrentItem as ReportDataWrapper;

            if (null != selectedItem)
            {
                ReportInfo info = App.Current.ReportGenerator.GetReportInfo(selectedItem.Name);
                if (null != info)
                {
                    _selectedProfileName = info.Name;
                    ReportDataWrapper.StartTemplatePath = info.TemplatePath;
                    ReportDataWrapper.StartTemplateName = _selectedProfileName;

                    if (info.IsPredefined)
                    {
                        DataCell cell = sender as DataCell;
                        if (cell.ParentColumn == xceedGridReports.Columns["Name"])
                        {
                            ToolTip tt = new ToolTip();
                            tt.Style     = (Style)mainGrid.FindResource("ErrorToolTipStyle");
                            cell.ToolTip = tt;
                            cell.EndEdit();
                        }
                    }

                    if (!_isEditeStart)
                    {
                        _UpdateButtonsState();
                    }
                }
            }
        }
        /// <summary>
        /// Occurs when user set focus to any grid cell.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DataCellGotFocus(object sender, RoutedEventArgs e)
        {
            if (CurrentProjectName != null)
            {
                ProjectDataWrapper selectedItem = (ProjectDataWrapper)XceedGrid.CurrentItem;
                if (selectedItem == null)
                {
                    return;
                }

                DataCell cell = sender as DataCell;
                if (cell.ParentColumn == XceedGrid.Columns[IS_CURRENT_COLUMN_CAPTION]) // if user clicks to "IsCurrent" cell - don't show editing status.
                {
                    return;
                }

                bool stopEdit = false;
                if (cell.ParentColumn == XceedGrid.Columns[NAME_COLUMN_CAPTION])
                {
                    stopEdit = (string.Compare(SelectedProjectName, CurrentProjectName, true) == 0);
                }

                cell.ReadOnly = stopEdit;
                if (stopEdit)
                {
                    string status = (string)App.Current.FindResource("UnaEditCurrentProjectNameTooltip");
                    cell.ToolTip = status;
                    cell.EndEdit();
                    cell.ParentRow.EndEdit();
                    _isForcingEndEdit = true;

                    App.Current.MainWindow.StatusBar.SetStatus(this, status);
                    _needToUpdateStatus = false;
                }
            }
        }