FlexGrid - Retrieve DisplayMember rather than ValueMember from Drop Down

Posted by: mwebster on 5 March 2019, 2:39 pm EST

    • Post Options:
    • Link

    Posted 5 March 2019, 2:39 pm EST

    I am working with the FlexGrid control and I have several columns that I have added drop down lists to via code using the “DataMap” method. It works just fine.

    My issue is this. In one example, the drop down list contains a list of part numbers (the display member) and the underlying value member is the corresponding record ID. I have no problem retrieving the PartID value using code similar to:

    PartID = fgQuoteDetails.Rows(x).Item(“PartID”)

    In some instances, I need to get the display member though rather than the value member for that drop down list. I am not sure how to get that. Any suggestions?

    Thanks,

    Mike

  • Posted 6 March 2019, 1:34 am EST

    Hi Mike,

    You just need to use the grid’s method GetDataDisplay to retrieve the corresponding display member. Code snippet is given below:

    
    Dim name As String = C1FlexGrid1.GetDataDisplay(rowIndex, colIndex)
    
    

    Documentation link: https://help.grapecity.com/componentone/NetHelp/c1flexgrid/webframe.html#C1.Win.C1FlexGrid.4~C1.Win.C1FlexGrid.C1FlexGridBase~GetDataDisplay.html

    Please refer the attached sample which demonstrates how to retrieve Display Member as soon as a cell is edited in the corresponding column. You can use the same approach in your scenario.

    Thanks,

    Pragati

    DisplayDataMap.zip

  • Posted 6 March 2019, 8:56 am EST

    Thank-you!

    Mike

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels