Welcome to the Xceed Community | Help
Community Search  
More Search Options

Problems with Combox

Page 1 of 2 (16 items)   1 2 Next >
Sort Posts: Previous Next
  •  03-21-2012, 2:48 PM Post no. 31867

    Problems with Combox

    I know I have to be doing something wrong but just can't find the issue. I am using v3.9 of the .Net Grid.

    Problem: When the grid is displayed in the form, the combobox column is displaying the value of the column from the binding dataset for the grid. When I click on the cell, the combox displays the appropriate caption information. But when I move off the cell, the value either becomes empty or returns to the original value of the row from the binding dataset.

    The dataset contains multiple datatables without any relations established. The grid is bound to one of the datatables and the combobox is bound to a different datatable.

    The key value for the combo box is a string value (Alpha-Numeric). Not a typical numeric Id value showing a string Caption.

     

    What is going wrong?

     

    Here is my code:

             'Set the Grid Properties

            grdExportDetails.Enabled = True

            grdExportDetails.BeginInit()


            'Datasource

            grdExportDetails.SetDataBinding(dsExportDetails, "ProgramBase")


            'Headers

            grdExportDetails.HeaderRows.Add(columnManagerRow)

            grdExportDetails.Columns("ProgramId").Visible = False

            grdExportDetails.Columns("PackageId").Visible = False


            'Editing with single click

            grdExportDetails.SingleClickEdit = True


            'Checkbox column

            grdExportDetails.Columns("Selected").VisibleIndex = 0

            grdExportDetails.Columns("Selected").Width = 50

            grdExportDetails.Columns("Selected").CellEditorManager = New CheckBoxEditor()

            grdExportDetails.Columns("Selected").CellViewerManager = New CheckBoxViewer()

            grdExportDetails.Columns("Selected").HorizontalAlignment = HorizontalAlignment.Center

            grdExportDetails.Columns("Selected").VerticalAlignment = VerticalAlignment.Center


            'Dropdown columns

            'Currency

            CurrencyComboBoxEditor = New ComboBoxEditor(dsExportDetails, "ExchangeRates", "ExchangeSetName", "%RateDescriptor%")

            CurrencyComboBoxEditor.TemplateControl.AllowDropDown = True

            CurrencyComboBoxEditor.TemplateControl.AllowFreeText = False

            grdExportDetails.Columns("ProgBaseCurrency").CellEditorManager = CurrencyComboBoxEditor

            grdExportDetails.Columns("ProgBaseCurrency").HorizontalAlignment = HorizontalAlignment.Left


            'Readonly the other columns

            grdExportDetails.Columns("ProgBaseWeight").ReadOnly = True

            grdExportDetails.Columns("ProgBaseDistance").ReadOnly = True

            grdExportDetails.Columns("ProgBaseEnergy").ReadOnly = True

            grdExportDetails.Columns("Idnum").ReadOnly = True


            grdExportDetails.EndInit()


    Filed under: ,
  •  03-23-2012, 7:33 AM Post no. 31874 in reply to 31867

    Re: Problems with Combox

    Hi Emerson,

    You will need to set the binding for the CellViewerManager. As I can see from your code, you are not doing this. Try doing the following:

    Visual Basic
    -------------------

    grdExportDetails.Columns("Selected").CellViewerManager = New CheckBoxViewer(dsExportDetails, "ExchangeRates", "ExchangeSetName", "%RateDescriptor%")
    -------------------

    This should solve the issue as to why you cannot see the value stay at the one that is chosen.


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
  •  03-23-2012, 8:40 AM Post no. 31875 in reply to 31874

    Re: Problems with Combox

    Thanks for the reply but the problem is with the Combobox and not the checkbox. The checkbox works just fine.

     

    As for setting the CellViewerManager for the Combobox, I try to do that and I get an error indicating that the Key value - blah blah has already been loaded into some dictionary.

     

  •  03-23-2012, 8:47 AM Post no. 31876 in reply to 31875

    Re: Problems with Combox

    Additionally, the initial displayed value in the column with the combobox is the value member and not the display member.

     


     

  •  03-23-2012, 9:05 AM Post no. 31877 in reply to 31876

    Re: Problems with Combox

    Hi Emerson,

    Are you able to send me a small self-contained sample application so that way I can investigate the issue? With this information, I will be able to provide you with an answer.


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
  •  03-23-2012, 9:28 AM Post no. 31878 in reply to 31877

    Re: Problems with Combox

    I can send you the application but I am not going to be able to provide any kind of data container for you to use. Where do I send this?
  •  03-23-2012, 10:04 AM Post no. 31879 in reply to 31878

    Re: Problems with Combox

    Hi Emerson,

    is it possible to recreate the issue with dummy data? 


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
  •  03-23-2012, 10:36 AM Post no. 31881 in reply to 31879

    Re: Problems with Combox

    I'm not sure how to create a sample app that has self contained data not coming from a database. Seems kind of funny to me that in all my years of programming I have never needed to anything like that.

    I guess thinking about it, I would just need to code the building of the dataset and tables manually. Any suggestions on other easier, quicker ways would be appreciated. 

  •  03-23-2012, 1:14 PM Post no. 31884 in reply to 31881

    Re: Problems with Combox

    Attachment: TestProject149350.zip

    Hi Emerson,

    I have attached a small sample to get you started... Let me know if you can reproduce it. I will continue to investigate the issue.


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
  •  03-23-2012, 1:49 PM Post no. 31886 in reply to 31884

    Re: Problems with Combox

    Marc,

    How do I upload a zip file when I have it ready?

    I do not see any option within my browser when replying to the post to do so.

     

    Thanks. 

  •  03-23-2012, 2:06 PM Post no. 31888 in reply to 31886

    Re: Problems with Combox

    Hi Emerson,

    When you reply to this forum post, there is an 'Options' tab right about the text box. Click on it and you should see that you can add an attachment.


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
  •  03-23-2012, 2:59 PM Post no. 31891 in reply to 31888

    Re: Problems with Combox

    Attachment: XceedGridCombobox.zip

    Marc,

    Attached is sample project replicating the error that I get using the CellViewManager, not being able to see the RateDescriptor value in the column instead of the Id value of CURRDOL and the ComboxBox selection not being saved when changed.

    Thanks.

     

  •  03-23-2012, 4:17 PM Post no. 31893 in reply to 31891

    Re: Problems with Combox

    Attachment: XceedGridCombobox.zip

    Hi Emerson,

    I believe the code is fine. I had just noticed that with the data you had, I couldn't tell which one was which because I was only seeing the ID (which were all the same in the dummy data). I have re-attached the sample and as you can see it works. 


    Marc

    Developer in Technical Support
    Xceed - Multi-talented components - http://xceed.com
  •  03-23-2012, 5:25 PM Post no. 31894 in reply to 31893

    Re: Problems with Combox

    Marc,

    The data sample I sent to you was exactly what is going to be received for consumption by the grid. Changing the sample data does not resolve the issue.

    To give you a bit more of an idea of what needs to be done, I have attached an Excel worksheet with a sample of the actual  ExchangeRates structure with the data anonymized.

    The key value for each facility linking to the ExchangeRates structure is the ExchangeSetName. Just happens to be a String and not an integer value. Each ExchangeSetName has N number of RateDescriptors describing the value contained in the Rate column.

    The user is being shown the RateDescriptor values in the combo box that are available for each facilities ExchangeSetName. After the selection of the desired RateDescriptor by the user, a currency conversion process will take place using the Rate value for the selected RateDescriptor within the facilities ExchangeSetName.

    I hope this helps because we can not change the data to make the ComboBox work in the grid.

     

  •  03-27-2012, 8:37 AM Post no. 31917 in reply to 31894

    Re: Problems with Combox

    Marc,

     Now that I have had the weekend to review everything again, I believe there may be room for manipulation of the data columns into a more standard lookup style format utilizing the Id column within the data.

    Let me try a few things and will post back the results later today or tomorrow. 

Page 1 of 2 (16 items)   1 2 Next >
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.