Binding Issue

12 posts, 0 answers
  1. Carol Watson
    Carol Watson avatar
    21 posts
    Member since:
    Jan 2010

    Posted 15 Feb 2011 Link to this post

    Hi... I am using your Muliticolumn combo box version 2010.3.10.1215
    I have a binding issue..
    I have declared two DataAdapters and DataViews and populated them from a database... I am attempting to late bind the multicolumn combo box to the two dataviews

    The code I have used is

    cboLookup.DataBindings.Add("SelectedValue", dvData, "RecordID")
    cboLookup.DataSource = dvDisplayList
    cboLookup.ValueMember = "RecordID"
    cboLookup.DisplayMember = "ShortDescription"
     
    the combo properly populates and displays the contents of the datasource (dvDisplayList)... but does not bind the selectedvalue property (or the selectedItem for that matter).  So as I move through the items in the dvData dataview, the combo does not display the corresponding entry in the datasource, it selects the first record and does not move. 

    I attempted the same code with your RadDropDown list, and it responds as I expected.  I found when I simply added the Rad Drop down list to the form  along with the multi column combo box the multi column combo box behaved as expected. 

    Am I doing something wrong here...?
    Thanks for any assistance..
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 18 Feb 2011 Link to this post

    Hi Carol Watson,

    Thank you for writing.

    I tested a scenario similar to the described one and it is true that it does not behave correctly. However, I am not sure that this approach with setting binding for SelectedValue property is the most appropriate in this case. If you want to change the current record and the selected value in RadMultiColumnComboBox, I would recommend that you consider using BindingSources and their PositionChanged events instead DataViews.

    Let me know if you need any additional assistance to implement your requirement in the offered approach.

    All the best,
    Martin Vasilev
    the Telerik team
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sepp
    Sepp avatar
    1 posts
    Member since:
    Jun 2011

    Posted 15 Jun 2011 Link to this post

    i've got the same problem with binding to the valueMember.
    Is there any solution?
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 20 Jun 2011 Link to this post

    Hi Sepp,

    Thank you for writing.

    I would second the same suggestion: use BindingSources and their PositionChanged events instead DataViews.

    If this does not suit your scenario, I will need more details about your project. In this case please open a new support ticket and attach a small sample application, which demonstrates your issue. This will help me to investigate it further and provide you with accurate assistance.

    Best wishes,
    Martin Vasilev
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
  6. Carol Watson
    Carol Watson avatar
    21 posts
    Member since:
    Jan 2010

    Posted 05 Aug 2011 Link to this post

    I have tried your suggestion and now find myself facing another issue.  I am currently using version 2011.1.11.419 Version of the controls and the multi column combo box still presents a binding issue.

    Again late binding the combo box to a binding source using:

    RadComboBox.DataBindings.Add("SelectedValue", bsItem, "ItemID", True, DataSourceUpdateMode.OnPropertyChanged)
     RadComboBox.DataSource = bsItemList
    RadComboBox.ValueMember = "ItemID"
    RadComboBox.DisplayMember = "ShortDescription"

    When scrolling through the The bound binding source the combo box displays the correct selected item.  However, On a new record, the combo box does not update the binding source when an item is selected from the list.  The selected Index and Selected value event on the combo box fires, but the binding source remains unchanged.  I attempted to trap the update in the BindingSource's binding Complete event.  While the other Controls on the form trigger the event (Rad Check box, radTextbox, radDropDownList), the multi- column combo box does not.

    Is this an error or am I still doing something wrong.

    Thank you for the assistance..
  7. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 10 Aug 2011 Link to this post

    Hi Carol Watson,

    Thank you for getting back to me.

    I am afraid I do not understand your scenario completely. I have set up a RadMultiColumnComboBox bound to a BindingSource and it seems that the newly added rows are reflected as expected.

    Could you please open a new support ticket and send me a small sample project which demonstrates your scenario? This will help me investigate the case and provide you with further assistance.

    All the best,
    Martin Vasilev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  8. Carol Watson
    Carol Watson avatar
    21 posts
    Member since:
    Jan 2010

    Posted 15 Aug 2011 Link to this post

    Thank you for the reply.  

    I have installed the 2011.1.11.419 (Demo) on another machine to test, and I realize that on that machine the multi-column combo box behaves the way it ought.  The behaviour I am experiencing on my development machine is not exhibited on that test machine.  I am not sure what is causing this, but, If I placed a standard Visual Studio Combo box, or a RadDropDownList on the form along with the multi-column combo on the form (on my development machine), the multi-column combo box binds properly.  

    Would this still be an issue which you can help me with?
  9. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 18 Aug 2011 Link to this post

    Hi Carol,

    Thank you for contacting me again.

    In fact, it is quite hard for us to track down the issue without reproducing it in our side. Especially, in such cases, which show somewhat random pattern. Issues of the described kind are not supposed to happen randomly, if there is an issue, it should occur on all machines.

    I am not sure that I understood if you have managed to isolate the issue in a separate project. However, ensure you are using the same project, with same references and settings on your different PCs. If still experience described issue, please open a new support ticket send us your sample. We will try to reproduce and investigate the case further.

    Greetings,
    Martin Vasilev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  10. Carol Watson
    Carol Watson avatar
    21 posts
    Member since:
    Jan 2010

    Posted 22 Aug 2011 Link to this post

    I have managed to isolate the issue to my development machine.  Every project I create/open on my development machine exhibits the same behavior.  While I haven't tried the project on another machine, I have created another project on another machine and the controls do not exhibit the behavior I am experiencing on my development machine.   I plan to compare project references on both machines to check if the issue could be coming from something there.  Will update you as I continue to attempt to resolve this.  

    Thanks for your assistance.
  11. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 25 Aug 2011 Link to this post

    Hello Carol Watson,

    I suggest you to test the project which triggers the wrong behavior on the different machine. Please make sure that you are using the same telerik dll versions in both situations. Also, please check if there are installed any telerik assemblies in GAC.

    I look forward to your reply.

    Regards,
    Martin Vasilev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  12. David Wharekura
    David Wharekura avatar
    1 posts
    Member since:
    May 2007

    Posted 25 Aug 2011 Link to this post

    I think I may have found the solution. I too had the same problem and I added the column that is set in the Value Member property (in my case and probably most cases - Id) to the columns collection - via the EditorControl group property. Prior to this the FK column was set to null when I did a datacontext.submitchanges (LinqToSQL).

    The id column in the drop down can be set to IsVisible = false, unless of course a Guid means something to your customers.

    To ensure it wasnt by chance that it started working, I removed the Id column from the columns collection and found I was able to reproduce the problem. Re-added the Id column and the problem went away.

    Hope this helps.
  13. Carol Watson
    Carol Watson avatar
    21 posts
    Member since:
    Jan 2010

    Posted 26 Aug 2011 Link to this post

    Wow... that solution works... nice workaround ... thank you !!!
Back to Top
UI for WinForms is Visual Studio 2017 Ready