This is a migrated thread and some comments may be shown as answers.

Multicolumn Combobox Lookup Error

5 Answers 153 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Edwin
Top achievements
Rank 1
Edwin asked on 20 May 2009, 10:46 AM

Hi,

I would like to use the multicolumn combobox as a lookup combobox. If I setup the mc combo with the same properties as a normal combobox it gives me the following message.
---------------------------
RadGridView Default Error Dialog
---------------------------
The following exception occurred in the RadGridView:

System.Data.ReadOnlyException: Column 'BusID' is read only.
   at System.Data.DataRow.set_Item(DataColumn column, Object value)
   at System.Data.DataRowView.SetColumnValue(DataColumn column, Object value)
   at System.Data.DataColumnPropertyDescriptor.SetValue(Object component, Object value)
   at Telerik.WinControls.Data.DataAccessComponent.set_Item(GridViewRowInfo row, GridViewDataColumn column, Object value)
To replace this default dialog please handle the DataError event.
---------------------------
OK  
---------------------------
These are the (in my opinion) relevant designer.cs entry's

// cmbJourneyBus(multicolumncombobox)  
this.cmbJourneyBus.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue"this.journeyBindingSource, "BusID"true));  
this.cmbJourneyBus.DataSource = this.busBindingSource;  
this.cmbJourneyBus.DisplayMember = "BusNumber";  
this.cmbJourneyBus.ValueMember = "BusID";  
 
// radComboBox1 (standard radcombobox)  
this.radComboBox1.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue"this.journeyBindingSource, "BusID"true));  
this.radComboBox1.DataSource = this.busBindingSource;  
this.radComboBox1.DisplayMember = "BusNumber";  
this.radComboBox1.ValueMember = "BusID"

Am I doing something wrong or is this a bug?

Kind regards,

Edwin Dirkzwager
CIP Software BV
The Netherlands.

5 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 22 May 2009, 09:22 AM
Hello Edwin,

The exception is related to your data source table and its read-only column "BusID". This exception may occur only if you edit data from combobox at run-time. To prevent this message you can handle DataError event from EditorControl property of RadMultiColumnComboBox.

The other solution is to hide "BusID" column from the combobox.

If you have any additional questions, feel free to contact us again.

Kind regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Edwin
Top achievements
Rank 1
answered on 22 May 2009, 08:30 PM

Hi Julian,

BusID is readonly because it is an identity field (autonumber). Wat I do not understand is why the grid complains about this field. The entire grid is readonly so it (in my opinion) should not matter. The normal combobox does not give me this problem.

Further more: handling the dataerror event is not a solution. I do not want to customize the error message, the error should not occur in the first place.

Removing the ID value from the grid might be a solution in some cases (you may want to show the ID value for certain tables). But this raises another question for which I have posted a support ticket.

Kind regards,

Edwin Dirkzwager
CIP Software BV
The Netherlands.

0
Julian Benkov
Telerik team
answered on 25 May 2009, 11:19 AM
Hello Edwin,

As we noted, the problem may occur only in edit mode. If your scenario is not in edit mode, please send us your project to reproduce the problem locally. Please open a new support ticket so that you can attach files.

Kind regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Richard Slade
Top achievements
Rank 2
answered on 06 Jul 2009, 10:15 AM
Ive got the same issue.
I have a multi combo bound to a small data source. The drop down grid correctly shows the data, but when I try and set the SelectedValue (not in edit mode, just selecting the value) it compains that the Id column is constrained. I am not changing any values, mearly setting the selected value.
0
Julian Benkov
Telerik team
answered on 07 Jul 2009, 10:00 AM
Hello Richard Slade,

We found problems related to SelectedValue property. The fix will be available in Q2 2009 SP1 release.

Thank you for reporting the issue. Your Telerik points have been updated.

Sincerely yours,
Julian Benkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
MultiColumn ComboBox
Asked by
Edwin
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Edwin
Top achievements
Rank 1
Richard Slade
Top achievements
Rank 2
Share this question
or