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

Databound Grid with master/slave Combos

I''m having a problem when I select a value in the Master Combo that filters the Slave Combo. If I have a blank value in the Slave -- it exceptions. It also exceptions if I set the .Text of my slave combo to an empty string (as suggested in http://www.syncfusion.com/Support/article.aspx?id=567) You can duplicate this problem by going to your Essential Grid Samples, Databound, GDBGcombos. On the first row, tab to the Employee combo and delete ''Buchanan'' from that combo. Then try to move off of the combo. The following exception occurs. How can I prevent this error from happening ?? catched at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.SaveCellInfo(GridSaveCellInfoEventArgs e) in :line 0 catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges(Boolean closeDropDown) in :line 0 catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.Deactivate(Boolean discardChanges) in :line 0 catched at Syncfusion.Windows.Forms.ScrollControl.RaiseCancelMouseEvent(MouseEventArgs e, CancelMouseDelegate d) in :line 0 catched at Syncfusion.Windows.Forms.Grid.GridModelDataBinder.SaveCellInfo(GridSaveCellInfoEventArgs e) in :line 0 catched at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ConfirmChanges(Boolean closeDropDown) in :line 0

1 Reply

AD Administrator Syncfusion Team August 27, 2004 02:08 PM

I think you will have to come up with a valid vale to initialize the cell with. If you cannot get an inital value some other way, worse case would be to get it directly from the slave list, maybe taking the first value in the list. Here is a snippet that will do it in the KB sample. //this.gridDataBoundGrid1[cc.RowIndex, SlaveColumn].Text = ""; DataView dv = new DataView(slaveComboTable); dv.RowFilter = string.Format("[masterId] = ''{0}''", this.gridDataBoundGrid1[cc.RowIndex, MasterColumn].Text); this.gridDataBoundGrid1[cc.RowIndex, SlaveColumn].Text = dv[0]["id"].ToString();

Loader.
Live Chat Icon For mobile
Up arrow icon