We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Opening a form from a grid event

Thread ID:





2072 Dec 12,2002 10:43 PM UTC Dec 13,2002 01:26 AM UTC WinForms 2
Tags: GridControl
Robert J Harder
Asked On December 12, 2002 10:43 PM UTC

Hi, I am currently trying to invoke a form to load from the current cell validated on a grid. When the Show() method of the form is reached the application stop responding. I have the included some sample code below. The form is a new instance of the current form. private void gridQuestions_CurrentCellValidated(object sender, System.EventArgs e) { this.hasEdits=true; GridCurrentCell cc = this.gridQuestions.CurrentCell; if (gridQuestions[cc.RowIndex,cc.ColIndex].CellType=="ComboBox") { GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer; if (typeof(dsHouses.QuestionLinkedListValuesRow)==cr.ListBoxPart.SelectedItem.GetType()) { dsHouses.QuestionLinkedListValuesRow llv= cr.ListBoxPart.SelectedItem as dsHouses.QuestionLinkedListValuesRow; if (llv!=null&&!llv.IsQuestionLinkedQuestionGroupIdNull()) { Total_Cost.frmHouseQuestions ch = new frmHouseQuestions(this.objdsHouses,llv.QuestionLinkedQuestionGroupId); ch.MdiParent=this.MdiParent; ch.Show(); } } } } Thanks, Craig

Administrator [Syncfusion]
Replied On December 12, 2002 11:51 PM UTC

Does it help if you call grid.CancelUpdate(); just before calling ch.Show()? The grid might be in between Begin/EndUpdate calls while this event is raised and because of that Paint messages are ignored which causes some side unwanted effects when showing a dialog. (Something we would have to review again and change in future). Stefan

Robert J Harder
Replied On December 13, 2002 01:26 AM UTC

Ok calling CancelUpdate() didn't work, the app stopped responding at this point instead. I have now hung this off the CurrentCellEditingCompleteEvent. The form now opens as expected.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon