in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Displaying selected value in RepositoryItemComboBox

Last post 11/19/2008 2:16 AM by Christian. 1 replies.
Page 1 of 1 (2 items)
Sort Posts:
Previous Next
  • 11/19/2008 2:04 AM

    Displaying selected value in RepositoryItemComboBox

    I have an xtragrid on my form, one of the column uses repositoryItemComboBox.  Assuming the combobox contains items "A","B","C","D","E" and "F", I want a messagebox to pop up with the selected item when the user clicks on the control and selects an item. e.g. Selecting "C" should pop up "The item is C".

    At this moment, the initial item in the box is "A". When I select "B", the text in the combobox shows "B", but the messagebox will say "A". If I next choose "F", the messagebox will say "B". Following that if I choose "D" the messagebox will return "F". In short, repeating the action results in the messagebox always returning the last item selected, and not the current one.

    My code snippet is as follows:

    ---

    Private Sub RepositoryItemComboBox1_CloseUp(ByVal sender As Object, ByVal e As DevExpress.XtraEditors.Controls.CloseUpEventArgs) Handles RepositoryItemComboBox1.CloseUp

            GridView1.PostEditor()

            GridView1.UpdateCurrentRow()

            MessageBox.Show(GridView1.GetRowCellValue(GridView1.FocusedRowHandle, colSubject), "Cell Value Is: ")

        End Sub

    --- 

    I've checked some of the forum threads and also the knowledgebase/support centre threads and found some similar situations, but is unable to resolve the issue.

    Any advise? Thanks.

  • 11/19/2008 2:16 AM In reply to

    [SOLVED] Displaying selected value in RepositoryItemComboBox

    Argh... found that I should have handled the EditValueChanged event instead of CloseUp, and it'll work (without having to use UpdateCurrentRow) as well.

Page 1 of 1 (2 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED