当前位置: 首页>>代码示例>>C#>>正文


C# DataGridView.FindForm方法代码示例

本文整理汇总了C#中System.Windows.Forms.DataGridView.FindForm方法的典型用法代码示例。如果您正苦于以下问题:C# DataGridView.FindForm方法的具体用法?C# DataGridView.FindForm怎么用?C# DataGridView.FindForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.DataGridView的用法示例。


在下文中一共展示了DataGridView.FindForm方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataGridViewPresentation

        public DataGridViewPresentation(
			DataGridView dataGridView,
			ToolStripMenuItem exportToExcel,
			ToolStripMenuItem exportToWord,
			ToolStripMenuItem retriveAll,
			ToolStripMenuItem refresh,
			ToolStripMenuItem help,
			ToolStripMenuItem options,
			ToolStripMenuItem navigations,
			ExchangeInfo exchangeInfo)
        {
            mDataGridViewIT = dataGridView;
            if (mDataGridViewIT != null)
            {
                mDataGridViewIT.SelectionChanged += new EventHandler(HandleDataGridITCurrentCellChanged);
                mDataGridViewIT.Scroll += new ScrollEventHandler(HandleDataGridViewITScroll);
                mDataGridViewIT.DataError += new DataGridViewDataErrorEventHandler(HandleDataDridViewITDataError);
                mDataGridViewIT.KeyDown += new KeyEventHandler(HandleDataGridViewITKeyDown);
                mDataGridViewIT.DoubleClick += new EventHandler(HandleDataGridViewITDoubleClick);
                mDataGridViewIT.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(HandleDataGridViewITEditingControlShowing);
                mDataGridViewIT.CellBeginEdit += new DataGridViewCellCancelEventHandler(HandleDataGridViewITCellBeginEdit);
                mDataGridViewIT.CellEndEdit += new DataGridViewCellEventHandler(HandleDataGridViewITCellEndEdit);

                if (exportToExcel!= null)
                {
                    exportToExcel.Text = CultureManager.TranslateString(LanguageConstantKeys.L_POP_UP_MENU_EXPORT_TO_EXCEL, LanguageConstantValues.L_POP_UP_MENU_EXPORT_TO_EXCEL);
                    exportToExcel.Click +=new EventHandler(HandleExportToExcel);
                }
                if (exportToWord != null)
                {
                    exportToWord.Text = CultureManager.TranslateString(LanguageConstantKeys.L_POP_UP_MENU_EXPORT_TO_WORD, LanguageConstantValues.L_POP_UP_MENU_EXPORT_TO_WORD);
                    exportToWord.Click += new EventHandler(HandleExportToWord);
                }

                //If the argumet allow multiselection, the grid is configure in multiselection mode,
                //otherwise the grid is configure in simple selection mode.
                ExchangeInfoSelectionForward exchangeInfoSelection = exchangeInfo as ExchangeInfoSelectionForward;
                if (exchangeInfoSelection != null)
                {
                    mDataGridViewIT.MultiSelect = exchangeInfoSelection.MultiSelectionAllowed;
                }

                if (retriveAll != null)
                {
                    retriveAll.Text = CultureManager.TranslateString(LanguageConstantKeys.L_POP_UP_MENU_RETRIEVE_ALL, LanguageConstantValues.L_POP_UP_MENU_RETRIEVE_ALL);
                    retriveAll.Click += new EventHandler(HandleRetrieveAllClick);
                }

                if (refresh != null)
                {
                    refresh.Text = CultureManager.TranslateString(LanguageConstantKeys.L_POP_UP_MENU_REFRESH, LanguageConstantValues.L_POP_UP_MENU_REFRESH);
                    refresh.Click += new EventHandler(HandleRefreshClick);
                }

                if (help != null)
                {
                    help.Text = CultureManager.TranslateString(LanguageConstantKeys.L_POP_UP_MENU_HELP, LanguageConstantValues.L_POP_UP_MENU_HELP);
                }

                if (options != null)
                {
                    options.Text = CultureManager.TranslateString(LanguageConstantKeys.L_POP_UP_MENU_OPTIONS, LanguageConstantValues.L_POP_UP_MENU_OPTIONS);
                }

                if (navigations != null)
                {
                    navigations.Text = CultureManager.TranslateString(LanguageConstantKeys.L_POP_UP_MENU_NAVIGATIONS, LanguageConstantValues.L_POP_UP_MENU_NAVIGATIONS);
                }

                Form lContainerForm = mDataGridViewIT.FindForm();
                if (lContainerForm != null)
                {
                    lContainerForm.Shown += new EventHandler(HandleContainerForm_Shown);
                }
                else
                {
                    mRaiseEventCurrentCellChanged = true;
                }
            }
            // Assigns the default texts for boolean values
            AssignDefaultTextForBooleans();
        }
开发者ID:sgon1853,项目名称:UPM_MDD_Thesis,代码行数:82,代码来源:DataGridViewPresentation.cs


注:本文中的System.Windows.Forms.DataGridView.FindForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。