Multicolumn Combobox Lookup Error

6 posts, 0 answers
  1. Edwin
    Edwin avatar
    10 posts
    Member since:
    Mar 2008

    Posted 20 May 2009 Link to this post

    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

    1 // cmbJourneyBus(multicolumncombobox)  
    2 this.cmbJourneyBus.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue"this.journeyBindingSource, "BusID"true));  
    3 this.cmbJourneyBus.DataSource = this.busBindingSource;  
    4 this.cmbJourneyBus.DisplayMember = "BusNumber";  
    5 this.cmbJourneyBus.ValueMember = "BusID";  
    6  
    7 // radComboBox1 (standard radcombobox)  
    8 this.radComboBox1.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue"this.journeyBindingSource, "BusID"true));  
    9 this.radComboBox1.DataSource = this.busBindingSource;  
    10 this.radComboBox1.DisplayMember = "BusNumber";  
    11 this.radComboBox1.ValueMember = "BusID"

    Am I doing something wrong or is this a bug?

    Kind regards,

    Edwin Dirkzwager
    CIP Software BV
    The Netherlands.

  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 22 May 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Edwin
    Edwin avatar
    10 posts
    Member since:
    Mar 2008

    Posted 22 May 2009 Link to this post

    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.

  5. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 25 May 2009 Link to this post

    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.
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 06 Jul 2009 Link to this post

    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.
  7. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 07 Jul 2009 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready