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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Combo Box Problem in Master-Details

Thread ID:

Created:

Updated:

Platform:

Replies:

19632 Sep 30,2004 01:14 PM UTC Mar 16,2005 06:21 PM UTC Windows Forms 11
loading
Tags: GridControl
vbaker
Asked On September 30, 2004 01:14 PM UTC

I have a Master-Details GDBG (using DataSet Relations). The details grid contains a combo box in the first column. I added a handler for the Enter event, as suggested previously in this forum, for the details grid (gridDataBoundGrid2) to fix a problem that caused new rows not to be added unless at least one row was already present: private void gridDataBoundGrid2_Enter(object sender, System.EventArgs e) { if(this.gridDataBoundGrid2.Model.RowCount == 1) { this.gridDataBoundGrid2.Binder.AddNew(); this.gridDataBoundGrid2.CancelUpdate(); } } However, now I am observing a problem I don''t know how to resolve. If a row in the master grid is selected which has existing rows in the details grid, and rows are added to those details using the "new row" in the combo box, everything is fine. But if immediately afterwards, I then select a row in the master grid that has no rows in the details grid, and try to pull down the combo box in the details, I receive the message: "Index was outside the bounds of the array" as soon as I click the combo box down arrow button. Also, the debug TRACE lines show as: catched at Syncfusion.Windows.Forms.Grid.GridDataBoundGrid.EndEdit() in :line 0 catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Deactivate(Boolean discardChanges) in :line 0 Any help would be appreciated. --Van Baker

Administrator [Syncfusion]
Replied On September 30, 2004 02:42 PM UTC

In the sample you referenced, I added a combobox to column 1 of the grid3, and could see the problem you described. Adding this code worked around it for me in that sample.
bool doOnce = true;
private void gridDataBoundGrid3_Enter(object sender, EventArgs e)
{
	if(doOnce && this.gridDataBoundGrid3.Model.RowCount == 1)
	{
		doOnce = false;
		this.gridDataBoundGrid3.Binder.AddNew();
	}
}

vbaker
Replied On September 30, 2004 06:06 PM UTC

Thanks. That helped a lot; however, I still get the error message the very first time I go through the scenario. After that, it seems to not occur anymore. --Van Baker

Administrator [Syncfusion]
Replied On September 30, 2004 06:45 PM UTC

Try adding the this.gridDataBoundGrid2.CancelUpdate(); line to the code to see if that avoids the error the first time.

Christian Pogea
Replied On December 17, 2004 12:09 PM UTC

Can you provide me with a sample code with a master detail grid. master has only text boxes and detail has only one combobox. it is very frustating, ''cause i tell you this issue a couple of month ago. when is it fixed? there are a lot of problems with master-details in griddataboundgrid. >Try adding the > >this.gridDataBoundGrid2.CancelUpdate(); > >line to the code to see if that avoids the error the first time.

Administrator [Syncfusion]
Replied On December 17, 2004 02:18 PM UTC

I am not sure what kind of sample you wanted. Did you submit a Direct Support incident on teh problem you are having? If it is teh problem with the details table being empty initially, then I think that is fixed in our 3.0 code base. Here a sample that runs ok in 3.0 for me, but does not run in 2.1.0.9. http://64.78.18.34/support/user/uploads/GDBG_MasterDetail120172004.zip

Christian Pogea
Replied On December 17, 2004 02:53 PM UTC

does this mean i have to pay for the update, because you didn''t fix this bug in 2.1.0.9 ??? >I am not sure what kind of sample you wanted. Did you submit a Direct Support incident on teh problem you are having? > >If it is teh problem with the details table being empty initially, then I think that is fixed in our 3.0 code base. Here a sample that runs ok in 3.0 for me, but does not run in 2.1.0.9. > >http://64.78.18.34/support/user/uploads/GDBG_MasterDetail120172004.zip

Administrator [Syncfusion]
Replied On December 17, 2004 10:13 PM UTC

You can contact sales@syncfusion.com for your options.

Christian Pogea
Replied On March 14, 2005 04:58 PM UTC

dear clay, i upgraded to syncfusion 3.0.1.0 and there are still bugs in master detail tables. just use your sample to see the issues. 1. go to the "new line" use 5 as the new parentID, type "test5" as parentName. click on the combobox and chose "ChildName0" 2. go to the "new line" use 6 as the new parentID, type "test6" as parentName. click on the combobox and chose "ChildName1" go back to our parentID 5 row. the combobox settings are gone. now go to our parentID 6 row and the combobox settings are gone, too. is there a workaround available?

Administrator [Syncfusion]
Replied On March 14, 2005 06:51 PM UTC

Here is a sample that I think works in 3010 using teh steps you outlined. It turns off the UseListChangedEvent property and handles the grid1.Leave event to make sure the datatable has the changes applied at that point. http://www.syncfusion.com/Support/user/uploads/GDBG_MasterDetail_bdc0369a.zip

Christian Pogea
Replied On March 16, 2005 03:37 PM UTC

dear clay, AcceptChanges() doesn''t solve the problem, ''cause i can''t save the changes to the database, later. i need a solution without acceptchanges.

Administrator [Syncfusion]
Replied On March 16, 2005 06:21 PM UTC

Try this.
private void gridDataBoundGrid1_Leave(object sender, EventArgs e)
{
	if(this.gridDataBoundGrid1.Binder.IsEditing)
	{
		this.gridDataBoundGrid1.CurrentCell.EndEdit();
		this.gridDataBoundGrid1.Binder.EndEdit();
		CurrencyManager cm = this.gridDataBoundGrid1.BindingContext[this.gridDataBoundGrid1.DataSource, this.gridDataBoundGrid1.DataMember] as CurrencyManager;
		cm.Refresh();
         }
}

CONFIRMATION

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.

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

;