Ticket Q304697
Visible to All Users

Combobox within Xtragrid bound to column value

created 14 years ago

I have a column n my xtragrid that is bound to a column in the dataset :
the column contains values 1,2 and 3
I have set the Column Edit property of that xtragrid column to RepositoryItemComboBox2 and populated the combobox with three values ie: US, Canada,France
on the CustomRowCellEdit event I want the combobox to display the values in the combobox based on the value of the column in the data set
EG:
if "columnname" = 1
then RepositoryItemComboBox2 item1
if "columnname" = 2
then RepositoryItemComboBox2 item2
etc…
How do I go about achieveing this?

Comments (3)
DevExpress Support Team 14 years ago

    Hi Isaac,
    Thank you for your message.
    Unless I am mistaken you wish to display "US", "Canada" and "France" in a grid column while this column contains values 1, 2 and 3.
    If it is so, the best way to get it done is to use RepositoryItemLookUpEdit instead. Just set theRepositoryItemLookUpEdit.DataSource property to an appropriate datasource, the RepositoryItemLookUpEdit.DisplayMember property - to a column name that should match a display text and the RepositoryItemLookUpEdit.ValueMember property - to a column name that should be associated with an edit value.
    We hope that you find this information helpful.
    Thanks,
    Svetlana

      Hi,
             Thanks for the reply. I will try that out and get back.
      One more thing:
      i wanted to implement something similar to the above but this time with images.
      i want an unbound column and want to display an image based on a value of another column.
      How do I go about doing this:
      EG:
      Column1(Unbound) Column2(value)
      Image 1 1
      image2 2
      image3 3
      I have searched the knowledge base but wasnt able to find anything…
      Something to do with the CustomRowCellEdit event .?

      DevExpress Support Team 14 years ago

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.